Page 7 of 10

Re: [Beta] Release of Telescope 2.0

Posted: Fri Nov 11, 2022 12:30 am
by cag
The first one is a simple fix. The second I cannot reproduce using Norby's escortDeck.

Telescope 2.0 doesn't use $TelescopeList anymore and is supported for oxp compatibility. Its indexOf function was written just for escortDeck. I'll need a copy of your version to track down the problem.

Re: [Beta] Release of Telescope 2.0

Posted: Fri Nov 11, 2022 12:34 pm
by Milo
There’s a bug in Towbar 1.1 that overwrites TelescopeList instead of TelescopeListi.

Re: [Beta] Release of Telescope 2.0

Posted: Sat Nov 12, 2022 12:34 am
by cag
Thanks for the quick heads-up. No doubt you've saved us some wasted time. It's funny how much havoc can sometimes be unleashed by changing one single character!

Re: [Beta] Release of Telescope 2.0

Posted: Sun Nov 13, 2022 11:28 pm
by Milo
Should the operator on these lines be >= ?

Code: Select all

			if( 	 ps_mass > 1e8 ) mult = 8;						//baseship scan double range third time
			else if( ps_mass > 1e6 ) mult = 4;						//huge player ship double range another time

Re: [Beta] Release of Telescope 2.0

Posted: Fri Nov 18, 2022 1:57 am
by cag
Yes, they should, to be consistent with a test ps_mass >= 1e8 in update_grav_scan().

These inequalities were copied from Norby's version, so this has always been there. AFAIK, ship's mass is calculated based on ships volume, so there's no danger of a ship designer setting mass to a power of 10.

Re: [Beta] Release of Telescope 2.0

Posted: Mon Nov 13, 2023 5:57 am
by phkb
I've just posted a small update to Telescope v2 (taking it to v2.1.3) which removes the monkey patches it was using to fix some HUD Selector issues. With the recent updates to HUD Selector, these monkey patches are no longer required. Should be in the manager shortly.

Re: [Beta] Release of Telescope 2.0

Posted: Fri Dec 01, 2023 3:05 am
by phkb
Another small update, now v2.1.4. Just added some code so that the current mode of the primable equipment is readable by other OXP's. Not writable, though.

Re: [Beta] Release of Telescope 2.0

Posted: Sun Apr 14, 2024 4:18 pm
by MrFlibble
Attempting to use the collect_shipdata.py script. Totally ignorant as to whether it'll make any difference to the "no problem" I have.

Tried using python 2.7 and 3.10. Both spit out an error like this and give a Pdb prompt.

Code: Select all

_load_effects, Error: name 'load' is not defined
Traceback (most recent call last):
  File "/tmp/collect_shipdata.py", line 486, in _load_effects
    parsed = load( fp )
NameError: name 'load' is not defined
> /tmp/collect_shipdata.py(529)_load_effects()
-> CurrentFile = None
No harm is done. No files are changed.

Does it work for anyone else on a current Linux?

Re: [Beta] Release of Telescope 2.0

Posted: Sun Apr 14, 2024 8:55 pm
by Commander_X
MrFlibble wrote: Sun Apr 14, 2024 4:18 pm
[...]
Tried using python 2.7 and 3.10. Both spit out an error like this and give a Pdb prompt.

Code: Select all

_load_effects, Error: name 'load' is not defined
Traceback (most recent call last):
  File "/tmp/collect_shipdata.py", line 486, in _load_effects
    parsed = load( fp )
NameError: name 'load' is not defined
> /tmp/collect_shipdata.py(529)_load_effects()
-> CurrentFile = None
[...]
Does it work for anyone else on a current Linux?
It works here, without telescope extension installed.

Code: Select all

** Failed to locate Telescope oxp, cannot update.

Processed 5 files, new entities registered: 229

  input:    shipdata     213,682

 output:    required           0
            generated    103,289
            total        103,289
I don't have a lot of AddOns, and no ManagedAddOns.
I didn't encounter your error, but it seems that it should be caused by the fact that at line 486 is used a "load" call which should be replaced with "readPlistFile" for python 3.x (as defined on line 21). Although the "readPlistStream" (imported next) is used once in the file, the "readPlistFile" is not, which leads me to think line 486 was left unprocessed during python2/3 adjustment.

Re: [Beta] Release of Telescope 2.0

Posted: Mon Apr 15, 2024 2:11 pm
by MrFlibble
Commander_X wrote: Sun Apr 14, 2024 8:55 pm
I didn't encounter your error, but it seems that it should be caused by the fact that at line 486 is used a "load" call which should be replaced with "readPlistFile" for python 3.x (as defined on line 21). Although the "readPlistStream" (imported next) is used once in the file, the "readPlistFile" is not, which leads me to think line 486 was left unprocessed during python2/3 adjustment.
Thank you.

