astuder / lightroom-map-fix

Fixing the Map module in Lightroom Classic
125 stars 17 forks source link

Syntax issue with python script #1

Closed PHlightroom closed 5 years ago

PHlightroom commented 5 years ago

Trying to use the patchluastr.py script and getting a syntax error "unexpected character after line continuation character" Is this a script error or user error on my part ? The script is all one line. python-syntax-failure

On Windows 7 64bt

astuder commented 5 years ago

You have to run the command on the command line outside the Python console.

If Windows does not like the .py file, prefix the command line with "python". I.e. "python patchluastr.py ..."

Let me know if this helps.

PHlightroom commented 5 years ago

Thanks for the fast reply. I'm still not getting something right. I've tried putting the patchluastr.py in the python directory, but still getting an error. python-error-4

astuder commented 5 years ago

You have to download the Python script patchluastr.py from Github, e.g. by downloading the whole repository as ZIP file. https://github.com/astuder/lightroom-map-fix/archive/master.zip

I recently also added a ZIP file with the Python script as an executable, but not sure if that works on across all Windows versions. https://github.com/astuder/lightroom-map-fix/blob/master/patchluastr-win10.zip

PHlightroom commented 5 years ago

Thanks again Adrian for your help on this. Yes, I'm using the script in the zip file and I've read everything several times now. The errors seem to be due to either file naming, file location or CLI syntax to python. For someone that's not a previous user of Python it's all a bit of a nightmare. Everything else in the document seems very easy to understand and act on, but Python's CLI isn't so easy. Exactly where should the script (patchluastr.py) sit in the directory structure ? I've used all the default installation options in Python on W7 64. At the moment I'm trying to hack the Location.lrmodule file in a separate directory (E:/LR/), that also contains the two *.lua components pulled out by Resource Hacker, to avoid damaging my working LR installation. When the python script has worked I'll copy it across to the working directory on C:

astuder commented 5 years ago

The error message above indicates that patchluastr.py is not in the current location. Simply prefix it with path where you unpacked patchlustr.py.

astuder commented 5 years ago

E.g. python \downloadpath\master\patchluastr.py ...

astuder commented 5 years ago

Or copy the script to your working folder

PHlightroom commented 5 years ago

Thanks for your help on this; The key issue seems to be working in a full command prompt opened by typing win key and r I've now got the script to work, followed the rest of the instructions without problem and the map module works nearly as expected other than an error message “Map Error : request denied” that flashes up on loading and when moving the map. However the message doesn't seem to cause any other issues and geo-tagging and displays seem to work as expected. map-error Thanks for your work on this you're a hero :-)

astuder commented 5 years ago

Happy to hear that you got it working. I tried to clarify the documentation.

The error messages you see are likely from calls to the Geocoding API. They go away if you enable the Geocoding API on your API key and patch AGREVERSEGEOCODESERVICE.LUA. See remarks here