-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix os to pathlib remaining errors and old style format strings to f-…
…strings (with flynt)
- Loading branch information
Showing
28 changed files
with
361 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ def special_aatrade_package_extraction(source): | |
files = source.iterdir() | ||
if any([x.startswith('aatrade_package') for x in files]): | ||
# we got the special case | ||
print('aatrade package extraction of {}'.format(source)) | ||
print(f'aatrade package extraction of {source}') | ||
|
||
# first delete all, that do not begin with the package name | ||
for file in files: | ||
|
@@ -34,7 +34,7 @@ def special_aatrade_package_extraction(source): | |
|
||
# base path is the directory containing this file | ||
base_path = pathlib.Path(__file__) | ||
print('base path={}'.format(base_path)) | ||
print(f'base path={base_path}') | ||
|
||
# recreate archive path | ||
archive_path = base_path / 'downloads' | ||
|
@@ -44,7 +44,7 @@ def special_aatrade_package_extraction(source): | |
# load source releases urls | ||
with open(base_path / 'aatraders.json', 'r') as f: | ||
urls = json.load(f) | ||
print('will process {} urls'.format(len(urls))) | ||
print(f'will process {len(urls)} urls') | ||
if len(urls) != len(set(urls)): | ||
raise RuntimeError("urls list contains duplicates") | ||
|
||
|
@@ -68,14 +68,14 @@ def special_aatrade_package_extraction(source): | |
if destination.exists(): | ||
continue | ||
# download | ||
print(' download {}'.format(os.path.basename(destination))) | ||
print(f' download {os.path.basename(destination)}') | ||
download_url(url, destination) | ||
|
||
# extract them | ||
print('extract downloaded archives') | ||
extracted_archives = [x + '-extracted' for x in archives] | ||
for archive, extracted_archive in zip(archives, extracted_archives): | ||
print(' extract {}'.format(os.path.basename(archive))) | ||
print(f' extract {os.path.basename(archive)}') | ||
# only if not yet existing | ||
if extracted_archive.exists(): | ||
continue | ||
|
@@ -109,7 +109,7 @@ def special_aatrade_package_extraction(source): | |
|
||
print('proposed order') | ||
for url, _, version, _, date, size in db: | ||
print(' date={} version={} size={}'.format(date, version, size)) | ||
print(f' date={date} version={version} size={size}') | ||
|
||
# git init | ||
git_path = base_path / 'aatrade' | ||
|
@@ -125,7 +125,7 @@ def special_aatrade_package_extraction(source): | |
print('process revisions') | ||
git_author = 'akapanamajack, tarnus <[email protected]>' | ||
for url, archive_path, version, _, date, _ in db: | ||
print(' process version={}'.format(version)) | ||
print(f' process version={version}') | ||
|
||
# clear git path without deleting .git | ||
print(' clear git') | ||
|
@@ -151,6 +151,6 @@ def special_aatrade_package_extraction(source): | |
# perform the commit | ||
print('git commit') | ||
os.chdir(git_path) | ||
message = 'version {} ({}) on {}'.format(version, url, date) | ||
print(' message "{}"'.format(message)) | ||
subprocess_run(['git', 'commit', '--message={}'.format(message), '--author={}'.format(git_author), '--date={}'.format(date)]) | ||
message = f'version {version} ({url}) on {date}' | ||
print(f' message "{message}"') | ||
subprocess_run(['git', 'commit', f'--message={message}', f'--author={git_author}', f'--date={date}']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.