-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery refactored main branch #13
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,25 +147,24 @@ def getPythonVersions(): | |
|
||
|
||
def readDataFile(filename): | ||
values = {} | ||
|
||
if os.path.exists(filename): | ||
# There was a bug, where Scons output was done even if used --quiet. | ||
code = "".join( | ||
line for line in open(filename, "r") | ||
if "Nuitka-Scons:" not in line | ||
) | ||
if not os.path.exists(filename): | ||
return None | ||
# There was a bug, where Scons output was done even if used --quiet. | ||
code = "".join( | ||
line for line in open(filename, "r") | ||
if "Nuitka-Scons:" not in line | ||
) | ||
|
||
try: | ||
exec(code, values) | ||
except ValueError: | ||
return None | ||
values = {} | ||
|
||
del values["__builtins__"] | ||
return values | ||
else: | ||
try: | ||
exec(code, values) | ||
except ValueError: | ||
return None | ||
|
||
del values["__builtins__"] | ||
return values | ||
Comment on lines
+150
to
+166
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
def updateConstructGraphs(): | ||
home_dir = getHomeDir() | ||
|
@@ -659,7 +658,7 @@ def _updateNumbers(python): | |
fullpath = os.path.join(branch_path, filename) | ||
|
||
if filename.endswith((".data", ".html")): | ||
case_name = filename[:-5] + ".py" | ||
case_name = f'{filename[:-5]}.py' | ||
Comment on lines
-662
to
+661
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
case_filename = os.path.join(cases_dir, case_name) | ||
if not os.path.exists(case_filename): | ||
|
@@ -766,7 +765,7 @@ def main(): | |
|
||
def runNikolaCommand(command): | ||
print("Starting nikola command:", command) | ||
assert 0 == os.system("nikola " + command) | ||
assert 0 == os.system(f'nikola {command}') | ||
Comment on lines
-769
to
+768
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
print("Succeeded nikola command:", command) | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
hackContentClasses
refactored with the following changes:remove-unreachable-code
)