Accepting request 800979 from home:ithod:updated
- Fix inkscape-split-extensions-extra.py for older python versions. OBS-URL: https://build.opensuse.org/request/show/800979 OBS-URL: https://build.opensuse.org/package/show/graphics/inkscape?expand=0&rev=62
This commit is contained in:
parent
d4e95d2f28
commit
a82e78304d
@ -11,7 +11,7 @@ def make_deplist(inx_list, module_list):
|
|||||||
inx_regex = re.compile(rf">(.+)\.py</(dependency|command)>")
|
inx_regex = re.compile(rf">(.+)\.py</(dependency|command)>")
|
||||||
|
|
||||||
for entry in inx_list:
|
for entry in inx_list:
|
||||||
with open(os.path.join(".", entry)) as file:
|
with open(os.path.join(".", entry), encoding="utf-8") as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
match = inx_regex.search(line)
|
match = inx_regex.search(line)
|
||||||
if (match and match.group(1)
|
if (match and match.group(1)
|
||||||
@ -21,7 +21,7 @@ def make_deplist(inx_list, module_list):
|
|||||||
for module in module_list.union(modules):
|
for module in module_list.union(modules):
|
||||||
name = os.path.join(".", f"{module}.py")
|
name = os.path.join(".", f"{module}.py")
|
||||||
if os.path.isfile(name):
|
if os.path.isfile(name):
|
||||||
with open(name) as file:
|
with open(name, encoding="utf-8") as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
match = re.match(r"from (.+) import", line)
|
match = re.match(r"from (.+) import", line)
|
||||||
if not match:
|
if not match:
|
||||||
@ -53,7 +53,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# Search all .py files importing one of the mentioned modules.
|
# Search all .py files importing one of the mentioned modules.
|
||||||
for entry in pathlib.Path(".").glob("**/*.py"):
|
for entry in pathlib.Path(".").glob("**/*.py"):
|
||||||
with entry.open() as file:
|
with entry.open(encoding="utf-8") as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
if import_regex.search(line):
|
if import_regex.search(line):
|
||||||
name = str(entry.as_posix())
|
name = str(entry.as_posix())
|
||||||
@ -79,7 +79,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
for entry in pathlib.Path(".").iterdir():
|
for entry in pathlib.Path(".").iterdir():
|
||||||
if entry.is_file() and entry.suffix == ".inx":
|
if entry.is_file() and entry.suffix == ".inx":
|
||||||
with entry.open() as file:
|
with entry.open(encoding="utf-8") as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
if inx_regex.search(line):
|
if inx_regex.search(line):
|
||||||
extra_inx.add(entry.name)
|
extra_inx.add(entry.name)
|
||||||
@ -103,17 +103,17 @@ if __name__ == "__main__":
|
|||||||
std_list = work_dir / "inkscape.lst"
|
std_list = work_dir / "inkscape.lst"
|
||||||
extra_list = work_dir / "inkscape-extensions-extra.lst"
|
extra_list = work_dir / "inkscape-extensions-extra.lst"
|
||||||
|
|
||||||
with std_list.open("w") as file:
|
with std_list.open("w", encoding="utf-8") as file:
|
||||||
for inx in std_inx:
|
for inx in std_inx:
|
||||||
if not exclusion_regex.match(inx):
|
if not exclusion_regex.match(inx):
|
||||||
print(f"{prefix}{inx}", file=file)
|
print(f"{prefix}{inx}", file=file)
|
||||||
with extra_list.open("w") as file:
|
with extra_list.open("w", encoding="utf-8") as file:
|
||||||
for inx in extra_inx:
|
for inx in extra_inx:
|
||||||
if not exclusion_regex.match(inx):
|
if not exclusion_regex.match(inx):
|
||||||
print(f"{prefix}{inx}", file=file)
|
print(f"{prefix}{inx}", file=file)
|
||||||
|
|
||||||
|
|
||||||
with std_list.open("a") as std_file, extra_list.open("a") as extra_file:
|
with std_list.open("a", encoding="utf-8") as std_file, extra_list.open("a", encoding="utf-8") as extra_file:
|
||||||
for entry in pathlib.Path(".").iterdir():
|
for entry in pathlib.Path(".").iterdir():
|
||||||
if entry.is_file() and entry.suffix == ".py":
|
if entry.is_file() and entry.suffix == ".py":
|
||||||
name = str(entry.as_posix())
|
name = str(entry.as_posix())
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 7 08:30:50 UTC 2020 - thod_@gmx.de
|
||||||
|
|
||||||
|
- Fix inkscape-split-extensions-extra.py for older python versions.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 4 15:29:43 UTC 2020 - Alexei Sorokin <sor.alexei@meowr.ru>
|
Tue May 4 15:29:43 UTC 2020 - Alexei Sorokin <sor.alexei@meowr.ru>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user