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

Return to Code Snippets

Postby GrizzLyCRO » Tue Apr 05, 2011 6:08 am

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?

http://codepad.org/v33SNdmL

And this is error that i get.
http://www.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..

Code: Select all
game(DIR)
    main.py
    code(DIR)
        __init.py__
    data(DIR)

That layout will cause crash.
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby ynjh_jo » Tue Apr 05, 2011 7:36 am

It clearly failed in importing InteractiveInterpreter :
Code: Select all
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.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby GrizzLyCRO » Tue Apr 05, 2011 7:39 am

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.
http://dl.dropbox.com/u/14000546/errors.7z
here it is, you can try and rename __init__.py inside code directory.
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby ynjh_jo » Tue Apr 05, 2011 7:42 am

GrizzLyCRO wrote:i have "code" directory/py module in my dir.

That's the problem. Python already has code module, so you should never create your own module/package with the same name.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby GrizzLyCRO » Tue Apr 05, 2011 8:02 am

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

I also have one idea/feature request :)
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
Code: Select all
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 :)

EDIT1: Oh nvm, i didnt knew before that there is notification on changing scope level. You can pretty much ignore last request.
Last edited by GrizzLyCRO on Tue Apr 05, 2011 8:16 am, edited 1 time in total.
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby ynjh_jo » Tue Apr 05, 2011 8:15 am

GrizzLyCRO wrote:I also have one idea/feature request :)
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
Code: Select all
global
  class World():
    def init(self):
      for i in range(5):
        if i==1:
          #this IF is dummy!
          !!!Here you are!!!
   


It would 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.

So you want to fold all code blocks except the one on which the cursor is ?
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby GrizzLyCRO » Tue Apr 05, 2011 8:20 am

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 :)

How can i change amount of time for which will that notification be active?
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby ynjh_jo » Tue Apr 05, 2011 8:28 am

What notification are you talking about ?
This one ?
http://www.panda3d.org/forums/viewtopic.php?p=25219
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby GrizzLyCRO » Tue Apr 05, 2011 8:39 am

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 :)

Ah i am once more amazed by your IDE :)
Awesome work!
User avatar
GrizzLyCRO
 
Posts: 301
Joined: Tue Dec 16, 2008 4:03 pm
Location: Croatia

Postby ynjh_jo » Tue Apr 05, 2011 8:45 am

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

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

If you want to change the duration, it's in IDE_drawIndentHelperLine() in IDE.py, the Wait( .8 ).
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby Shaba1 » Fri Aug 26, 2011 10:40 pm

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
Shaba1
 
Posts: 195
Joined: Sat Sep 24, 2005 1:26 pm

Postby ynjh_jo » Sat Aug 27, 2011 4:39 am

Yes of course.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby ynjh_jo » Wed Aug 31, 2011 9:26 am

