A decorator is a convenient way to generate function wrappers. It is a function that when called with the original functions returns a wrapped version of it. In my case, I simply add the functions I get to the dictionary.
After looking at your code, I would've fully parsed the args and then use a dictionary with the commands and the corresponding functions. You can code the whole logic about what to do if you have different number args into the methods you call.
@davidkt, svn, or subversion, is the version control software we use to share code.look in Wikipedia or just google it for guides. What OS do you use?
Offline
roijac wrote:
@davidkt, svn, or subversion, is the version control software we use to share code.look in Wikipedia or just google it for guides. What OS do you use?
I use Windows 8 (Opera 12.15). I looked at Wikipedia and I think you have to put it on a website- what website is it that we're using?
Offline
I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?
Offline
davidkt wrote:
roijac wrote:
Sourceforge - that's why you need a sf account
If you're using windows I suggest you use tortoiseSVN.1. Link?
2. What's the point of this svn anyway?
http://betterexplained.com/articles/a-v … n-control/
It's like a shared dropbox folder for code
@menus, check for apostrophes missing etc, I can't really help further. If you want help coding you should probably post the code you used
Offline
I implemented the Engine!
Magnie wrote:
Okay, thanks for the info guys.
Also, I made a couple buttons. Lighter ones would be used for mouse-hover and when the project is running/stopped.
http://i1147.photobucket.com/albums/o54 … dea6c7.png
Nice ones - could you check them out to the icons folder, but with transparent background?
I thought maybe we could put the sprites scrollbar between the stage and the spritesPanel and add the buttons there - for now I made two menu items.
Offline
I feel so special, my first commit to M30W!
Anyways, do you want me to commit smaller ones (50x50 rather than 100x100, or any other size you want)?
Are there any other images you want (may as well use this opportunity to get better at my graphic design skills)?
Offline
Magnie wrote:
I feel so special, my first commit to M30W!
Anyways, do you want me to commit smaller ones (50x50 rather than 100x100, or any other size you want)?
Are there any other images you want (may as well use this opportunity to get better at my graphic design skills)?
mmm, probably 16x16 would be good, you know, like all the other icons
Offline
davidkt wrote:
I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?
Umm...
p.s. I'll take care of the executer for you (just what's this error about?)
roijac wrote:
If you want help coding you should probably post the code you used
menu.py, line 190-191:
Tools = (("&Run Project", wx.ID_ANY, OnRun) )
line 196:
menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))
Error Message:
Traceback (most recent call last): File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module> main() File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main show_app() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app app.CreateGUI() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI self.mainFrame = MainFrame(None) File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__ menubar = MenuBar(self, menus) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__ self.Append(Menu(self.parent, items), title) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__ for item, itemid, callback in items: ValueError: too many values to unpack
I know... confusing, I don't know what caused the problem, it looks like it has three values...
Last edited by davidkt (2013-05-02 17:27:00)
Offline
Does the object 'Tools' even exist?
@roijac: Well, the only real icon in there is 128x128.
Offline
Wow, I feel like an idiot.
Offline
davidkt wrote:
davidkt wrote:
I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?
Umm...
p.s. I'll take care of the executer for you (just what's this error about?)roijac wrote:
If you want help coding you should probably post the code you used
menu.py, line 190-191:
Code:
Tools = (("&Run Project", wx.ID_ANY, OnRun) )line 196:
Code:
menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))Error Message:
Code:
Traceback (most recent call last): File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module> main() File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main show_app() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app app.CreateGUI() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI self.mainFrame = MainFrame(None) File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__ menubar = MenuBar(self, menus) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__ self.Append(Menu(self.parent, items), title) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__ for item, itemid, callback in items: ValueError: too many values to unpackI know... confusing, I don't know what caused the problem, it looks like it has three values...
Common beginner mistake
Add a comma!
Anyway I put it in the Edit menu - I think it's better to have some items in the menus instead of four menus with 3-4 items each
Last edited by roijac (2013-05-03 11:03:09)
Offline
roijac wrote:
davidkt wrote:
davidkt wrote:
I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?
Umm...
p.s. I'll take care of the executer for you (just what's this error about?)roijac wrote:
If you want help coding you should probably post the code you used
menu.py, line 190-191:
Code:
Tools = (("&Run Project", wx.ID_ANY, OnRun) )line 196:
Code:
menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))Error Message:
Code:
Traceback (most recent call last): File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module> main() File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main show_app() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app app.CreateGUI() File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI self.mainFrame = MainFrame(None) File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__ menubar = MenuBar(self, menus) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__ self.Append(Menu(self.parent, items), title) File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__ for item, itemid, callback in items: ValueError: too many values to unpackI know... confusing, I don't know what caused the problem, it looks like it has three values...
Common beginner mistake
Add a comma!
Anyway I put it in the Edit menu - I think it's better to have some items in the menus instead of four menus with 3-4 items each
Oops... I'm not a beginner, I've just not used tuples lately- just lists, so I forgot the one-item rule.
Anyway, I was going to put some more options in the Tools menu, like "Debug", "Run with Error Console", and "Show Interactive Shell". Look at IDLE (which I barely ever use), the last 5 menus have 1-4 options! Anyway, how does "Run Project" fit under "Edit"?
Offline
I wouldn't consider IDLE as the perfect designed app
I thought 'Run Project' fits under 'Edit' because when you edit a project, you run it. As we get to more features, we can look into it but now we should focus more on getting all the blocks to work - we still have 7 categories to go, variable watchers, speech bubbles, costumes sizing etc.
What you can do right now is fixing the costume center bug on windows where the controls don't get focus, add new blocks and look into mouseclicking/keyboard events.
The execution engine is completed, except for one little bug affecting the switching between scripts.
Glad svn is working
Offline
I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:
Offline
roijac wrote:
I wouldn't consider IDLE as the perfect designed app
I thought 'Run Project' fits under 'Edit' because when you edit a project, you run it. As we get to more features, we can look into it but now we should focus more on getting all the blocks to work - we still have 7 categories to go, variable watchers, speech bubbles, costumes sizing etc.
What you can do right now is fixing the costume center bug on windows where the controls don't get focus, add new blocks and look into mouseclicking/keyboard events.
The execution engine is completed, except for one little bug affecting the switching between scripts.
Glad svn is working
You should commit soon. :p
Offline
Thanks, I got M30W working. I needed to run "sudo puthon setup.py install.
Offline
darkness3560 wrote:
Thanks, I got M30W working. I needed to run "sudo puthon setup.py install.
technoguyx wrote:
I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:
You can implement blocks
Magnie wrote:
You should commit soon. :p
#rev104?
You can run some scripts.
Offline
roijac wrote:
technoguyx wrote:
I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:
You can implement blocks
I was already looking into implementing a "Project Summary" window, actually. So far, it's just a dialog with "Apply" and "Cancel" buttons.
Offline
roijac wrote:
The execution engine is completed, except for one little bug affecting the switching between scripts.
Where is it then?
Also I can make executable binaries for windows. What "costume center bug" is there? I need something to do during May 6-8.
Edit: I don't use idle either. I use spe.
Last edited by davidkt (2013-05-05 17:55:43)
Offline