Changed line 486 to

Code: Select all

				parsed = readPlistFile( fp )
and all runs well in python 3.10.

It now breaks differently in python 2.7, but I doubt that is of current relevance as python 3 ought to be default for most folk by now.

Code: Select all

Collected 2218 ents from 73 files, output is 786475

ouput_update, 'module' object has no attribute 'unpack_archive'
Traceback (most recent call last):
  File "collect_shipdata.py", line 2114, in ouput_update
    shutil.unpack_archive(TelescopeOxz, tmpFolder, 'zip')
AttributeError: 'module' object has no attribute 'unpack_archive'
--Return--
> /tmp/collect_shipdata.py(2152)ouput_update()->None
-> pdb.set_trace()
Traceback (most recent call last):
  File "collect_shipdata.py", line 2425, in <module>
    sys.exit(1 if main() else 0)
  File "collect_shipdata.py", line 2406, in main
    err, update = update_eff_data()
  File "collect_shipdata.py", line 2212, in update_eff_data
    fallback = ouput_update(output)
  File "collect_shipdata.py", line 2152, in ouput_update
    pdb.set_trace()
  File "/usr/lib/python2.7/bdb.py", line 53, in trace_dispatch
    return self.dispatch_return(frame, arg)
  File "/usr/lib/python2.7/bdb.py", line 88, in dispatch_return
    self.user_return(frame, arg)
  File "/usr/lib/python2.7/pdb.py", line 190, in user_return
    self.interaction(frame, None)
  File "/usr/lib/python2.7/pdb.py", line 210, in interaction
    self.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 130, in cmdloop
    line = raw_input(self.prompt)

Re: [Beta] Release of Telescope 2.0

Posted: Mon Apr 15, 2024 4:11 pm
by Cholmondely
MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
I doubt that is of current relevance as python 3 ought to be default for most folk by now.
I'm using an AppleMac and know nothing about any of this. I thought that OXPs were in OpenStep/XML or Javascript, not Python. How would I tell if I have Python 3 or 2? I presume that this is why I only sometimes see the Masslock borders.

Re: [Beta] Release of Telescope 2.0

Posted: Mon Apr 15, 2024 4:18 pm
by MrFlibble
Cholmondely wrote: Mon Apr 15, 2024 4:11 pm
MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
I doubt that is of current relevance as python 3 ought to be default for most folk by now.
I'm using an AppleMac and know nothing about any of this. I thought that OXPs were in OpenStep/XML or Javascript, not Python. How would I tell if I have Python 3 or 2? I presume that this is why I only sometimes see the Masslock borders.
The script gleans ship data for the 3d views in telescope and inserts a plist into the OXP. It needs to be run when ships are added to the OXP mix if you use the 3d views else you'll get question marks for non-core ships. The python script is in the OXZ, and can be extracted to anywhere for execution.

To check python version, open a terminal and type

Code: Select all

python --version
Some installations might have python as a symlink to a specific version, so python might be linked to python3, which is in turn linked to python 3.10, and python2 will likely link to python2.7. So running "python2 script.py" should execute script.py using python version 2.

Re: [Beta] Release of Telescope 2.0

Posted: Mon Apr 15, 2024 4:22 pm
by MrFlibble

Code: Select all

ls -al $(which python)
...will show whether python is a link and to what.

Re: [Beta] Release of Telescope 2.0

Posted: Mon Apr 15, 2024 4:27 pm
by Cholmondely
Thanks for that!

I've got Python 2.7.16 on my 2020 AppleMac.

ls -al $(which python) did not link to anything obviously Oolitical.

Re: [Beta] Release of Telescope 2.0

Posted: Tue Apr 16, 2024 6:50 pm
by Commander_X
For some reasons the messages after the one I posted were not picked by the rss/atom feed.
Cholmondely wrote: Mon Apr 15, 2024 4:27 pm
[...]
I've got Python 2.7.16 on my 2020 AppleMac.
[...]
Yes, it seems there is a bit of love/hate relationship between Apple and Python community -- you might be able to pick more current versions from homebrew or the other brew channels.
MrFlibble wrote: Mon Apr 15, 2024 2:11 pm
[...]
Changed line 486 to

Code: Select all

				parsed = readPlistFile( fp )
and all runs well in python 3.10.

It now breaks differently in python 2.7, but I doubt that is of current relevance as python 3 ought to be default for most folk by now.
[...]
The new break seems to be caused by the fact that there is no unpack_archive in shutil module of python 2 (2.7.18 version, here), only in python 3.