mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Format all files with black correcting line length
This commit is contained in:
@@ -154,9 +154,7 @@ def strings2pot(target, dest):
|
||||
def allstrings2pot(lprojpath, dest, excludes=None):
|
||||
allstrings = files_with_ext(lprojpath, ".strings")
|
||||
if excludes:
|
||||
allstrings = [
|
||||
p for p in allstrings if op.splitext(op.basename(p))[0] not in excludes
|
||||
]
|
||||
allstrings = [p for p in allstrings if op.splitext(op.basename(p))[0] not in excludes]
|
||||
for strings_path in allstrings:
|
||||
strings2pot(strings_path, dest)
|
||||
|
||||
@@ -195,11 +193,7 @@ def generate_cocoa_strings_from_code(code_folder, dest_folder):
|
||||
# genstrings produces utf-16 files with comments. After having generated the files, we convert
|
||||
# them to utf-8 and remove the comments.
|
||||
ensure_empty_folder(dest_folder)
|
||||
print_and_do(
|
||||
'genstrings -o "{}" `find "{}" -name *.m | xargs`'.format(
|
||||
dest_folder, code_folder
|
||||
)
|
||||
)
|
||||
print_and_do('genstrings -o "{}" `find "{}" -name *.m | xargs`'.format(dest_folder, code_folder))
|
||||
for stringsfile in os.listdir(dest_folder):
|
||||
stringspath = op.join(dest_folder, stringsfile)
|
||||
with open(stringspath, "rt", encoding="utf-16") as fp:
|
||||
@@ -214,9 +208,7 @@ def generate_cocoa_strings_from_code(code_folder, dest_folder):
|
||||
|
||||
|
||||
def generate_cocoa_strings_from_xib(xib_folder):
|
||||
xibs = [
|
||||
op.join(xib_folder, fn) for fn in os.listdir(xib_folder) if fn.endswith(".xib")
|
||||
]
|
||||
xibs = [op.join(xib_folder, fn) for fn in os.listdir(xib_folder) if fn.endswith(".xib")]
|
||||
for xib in xibs:
|
||||
dest = xib.replace(".xib", ".strings")
|
||||
print_and_do("ibtool {} --generate-strings-file {}".format(xib, dest))
|
||||
@@ -234,10 +226,6 @@ def localize_stringsfile(stringsfile, dest_root_folder):
|
||||
|
||||
|
||||
def localize_all_stringsfiles(src_folder, dest_root_folder):
|
||||
stringsfiles = [
|
||||
op.join(src_folder, fn)
|
||||
for fn in os.listdir(src_folder)
|
||||
if fn.endswith(".strings")
|
||||
]
|
||||
stringsfiles = [op.join(src_folder, fn) for fn in os.listdir(src_folder) if fn.endswith(".strings")]
|
||||
for path in stringsfiles:
|
||||
localize_stringsfile(path, dest_root_folder)
|
||||
|
||||
Reference in New Issue
Block a user