mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
yapf lint
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
print("You are about to add a new generator to the table in futureGenerators.md")
|
||||
print(
|
||||
"You are about to add a new generator to the table in futureGenerators.md")
|
||||
print("Please fill out the following:")
|
||||
title = input("> Title: ")
|
||||
example_problem = input("> Example Problem: ")
|
||||
@@ -14,4 +15,5 @@ else:
|
||||
|
||||
with open(file, 'a') as f:
|
||||
f.writelines(
|
||||
f'| {title} | {example_problem} | {example_solution} | {further_explanation} |\n')
|
||||
f'| {title} | {example_problem} | {example_solution} | {further_explanation} |\n'
|
||||
)
|
||||
|
||||
@@ -18,15 +18,17 @@ def get_filepaths(subject_name):
|
||||
# Join the two strings in order to form the full filepath.
|
||||
filepath = os.path.join(root, filename)
|
||||
|
||||
front_len = 24+len(subject_name)
|
||||
front_len = 24 + len(subject_name)
|
||||
filename = filepath[front_len:-3]
|
||||
file_paths.append(filename) # Add it to the list.
|
||||
|
||||
return file_paths
|
||||
|
||||
|
||||
subjects = ['algebra', 'basic_math', 'calculus',
|
||||
'computer_science', 'geometry', 'misc', 'statistics']
|
||||
subjects = [
|
||||
'algebra', 'basic_math', 'calculus', 'computer_science', 'geometry',
|
||||
'misc', 'statistics'
|
||||
]
|
||||
for subject in subjects:
|
||||
full_file_paths = get_filepaths(subject)
|
||||
full_file_paths.sort()
|
||||
|
||||
@@ -142,7 +142,7 @@ def main():
|
||||
for write_line in write_list:
|
||||
lines.append(write_line)
|
||||
|
||||
with open('../README.md', "w", encoding = 'utf-8') as g:
|
||||
with open('../README.md', "w", encoding='utf-8') as g:
|
||||
g.writelines(lines)
|
||||
|
||||
print("New README.md table generated")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Use this file to determine which ID to use for the next generator that you add
|
||||
from mathgenerator import mathgen
|
||||
|
||||
print(mathgen.getGenList()[-1][0]+1)
|
||||
print(mathgen.getGenList()[-1][0] + 1)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
name = 'computer_science'
|
||||
with open (f'/home/luke/src/mathgenerator/mathgenerator/{name}.py', 'w') as f:
|
||||
with open(f'/home/luke/src/mathgenerator/mathgenerator/{name}.py', 'w') as f:
|
||||
source_dir_path = f'/home/luke/src/mathgenerator/mathgenerator/{name}'
|
||||
files = os.listdir(source_dir_path)
|
||||
for file in sorted(files):
|
||||
|
||||
Reference in New Issue
Block a user