Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
UPLOAD_FILE_NAME: tabcmd.exe
OUT_FILE_NAME: tabcmd.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
- os: macos-13
- os: macos-latest
TARGET: macos
CMD_BUILD: >
pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/
Expand Down Expand Up @@ -96,7 +96,14 @@ jobs:
tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }}


- name: Upload build artifact for ${{ matrix.TARGET }}
uses: actions/upload-artifact@v4
with:
name: tabcmd-${{ matrix.TARGET }}
path: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }}

- name: Upload binaries to release for ${{ matrix.TARGET }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
97 changes: 55 additions & 42 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,23 @@
Usage:
pip install -e .[localize]
doit list # see available tasks
doit localize # runs all localization tasks in sequence: properties -> po -> mo

"""


def task_localize():
"""
Runs localization pipeline in sequence:
properties -> po -> mo
"""
return {
"actions": [],
"task_dep": ["properties", "po", "mo"],
}



def task_properties():

"""
Expand Down Expand Up @@ -252,48 +265,6 @@ def process_locales():
}


def task_clean_all():

"""remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder"""

def clean_output_files():
print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests")

"""For all languages: removes all generated intermediate files (properties, po) from the loc build.
all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale]
and the final tabcmd.mo files in LC_MESSAGES generated by
>doit properties po mo
"""

def clean_string_files():
for current_locale in LOCALES:
FILESETS = [
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"),
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"),
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"),
]
for PATH in FILESETS:
for file in glob.glob(PATH):
print("deleting {}".format(os.path.abspath(file)))
try:
os.remove(file)
except OSError:
pass

STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*")
for file in glob.glob(STRING_FILES):
print("deleting {}".format(os.path.abspath(file)))
try:
os.remove(file)
except OSError:
pass

return {
"actions": [clean_string_files, clean_output_files],
"verbosity": 2,
}


def task_mo():
"""
For all languages: Processes the tabcmd.po file to produce a final tabcmd.mo file for each language
Expand Down Expand Up @@ -350,6 +321,7 @@ def check_mo():
}



def task_version():

"""Generates a metadata info file with current version to be bundled by pyinstaller"""
Expand Down Expand Up @@ -418,3 +390,44 @@ def uniquify_file(filename):
)
else:
print("Saved {} sorted unique lines to {}".format(len(uniques), filename))

def task_clean_all():

"""remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder"""

def clean_output_files():
print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests")

"""For all languages: removes all generated intermediate files (properties, po) from the loc build.
all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale]
and the final tabcmd.mo files in LC_MESSAGES generated by
>doit properties po mo
"""

def clean_string_files():
for current_locale in LOCALES:
FILESETS = [
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"),
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"),
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"),
]
for PATH in FILESETS:
for file in glob.glob(PATH):
print("deleting {}".format(os.path.abspath(file)))
try:
os.remove(file)
except OSError:
pass

STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*")
for file in glob.glob(STRING_FILES):
print("deleting {}".format(os.path.abspath(file)))
try:
os.remove(file)
except OSError:
pass

return {
"actions": [clean_string_files, clean_output_files],
"verbosity": 2,
}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tabcmd = ["tabcmd.locales/**/*.mo"]
[tool.black]
line-length = 120
required-version = 22
target-version = ['py39', 'py310', 'py311']
target-version = ['py310', 'py311']
extend-exclude = '^/bin/*'
[tool.mypy]
disable_error_code = [
Expand Down Expand Up @@ -65,7 +65,7 @@ test = [
"types-setuptools"
]
localize = ["doit", "ftfy"]
package = ["doit", "pyinstaller==5.13.1"]
package = ["doit", "pyinstaller==5.13.1", "setuptools==81"]
versioning = [
"doit",
"pyinstaller_versionfile",
Expand Down
Binary file modified tabcmd/locales/de/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/en/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/es/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/it/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Binary file modified tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo
Binary file not shown.
Loading