berdav / greenpass

Scriptable green pass / Digital Covid Certificate verifier.
GNU Lesser General Public License v3.0
53 stars 21 forks source link

Windows testing #35

Open berdav opened 2 years ago

berdav commented 2 years ago

The program is currently untested on Windows. Needs analysis and test to identify the problems and fixes.

davidev94 commented 2 years ago

I'm testing the app with Windows 10 Pro, 21H1 - Python 3.9.2 Installed with pip install greenpass

Some initial note:

set PATH_TO_QR_FILE=C:\Users\utente\Desktop\new\GPimg.png

cd "C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python*" cd Scripts

Python greenpass --no-color --qr %PATH_TO_QR_FILE%

pause

berdav commented 2 years ago

Thank you! I'm opening a new branch for this.

From your suggestion it would be sufficient to use the locale library to get the locale (and not the environment variable) and to remove the colors if we are on windows.

You can find the current branch with these modifications in the windows branch.

With this it should be fine, and print the localized output.

Can you test the new branch? Otherwise I will try it this weekend.

davidev94 commented 2 years ago

Hi, I tested the windows branch and now it runs without errors, but the output remains localized in english. After few investigation I find out that... see this self-explaining capture:

C:\Users\utente>python
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()[0]
'Italian_Italy'
>>> locale.getdefaultlocale()[0]
'it_IT'

so I change line 191 of greenpass.py with getdefaultlocale and now it works properly. (In linux for me both functions returns it_IT) Tested also --settings and --language options and they also works ok.

NOTE I'm approching now to cooperation on Github and I had few knowledge in Python, so maybe I do not make things properly to run the new branch, but I had to use the args --clear-cache to make the --settings option works properly, otherwise it returns me an error.

berdav commented 2 years ago

Ok, perfect, I'm changing the getlocale to the default locale :)

Thank you again.

It always gives you that error? If so I will leave this issue open for that problem.

davidev94 commented 2 years ago

No, now it works properly.