Skip to content

Commit

Permalink
Continuing on quote consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Sep 24, 2023
1 parent 2b1aa13 commit 6cdd8f9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
20 changes: 10 additions & 10 deletions picard/util/script_detector_weighted.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ class ScriptSelectionOrder(IntEnum):
# characters to convey the same information as other characters sets. The factor is generally
# based on the relative number of characters in the alphabet compared with the LATIN alphabet.
SCRIPT_WEIGHTING_FACTORS = {
"LATIN": 1.0,
"CYRILLIC": 1.02,
"GREEK": 0.92,
"ARABIC": 1.08,
"HEBREW": 0.85,
"CJK": 2.5,
"HANGUL": 0.92,
"HIRAGANA": 1.77,
"KATAKANA": 1.77,
"THAI": 1.69,
'LATIN': 1.0,
'CYRILLIC': 1.02,
'GREEK': 0.92,
'ARABIC': 1.08,
'HEBREW': 0.85,
'CJK': 2.5,
'HANGUL': 0.92,
'HIRAGANA': 1.77,
'KATAKANA': 1.77,
'THAI': 1.69,
}


Expand Down
14 changes: 7 additions & 7 deletions picard/util/scripttofilename.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ def script_to_filename_with_metadata(naming_format, metadata, file=None, setting
config = get_config()
settings = config.setting
# make sure every metadata can safely be used in a path name
win_compat = IS_WIN or settings["windows_compatibility"]
win_compat = IS_WIN or settings['windows_compatibility']
new_metadata = Metadata()
replace_dir_separator = settings["replace_dir_separator"]
replace_dir_separator = settings['replace_dir_separator']
for name in metadata:
new_metadata[name] = [
sanitize_filename(str(v), repl=replace_dir_separator, win_compat=win_compat)
for v in metadata.getall(name)
]
naming_format = naming_format.replace("\t", "").replace("\n", "")
naming_format = naming_format.replace('\t', '').replace('\n', '')
filename = ScriptParser().eval(naming_format, new_metadata, file)
if settings["ascii_filenames"]:
if settings['ascii_filenames']:
filename = replace_non_ascii(filename, pathsave=True, win_compat=win_compat)
# replace incompatible characters
if win_compat:
filename = replace_win32_incompat(filename, replacements=settings["win_compat_replacements"])
if settings["replace_spaces_with_underscores"]:
filename = replace_win32_incompat(filename, replacements=settings['win_compat_replacements'])
if settings['replace_spaces_with_underscores']:
filename = _re_replace_underscores.sub('_', filename.strip())
# remove null characters
filename = filename.replace("\x00", "")
filename = filename.replace('\x00', '')
return (filename, new_metadata)


Expand Down
32 changes: 16 additions & 16 deletions picard/util/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@


_versions = OrderedDict([
("version", PICARD_FANCY_VERSION_STR),
("python-version", python_version()),
("pyqt-version", pyqt_version),
("qt-version", qVersion()),
("mutagen-version", mutagen_version),
("discid-version", discid_version),
("astrcmp", astrcmp_implementation),
("ssl-version", QSslSocket.sslLibraryVersionString())
('version', PICARD_FANCY_VERSION_STR),
('python-version', python_version()),
('pyqt-version', pyqt_version),
('qt-version', qVersion()),
('mutagen-version', mutagen_version),
('discid-version', discid_version),
('astrcmp', astrcmp_implementation),
('ssl-version', QSslSocket.sslLibraryVersionString())
])

_names = {
"version": "Picard",
"python-version": "Python",
"pyqt-version": "PyQt",
"qt-version": "Qt",
"mutagen-version": "Mutagen",
"discid-version": "Discid",
"astrcmp": "astrcmp",
"ssl-version": "SSL",
'version': "Picard",
'python-version': "Python",
'pyqt-version': "PyQt",
'qt-version': "Qt",
'mutagen-version': "Mutagen",
'discid-version': "Discid",
'astrcmp': "astrcmp",
'ssl-version': "SSL",
}


Expand Down

0 comments on commit 6cdd8f9

Please sign in to comment.