Onscreen IDE & dynamic instant update [_v0.5.4_]


#236

Read my 1st post carefully, and you’ll find this :

RESTRICTION <1> :
In your main script, you have to protect your World instantiation, because it’s done by the IDE.
This is a sample of it :

if __name__=='__main__': 
   print '\n', '@'*10, "\n  I'M PROCESSED !!!\n", '@'*10 
   if not hasattr(help,'IDE'): 
      World() 
   run()

So you must isolate World instantiation so it won’t be done twice each time you update the scene. The rest of your code will be executed normally.
World instantiation is done by the IDE, to isolate the instance, to ease the pain when searching for the must-be-destroyed class instances.
The run() call is safe and meaningless when you use the IDE, since it’s redirected to a dummy run() function.
The test scene is not already use this blocker, so add it yourself.

But, in case you need to instantiate it yourself, save the instance in global namespace as “winst”, like this :

if __name__=='__main__': 
   winst = World( arg1,arg2,etc. ) 
   run()

RESTRICTION <2> :
If you leave World instantiation to the IDE, you should name the class “World”.
Note that you don’t need to have a World class to instantiate. If you’re trying some very simple modules, you can just do everything in module global namespace.


#237

so sorry.
and thanks for fast reply, i have searched on last pages, becase i was think this is a bug :slight_smile:

new class-name and works fine :wink:


#238

[size=150][v0.4.8][/size]
[X]
fixed bookmarks removal upon clearing log
[X] fixed caret position restoration after trying to look for possible function call tips on the previous lines and there is none
[X] added exception handling on Pstats kill, if PStats server was stopped by user
[X] added shell=True to Popen call, so it works as it should without editing the source
[X] added error stopper by disabling the erroneous function, in case it’s ran every frame and not necessarily a task, so traceback flood won’t happen again


#239

Hi,

I was looking for a python IDE to be used for Panda3D.
Then I stumbled into this thread. It looks really great!

But I have no idea how to set this up. I’m sorry, but I’m rather new to Panda3D and Python.
Is there any documentation how to start with this IDE?


#240

It’s right in my 1st post.
Put all the zip files in a new directory and extract them all, and run IDE_STARTER.pyw with python.
On Windows, be sure to use the correct /TD/TD.dll for your P3D version.


#241

Hey, i am having some trouble running it (using panda few days newer(buildbot) than 1.7.1) on windows.

This is code that i use to run it, it should be ok?

codepad.org/v33SNdmL

And this is error that i get.
pasteall.org/pic/show.php?id=10680
Its probably sometahing on my part, but i am not quite sure what could it be…

Ok, i seem to have found out whats causing that bug.
If i create file in directory which has python packages in it(dirs with init.py) it will cause freeze/crash.
if i rename init.py ide launches file correctly but then imports wont work…

game(DIR)
    main.py
    code(DIR)
        __init.py__
    data(DIR)

That layout will cause crash.


#242

It clearly failed in importing InteractiveInterpreter :

from code import InteractiveInterpreter

Module code here is \Python26\lib\code.pyc, so python tried to import InteractiveInterpreter from your own code.py module, which doesn’t exist.


#243

No, i dont, i have “code” directory/py module in my dir. If you want, i can send you simple zip with project tree which fails to run with your IDE.
dl.dropbox.com/u/14000546/errors.7z
here it is, you can try and rename init.py inside code directory.


#244

That’s the problem. Python already has code module, so you should never create your own module/package with the same name.


#245

Oh thank you very much! :slight_smile:
Renamed directory to gameCode, and it aworks now!

I also have one idea/feature request :slight_smile:
Display current scope level (maybe even in separate wx window, or at some side panel or increase number of rows in statusbar).

So once when you mouse cursor is in some place, it would read something like this
any other code for example inside init() method would not be visible in hierarchy view

global
  class World():
    def init(self):
      for i in range(5):
        if i==1:
          #this IF is dummy!
          !!!Here you are!!!
    

It would be like code view, but with everything where your mouse cursor is not automatically folded (this could be used for code navigation easily). It would also inform you of bad indentation.

If its too much work, maybe its a lot easier just to show where you are currently in status bar?

so status bar would have text like:
if i==1: #this IF is dummy!
and commentar would be different color :slight_smile:

EDIT1: Oh nvm, i didnt knew before that there is notification on changing scope level. You can pretty much ignore last request.


#246

So you want to fold all code blocks except the one on which the cursor is ?


#247

Yeah, but not in main window/panel, but somewhere at side, basically it is code browser which also shows you where are you currently working. But as i see now that there is notification when you change depth/nesting/scope, it is not that much needed :slight_smile:

How can i change amount of time for which will that notification be active?


#248

What notification are you talking about ?
This one ?
[Onscreen IDE & dynamic instant update [_v0.5.4_])


#249

When you are writing code and you change your nesting level, it shows marker line if line which changes nesting (class, def, for, when, if,…) is on screen, and if it is not on screen, it pops notification showing you where you are.

For example if you have class World(), and it has 20 methods, and you go to newline while writing last one and press Backspace cursor will go one tab back (i use tabs) and it will draw marker up to start of function/method you are writing, and if you press Backspace once more, it will show start of class World() and couple of first lines in it.

And nvm, i got used to that notification time, so i dont need to change it :slight_smile:

Ah i am once more amazed by your IDE :slight_smile:
Awesome work!


#250

So yes it’s what you’re talking about.
I don’t call it notification, but indentation notch close up view. :smiley:

Nobody else does this but me, right ? :laughing:

If you want to change the duration, it’s in IDE_drawIndentHelperLine() in IDE.py, the Wait( .8 ).


#251

ynjh_jo:

I noticed that the last post on this thread and plugin was April of this year. Are you still supporting this plugin at all? I just wanted to know before I downloaded it and tried it


#252

Yes of course.


#253

[size=150][v0.5][/size]
[X]
fixed uncaught mouse-up event if there is a menu when mouse was down
[X] fixed Create New File to be available also when there is no open file :astonished:
[X] fixed Open File without selecting any file
[X] exit response on normally closing the P3D window is now limited only in certain modes
[X] caret blink now stops if there is any menu or onscreen dialog
[X] split TextDrawer extension’s Windows binaries & source code from IDE code package, so it can be downloaded separately based on your P3D version
[X] improved software upgrade system
[X] added selection by Shift + mouse-down
[X] added Preferences button to the rightmost of status bar
[X] added onDestroy argument to PopupMenu class and onMove argument to DropDownMenu class
[X] added supported display resolutions list to choose from, if fullscreen toggle fails


#254

Hello.

I’m trying to run the IDE with the sample dyn1.py I get the following output:

STARTING IDE.....
Traceback (most recent call last):
  File "IDEmini.py", line 47, in <module>
    FILE_SRV = IDEFileSrv.FileServer()
  File "/home/colinn/Documents/tanks/pysrc/ide/IDEFileSrv.py", line 9, in __init__
    self.bind(('', PORT))
  File "/usr/lib64/python2.7/asyncore.py", line 335, in bind
    return self.socket.bind(addr)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
OverflowError: getsockaddrarg: port must be 0-65535.

Is there something wrong with my Python configuration?


#255

Looks like PY2.7 yells if the port number isn’t in 16bit (0-65535) range. Just change the PORT variable in IDEFileSrv.py between 49152-65535.