TypeError encountered when attempting to import script

Issue #13 resolved
callmekatootie created an issue

Hello,

I started the pyship-server command in one terminal and the pyship-gui command in another terminal. After specifying the server as localhost:12345 and providing my user and password, I logged into the server.

As soon as I attempted to import the sample script using the Import button in the small window on the top right of the GUI, I received a TypeError in the terminal on which the server was running. Snapshot: http://i.imgur.com/AfhUn.png

Also, in spite of closing the server terminal and the GUI terminal, the GUI containing the ships cannot be closed - this could be related.

Regards, Mithun

Comments (3)

  1. Andrew Peterson repo owner

    After a quick look at the code, I know what the problem is. Normally I would just tell you, but I didn't know if you wanted to attempt to solve this on your own.

    It is a very easy fix once you look at the relevant code.

  2. Andrew Peterson repo owner

    Stealing this Issue because it is causing to many issues for new installs. I can't have anyone else help test the game without it being fixed, so I'm handling it myself.

  3. Andrew Peterson repo owner

    The ScriptMgr now uses os.makedirs() instead of mkdir() to guarantee recursive folder creation. This was causing a crash if 'cscripts' didn't exist on the client(first run). The ScriptMgr now checks the player scripts for a NoneType to really be sure the player doesn't exist before print invalid Player messages. The ScriptWidget doesn't manually update after the import callback is called because it should update the ScriptWidget itself, even after being called from the CLI.

    Fixes issue 13

    → <<cset f745f77456c8>>

  4. Log in to comment