Bridge Commander Central

BC Forums => BC Technical Support => Solved Problems => Topic started by: gtillmon on July 01, 2009, 08:34:42 PM

Title: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 01, 2009, 08:34:42 PM
Can anyone assist me with correcting this error?


AttributeError: PreLoadAssets
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\000-Fixes20030305-FoundationTriggers.py", line 22, in __call__
    i(pObject, pEvent)
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 240, in __call__
    LoadQBautostart.ImportQBautostart()
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 163, in ImportQBautostart
    pModule = __import__(dotPrefix + fileName)
ImportError: No module named old
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: ACES_HIGH on July 02, 2009, 12:25:32 AM
try redownloading the latest version of QBAutostart
http://defiant.homedns.org/~erik/STBC/QBautostart/QBautostart-current.zip (http://defiant.homedns.org/~erik/STBC/QBautostart/QBautostart-current.zip)
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 02, 2009, 05:52:11 PM
Thanks!!!!
That did the trick.
How about this one, if you please.
inconsistent dedent
Error: was unable to load FleetUtils - SyntaxError: ('invalid token', ('.\\Scripts\\Custom\\QBautostart\\FleetUtils.py', 462, 45, '        pSequence = App.TGSequence_Create():\012'))
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 157, in ImportQBautostart
  File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462
     pSequence = App.TGSequence_Create():
                                         ^
 SyntaxError: invalid token
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: MLeo on July 02, 2009, 05:59:23 PM
Open FleetUtils.py and remove the : on line 462.
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 02, 2009, 07:37:17 PM
Thanks.  I did that.  However, I am still having a problem.

inconsistent dedent
Error: was unable to load FleetUtils - SyntaxError: ('invalid token', ('.\\Scripts\\Custom\\QBautostart\\FleetUtils.py', 462, 45, '        pSequence = App.TGSequence_Create() \012'))
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 157, in ImportQBautostart
  File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462
     pSequence = App.TGSequence_Create()
                                         ^
 SyntaxError: invalid token
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: ACES_HIGH on July 02, 2009, 08:18:05 PM
the way error checkers tend to work, is that the program assumes that the programmer knew what they were doing, so generally, it will try to run faulty code as long as it can, before giving an error message, it's likely that the error lies somewhere above Line 462.  could you post the whole .py file?
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 02, 2009, 08:28:58 PM
Okay.

File is attached.
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: ACES_HIGH on July 02, 2009, 11:23:09 PM
hmm, did you delete the .pyc after you made the change?
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 03, 2009, 10:14:15 AM
Yes, I deleted the pyc file.

The thing is there is still an error on line 462 when I used Python to check the module after I made that change.
I am using Python 2.5 to edit.
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: MLeo on July 03, 2009, 02:21:42 PM
It was a case of faulty indentation.

I find it a bit odd that it would never have been caught before, did you make a change in the file?
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 03, 2009, 03:07:24 PM
Thanks for trying guys, however, it still does not work.

Error: was unable to load FleetUtils - SyntaxError: ('invalid syntax', ('.\\Scripts\\Custom\\QBautostart\\FleetUtils.py', 513, 8, '        for pFriendly in lpFriendlies:\012'))
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 157, in ImportQBautostart
  File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 513
     for pFriendly in lpFriendlies:
     ^
 SyntaxError: invalid syntax
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: Mario on July 03, 2009, 03:07:55 PM
Mleo you just fixed 1 out of 7-8 indentation errors.

Gotta love PyLint.

Who has been playing with this script?
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 03, 2009, 05:00:33 PM
THANKS!!!!!  That did it.  :D

I was using a Python editor and I could never get the error after the () corrected. 
What editor did you use?

Thanks again.
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: MLeo on July 03, 2009, 05:27:36 PM
It isn't the fault of an editor per-say.

Python defines scoping through indentation, so it's important to keep it consistent.
Title: Re: Help with this error please - File ".\Scripts\Custom\QBautostart\FleetUtils.py", line 462 pSequence = App.TGSequence_Create(): ^ SyntaxError: invalid token
Post by: gtillmon on July 03, 2009, 06:20:26 PM
Again, thanks all!

All of your help is greatly appreciated.