Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,6 @@ def hackContentClasses(infile):

return

contents = open(infile).read()

new_contents = contents.split(
"""<img alt="images/Nuitka-Logo-Symbol.png" src="images/Nuitka-Logo-Symbol.png">""",
1
)
new_contents = "".join( new_contents )

if contents != new_contents:
open(infile,"w").write(new_contents)
Comment on lines 639 to -649
Copy link
Author

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:



def htmlcompressor(infile):
import os
Expand Down
33 changes: 16 additions & 17 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function readDataFile refactored with the following changes:



def updateConstructGraphs():
home_dir = getHomeDir()
Expand Down Expand Up @@ -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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _updateNumbers refactored with the following changes:


case_filename = os.path.join(cases_dir, case_name)
if not os.path.exists(case_filename):
Expand Down Expand Up @@ -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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main.runNikolaCommand refactored with the following changes:

print("Succeeded nikola command:", command)


Expand Down