From 6dffc8b65d848e54c8d2427e41a258c36ca9a5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20L=C3=B3pez=20Henestrosa?= Date: Wed, 3 May 2023 16:50:34 +0200 Subject: [PATCH 1/2] Modify Project Structure section --- README.md | 135 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 113 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index ef9f44a..de70936 100644 --- a/README.md +++ b/README.md @@ -103,24 +103,113 @@ The file types supported by the package are the following: ### Project Structure -#### Root directories: - -- `.github/workflows`: GitHub workflows. It also includes the templates for issues and pull requests, as well as the `depandabot.yml` file for Dependabot configuration. -- `docs`: Contains files related to the documentation of the project. -- `src/mobile_strings_converter`: Contains the source code files. -- `tests`: Contains unit tests to ensure the correct functionality of the package. It also includes the `files` directory, which contains a few demo files in different formats to use in the unit tests. - -#### Root files: - -- `.gitignore`: File used by the version control system Git to specify files or directories that should be ignored by Git when tracking changes to a project. -- `.pre-commit-config.yaml`: Configuration file used by **pre-commit**, a tool that runs checks (such as linting, testing, or formatting) on the code before you commit changes to version control. The file specifies which checks pre-commit should run and how it should run them. -- `LICENSE`: Project license, which is [MIT](https://opensource.org/license/mit/). -- `poetry.lock`: File generated by **Poetry**, a package manager for Python, that contains the exact versions of all packages used by a project. The file is used to ensure that all members of a development team are using the same versions of packages, even if different versions are available in the package repository. -- `pyproject.toml`: Configuration file used by **Poetry**. It specifies the metadata for a Python project, including the project name, version, description, author, license and dependencies. -- `README.md`: What you are reading right now. -- `requirements.txt`: Lists the names and versions of each package used to build this project. To install the requirements, execute `pip install -r requirements.txt`. -- `requirements-dev.txt`: Lists the names and versions of each package used in the development stage of this project. To install the requirements, execute `pip install -r requirements-dev.txt`. +
+ ASCII folder structure +``` +│ .gitignore +│ .pre-commit-config.yaml +│ LICENSE +│ poetry.lock +│ pyproject.toml +│ README.md +│ requirements.txt +│ requirements-dev.txt +│ +├───.github +│ │ CONTRIBUTING.md +│ │ +│ ├───ISSUE_TEMPLATE +│ │ bug_report_template.md +│ │ feature_request_template.md +│ │ +│ └───PULL_REQUEST_TEMPLATE +│ pull_request_template.md +│ +├───docs +│ icon.png +│ +├───src +│ ├───mobile_strings_converter +│ │ console_style.py +│ │ converter.py +│ │ __init__.py +│ │ __main__.py +│ │ +│ ├───assets +│ │ └───fonts +│ │ Aakar.ttf +│ │ AnekTelugu-VariableFont_wdth,wght.ttf +│ │ DejaVuSansCondensed.ttf +│ │ Eunjin.ttf +│ │ fireflysung.ttf +│ │ gargi.ttf +│ │ Gurvetica_a8_Heavy.ttf +│ │ Latha.ttf +│ │ Waree.ttf +│ │ +│ ├───controller +│ │ main_controller.py +│ │ __init__.py +│ │ +│ ├───model +│ │ transcription.py +│ │ __init__.py +│ │ +│ ├───utils +│ │ constants.py +│ │ i18n.py +│ │ path_helper.py +│ │ __init__.py +│ │ +│ └───view +│ main_window.py +│ __init__.py +│ +└───tests + │ base_tests.py + │ test_get_strings.py + │ test_to_android.py + │ test_to_csv.py + │ test_to_html.py + │ test_to_ios.py + │ test_to_json.py + │ test_to_md.py + │ test_to_ods.py + │ test_to_pdf.py + │ test_to_xlsx.py + │ test_to_yaml.py + │ + └───files + ├───input + │ Localizable.strings + │ strings.xml + │ + ├───template-with-comments + │ Localizable.strings + │ strings.csv + │ strings.html + │ strings.json + │ strings.md + │ strings.ods + │ strings.pdf + │ strings.xlsx + │ strings.xml + │ strings.yaml + │ + └───template-without-comments + Localizable.strings + strings.csv + strings.html + strings.json + strings.md + strings.ods + strings.pdf + strings.xlsx + strings.xml + strings.yaml +``` +
@@ -240,11 +329,13 @@ to_google_sheets( ### Script flags -- The option `-h` or `--help` displays the help documentation. -- The option `-o` or `--output-filepath` specifies the filepath for storing the converted file. The file extension can be chosen from the list of supported file types mentioned [here](#about-the-project). -- The option `-g` or `--google-sheets` followed by the name of the sheet as `` creates a new Google Sheets spreadsheet with the specified name. -- The option `-c` or `--credentials` followed by the path to your `service_account.json` file is mandatory if you want to generate a spreadsheet in your Google account. -- By using the `-p` or `--print-comments` option, the output file will include any commented strings present in the original file. +| Flag | Description | +|:----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `-h` or `--help` | Displays help text for the program | +| `-o` or `--output-filepath` | Specifies the filepath for storing the converted file. The file extension can be chosen from the list of supported file types mentioned [here](#about-the-project). | +| `-g` or `--google-sheets` | Followed by the name of the sheet, creates a new Google Sheets spreadsheet with the specified name. | +| `-c` or `--credentials` | Followed by the path to your `service_account.json` file is mandatory if you want to generate a spreadsheet in your Google account. | +| `-p` or `--print-comments` | The output file will include any commented strings present in the original file. |

(back to top)

From 0dd9675e4ff6253e44b5596dbee3e714c57efed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20L=C3=B3pez=20Henestrosa?= Date: Wed, 3 May 2023 16:51:35 +0200 Subject: [PATCH 2/2] Fix imports --- src/mobile_strings_converter/__main__.py | 2 +- src/mobile_strings_converter/converter.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mobile_strings_converter/__main__.py b/src/mobile_strings_converter/__main__.py index 17e2ded..20189f8 100644 --- a/src/mobile_strings_converter/__main__.py +++ b/src/mobile_strings_converter/__main__.py @@ -77,7 +77,7 @@ def main(): should_print_comments=args.print_comments, ) - convert_strings(input_filepath, Path(args.output_path), args.print_comments) + convert_strings(input_filepath, Path(args.output_filepath), args.print_comments) if __name__ == "__main__": diff --git a/src/mobile_strings_converter/converter.py b/src/mobile_strings_converter/converter.py index 3aa3049..f962d40 100644 --- a/src/mobile_strings_converter/converter.py +++ b/src/mobile_strings_converter/converter.py @@ -12,12 +12,11 @@ import yaml from arabic_reshaper import reshape from bidi.algorithm import get_display +from console_style import ConsoleStyle from fpdf import FPDF from google.oauth2.credentials import Credentials from lingua import LanguageDetectorBuilder -from .console_style import ConsoleStyle - def convert_strings( input_filepath: Path, output_filepath: Path, should_print_comments: bool