feat: added note about python3 alias on windows

reverted python script code to use python3 alias
pull/3281/head
yougotwill 2 months ago
parent 3eb5565ca7
commit f3e56eecf1

@ -267,7 +267,7 @@ This will build the project and start the application in production mode.
## Troubleshooting
<details>
<summary>The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now.</summary>
<summary><em>The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now.</em></summary>
This error is caused by the [Electron](https://www.electronjs.org/) sandbox not being able to run. This is a security feature and not a bug. You can run the application with the `--no-sandbox` flag to disable this behavior.
@ -277,6 +277,13 @@ yarn start-prod --no-sandbox # Start Session!
</details>
<details>
<summary><em>Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.</em></summary>
We use the `python3` command for many of our scripts. If you have installed Python using [Chocolatey](https://chocolatey.org/), you will need to create an alias for `python3` that points to `python`. Alternatively, you can update the scripts to use `python` instead of `python3`.
</details>
## Hot reloading
More often than not, you'll need to restart the application regularly to see your changes, as there

@ -41,8 +41,8 @@
"build-everything:watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn sass && yarn build:locales-soft && yarn build:workers && yarn tsc -w",
"start-dev:pretty": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron . | npx bunyan",
"build:workers": "yarn worker:utils && yarn worker:libsession",
"build:locales": "python ./tools/localization/generateLocales.py --generate-types --print-problems --error-on-problems --error-old-dynamic-variables",
"build:locales-soft": "python ./tools/localization/generateLocales.py --generate-types --print-problems --print-problem-strings",
"build:locales": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --error-on-problems --error-old-dynamic-variables",
"build:locales-soft": "python3 ./tools/localization/generateLocales.py --generate-types --print-problems --print-problem-strings",
"watch": "yarn clean && yarn protobuf && yarn update-git-info && yarn build-everything:watch",
"protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"sass": "rimraf 'stylesheets/dist/' && webpack --config=./sass.config.js",
@ -61,7 +61,7 @@
"worker:libsession": "rimraf 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js",
"dedup-yarn-lock": "npx --yes yarn-deduplicate yarn.lock",
"prepare": "husky install",
"print-deps": "node -v && python --version"
"print-deps": "node -v && python3 --version"
},
"dependencies": {
"@emoji-mart/data": "^1.1.2",

@ -9,13 +9,13 @@
The Python scripts are located in the `tools` directory. To run a script, use the following command:
```bash
python ./tools/<script>.py
python3 ./tools/<script>.py
```
Most of these scripts can take arguments. To see the arguments for a script, use the following command:
```bash
python ./tools/<script>.py --help
python3 ./tools/<script>.py --help
```
## Utility
@ -25,7 +25,7 @@ python ./tools/<script>.py --help
[./util/sortJson.py](./util/sortJson.py) sorts a given JSON file.
```bash
python ./tools/util/sortJson.py <file>
python3 ./tools/util/sortJson.py <file>
```
## Localization
@ -40,20 +40,20 @@ searches in the following directories:
- `./ts/`
```bash
python ./tools/findString.py <token>
python3 ./tools/findString.py <token>
```
The script can automatically open the files in VSCode by passing the `--open` flag.
```bash
python ./tools/findString.py <token> --open
python3 ./tools/findString.py <token> --open
```
> [!WARNING]
> The --open flag will open only the first result for the token in VSCode. If you wish to open more files, you can pass the `--limit` flag with the maximum number of files you wish to open. You can also pass the `--limit 0` flag to open all files containing the token.
```bash
python ./tools/findString.py <token> --open --limit 5
python3 ./tools/findString.py <token> --open --limit 5
```
### [CrowdIn Post-Import](./localization/crowdInPostImport.sh)
@ -82,14 +82,14 @@ are used but not known about. Without any input files this script outputs:
The script can be run with:
```bash
python ./tools/localization/generateLocalizedStringsAnalysis.py
python3 ./tools/localization/generateLocalizedStringsAnalysis.py
```
> [!WARNING]
> If using macOS always run this script with the `--disable-concurrency` flag.
```bash
python ./tools/localization/generateLocalizedStringsAnalysis.py --disable-concurrency
python3 ./tools/localization/generateLocalizedStringsAnalysis.py --disable-concurrency
```
The script can also take the following arguments:

@ -5,4 +5,4 @@ echo 'Cleaning up CrowdIn import'
GENERATE_LOCALES_FILE=$PWD/tools/localization/generateLocales.py
# Generate Types and find problems if the python script exists with a non-zero exit code then the build will fail
python $GENERATE_LOCALES_FILE --print-problems --error-on-problems --error-old-dynamic-variables --print-old-dynamic-variables
python3 $GENERATE_LOCALES_FILE --print-problems --error-on-problems --error-old-dynamic-variables --print-old-dynamic-variables

Loading…
Cancel
Save