Modernize sandbox/update_plugins_messagespot.py

This commit is contained in:
Valentin Lorentz 2022-02-05 23:51:04 +01:00
parent 5b7b2bd85b
commit 736430de5b

View File

@ -1,14 +1,11 @@
import os import pathlib
import pbs import subprocess
pbs.cd('Admin') for plugin_path in pathlib.Path("plugins/").iterdir():
for plugin in os.listdir('..'): assert plugin_path.exists()
path = os.path.join('..', plugin) if not plugin_path.is_dir():
print(repr(path))
assert os.path.exists(path)
if not os.path.isdir(path):
print 1
continue continue
print 2 plugin_name = plugin_path.name
pbs.cd(path) if plugin_name[0] == plugin_name[0].lower():
pbs.pygettext('-D', 'config.py', 'plugin.py') continue
subprocess.run(["pygettext3", "-D", "config.py", "plugin.py"], cwd=plugin_path)