[_v0.5_]
[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 :o
[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
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby darkphoenix16 » Sun Sep 25, 2011 4:15 pm

Hello.

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

Code: Select all
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?
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby ynjh_jo » Sun Sep 25, 2011 6:52 pm

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.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Doesn't work for me

Postby zwillenguru » Mon Nov 21, 2011 10:23 am

I downloaded everything just as you said. I extracted everything into the same folder and tried to run IDE_STARTER it just didn't do anything. No response at all
zwillenguru
 
Posts: 12
Joined: Mon Nov 21, 2011 10:21 am

Postby ynjh_jo » Mon Nov 21, 2011 10:27 am

How did you run it ?
What's the OS ?
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby zwillenguru » Mon Nov 21, 2011 10:51 am

I'm using windows 7 64bit. I started the program by double-clicking IDE_STARTER. Then, when nothing happened I also tried right-click -> "open with" -> pythonw and right-click -> "open with" -> python. In general Panda3d runs fine. I'm using aptana, no troubles there
zwillenguru
 
Posts: 12
Joined: Mon Nov 21, 2011 10:21 am

Postby ynjh_jo » Mon Nov 21, 2011 10:54 am

Is there any error message ?
Could you post the console output here ?
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby zwillenguru » Mon Nov 21, 2011 11:12 am

Running it in the console there's an error message that says:
Code: Select all
File "...IDE_STARTET.pyw", line 86
    print f
          ^
SyntaxError: invalid syntax



I've looked at the code and you're making a call to print without braces. I've added the braces and ran it again. There was a similar error, this time in line 116. I added all the missing braces in the code and finally had this output:

Code: Select all
File "...IDE_STARTET.pyw", line 5, in <module>
ImportError: No module named pandac.PandaModules

[/code]
zwillenguru
 
Posts: 12
Joined: Mon Nov 21, 2011 10:21 am

Postby drwr » Mon Nov 21, 2011 2:40 pm

It sounds like you are trying to run it with Python 3.0 instead of the correct version of Python 2.6 (or 2.7) that is provided with Panda.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby zwillenguru » Mon Nov 21, 2011 3:00 pm

I've run it with ppython and was confronted with the error:
Code: Select all
ImportError: No module named wx

That's funny since I have installed wxpython into the lib folder of my panda3d installation.
zwillenguru
 
Posts: 12
Joined: Mon Nov 21, 2011 10:21 am

Postby ynjh_jo » Mon Nov 21, 2011 9:25 pm

Check the wx.pth file in your lib/site-packages, it should lead to the wx installation.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby ynjh_jo » Sun Feb 05, 2012 4:54 am

[_v0.5.1_]
[X]
panda3d.* import completion is now supported

Image

[_v0.5.2_]
[X]
fixed minor bug of v0.5.1
Last edited by ynjh_jo on Tue Oct 29, 2013 5:16 am, edited 2 times in total.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby Shaba1 » Fri Feb 17, 2012 1:47 am

So we just install the new files over the old ones?
Shaba1
 
Posts: 195
Joined: Sat Sep 24, 2005 1:26 pm

Postby ynjh_jo » Fri Feb 17, 2012 2:39 am

Shaba1 wrote:So we just install the new files over the old ones?

Yep.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby Shaba1 » Fri Feb 17, 2012 11:30 am

ynjh_jo wrote:
Shaba1 wrote:So we just install the new files over the old ones?

Yep.


Thank you ynjh_jo. I have had this add on since you first posted it years ago. But I really never used it very much. I got distracted into other things. Will you please stand by for a LOT of what might seem ( to you ) obvious newbie question :D
Shaba1
 
Posts: 195
Joined: Sat Sep 24, 2005 1:26 pm

Postby ynjh_jo » Fri Feb 17, 2012 11:40 am

You're welcome.
I updated it just now.

[_v0.5.3_]
[X]
works with P3D 1.8.0
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

Postby Adanf » Tue Feb 21, 2012 8:57 pm

Hi at all, this is my first reply in this forum, but i have a big problem to start this good Ide program.
My problem occurs when i try to start a new script by clicking the Open button.

I quote the code error below:
Code: Select all
Traceback (most recent call last):
  File "IDEmini.py", line 823, in IDE_safeRun
    taskMgr._origRun()
  File "C:\Panda3D-1.7.2\direct\task\Task.py", line 502, in run
    self.step()
  File "C:\Panda3D-1.7.2\direct\task\Task.py", line 460, in step
    self.mgr.poll()
  File "IDEmini.py", line 970, in IDE_doActivate
    exec('import IDE\nfrom IDE import *') in GLOBALS
  File "<string>", line 1, in <module>
  File "C:\Panda3D-1.7.2\Panda3dIDE(unofficial)\IDE.py", line 2028, in <module>
    IDE_SB_createPreferencesButton()
  File "C:\Panda3D-1.7.2\Panda3dIDE(unofficial)\IDE.py", line 1433, in IDE_SB_cr
eatePreferencesButton
    clickSound=0, rolloverSound=0, pressEffect=0)
  File "C:\Panda3D-1.7.2\direct\gui\DirectButton.py", line 62, in __init__
    self.initialiseoptions(DirectButton)
  File "C:\Panda3D-1.7.2\direct\gui\DirectGuiBase.py", line 242, in initialiseop
tions
    func()
  File "C:\Panda3D-1.7.2\direct\gui\DirectFrame.py", line 180, in setImage
    sort = DGG.IMAGE_SORT_INDEX)
  File "C:\Panda3D-1.7.2\direct\gui\DirectGuiBase.py", line 562, in createcompon
ent
    widget = apply(widgetClass, widgetArgs, kw)
  File "C:\Panda3D-1.7.2\direct\gui\OnscreenImage.py", line 49, in __init__
    self.setImage(image, parent = parent, sort = sort)
  File "C:\Panda3D-1.7.2\direct\gui\OnscreenImage.py", line 106, in setImage
    tex = loader.loadTexture(image)
  File "C:\Panda3D-1.7.2\direct\showbase\Loader.py", line 533, in loadTexture
    raise IOError, message
IOError: Could not load texture: IDE_pref.png
Traceback (most recent call last):
  File "IDEmini.py", line 990, in <module>
     IDE_safeRun()
  File "IDEmini.py", line 834, in IDE_safeRun
     IDE_doActivate()
  File "IDEmini.py", line 968, in IDE_doActivate
     sys.modules[__name__] = sys.modules.pop('IDE')
KeyError :  'IDE'


I use Panda3d 1.7.2
Windows Vista 64bit
and the last update of this IDE.

Sorry, if this is a newbie problem,but I've followed all the installation process as reported in the first post.

thanks in advance for your help.
User avatar
Adanf
 
Posts: 86
Joined: Tue Feb 21, 2012 7:41 pm
Location: Italy

Postby ynjh_jo » Tue Feb 21, 2012 10:47 pm

OMG.
That's because it can't find IDE_pref.png in /images directory.
I assume you downloaded the images ZIP file from panda3dprojects.com, and I just checked it, looks like I forgot uploading it there. Try the one at p3dp.com, just replace the address.

EDIT:
I've updated it at panda3dprojects.com.
http://ynjh.tk
Intel P4Prescott 2.8GHz HT | ATI Radeon HD4670 1GB GDDR3
User avatar
ynjh_jo
 
Posts: 1795
Joined: Tue Apr 18, 2006 12:41 am
Location: Malang, Indonesia

PreviousNext

Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 0 guests

cron