Thread: [Sunuml-developers] First upload to SVN
Status: Planning
Brought to you by:
lazaruslong
From: Javier C. <ja...@ya...> - 2008-11-03 02:57:49
|
Hi, I just uploaded an experimental test to the SVN. Don't look much at the code because it is really messy, most of it is copy and paste from various samples I found. The purpose of this upload is to create the structure for SVN directories and test some controls of wxPython in action. To run the application you have to execute main.py. Be sure to install Python 2.6 and wxPython. I will make a more serious design to develop the plugin/gui framework from here on, any sugestions are welcome. Regards, Javier |
From: Steven G. <laz...@gm...> - 2008-11-03 11:47:05
|
Hey Javier, I just uploaded an experimental test to the SVN. > Don't look much at the code because it is really messy, most of it is > copy and paste from various samples I found. Ok I have some comments even if hadn't time to fully check the code. 1) Don't forget to put a license to each file. See http://sunuml.wiki.sourceforge.net/Copyright+%26+Disclaimer This source file is part of SunUML For the latest info, see http://sourceforge.net/projects/sunuml Copyright (c) 2008 SunUML. See also the Readme.txt Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License" of the "Copyright & Disclaimer" page of the SunUML wiki. You should have received a copy of the "GNU Free Documentation License" along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/fdl.html#TOC 2) Why the embedded images? It makes it slightly more difficult to customise. 3) We should follow the Python recommended coding style more closely http://www.python.org/dev/peps/pep-0008/ I copied below the most relevant part. IMO using the *mixedCase *convention would be better 4) As we are trying to do an UML tool we should try to use some... uml documentations before coding too much ;) We should use this code experiment to help us define some overall design. Bye, Steven ------------------------------------- Function Names Function names should be *lowercase*, with words separated by underscores as necessary to improve readability. *mixedCase *is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility. Function and method arguments Always use 'self' for the first argument to instance methods. Always use 'cls' for the first argument to class methods. If a function argument's name clashes with a reserved keyword, it is generally better to append a single trailing underscore rather than use an abbreviation or spelling corruption. Thus "print_" is better than "prnt". (Perhaps better is to avoid such clashes by using a synonym.) Method Names and Instance Variables Use the function naming rules: *lowercase *with words separated by underscores as necessary to improve readability. Use one leading underscore only for non-public methods and instance variables. To avoid name clashes with subclasses, use two leading underscores to invoke Python's name mangling rules. Python mangles these names with the class name: if class Foo has an attribute named __a, it cannot be accessed by Foo.__a. (An insistent user could still gain access by calling Foo._Foo__a.) Generally, double leading underscores should be used only to avoid name conflicts with attributes in classes designed to be subclassed. Note: there is some controversy about the use of __names (see below). |
From: Steven G. <laz...@gm...> - 2008-11-04 01:47:54
|
Hey Javier, I will replay on the developer list. Perhaps someone has an idea. Methods grouping seems necessary. In c++ importing methods instead of the whole class has compile & link advantage. Do you know if it is is the same in Python? One more thing, the file names are a pain. > > In python each file is a module, so if you put one class per file you get > the same number of modules as classes. > > The problem is when you want to use that class. > > For example in the file "SunUMLWorkspaceTreeUITool.py" there is a class > named "WorkspaceTreeUITool", if you want to use that class in another file > you write: > > import SunUMLWorkspaceTreeUITool #import the module > .... > tool = SunUMLWorkspaceTreeUITool.WorkspaceTreeUITool(parent) #Create an > instance of the object > .... > > We can do one of various things, the first is to group classes and > functions according to they're functionality, for example name the file > "workspace_tree.py" and put there all the classes necesary to make the > workspace tree work. This will reduce the amount of files and also the code > will be more visible. > > The other choice would be to use the import differently, like this: > > from SunUMLWorkspaceTreeUITool import WorkspaceTreeUITool #import the > module > .... > tool = WorkspaceTreeUITool(parent) #Create an instance of the object, you > don't have to put the name of the module > .... > > The second choice could be dangerous with name clashes, is like putting > "using namespace xx" in C++. > > > I think that grouping more classes inside one file would be better, as each > file would be a module of the program. Do you think this is ok? Or do you > think another way could be better? > > Regards > Javier > |
From: Javier C. <ja...@ya...> - 2008-11-05 02:05:07
|
I created a class diagram to show what I'm going to do for the GUI-Plugin Framework. It is made using StarUML, maybe someday we will be able to open it using SunUML. It's pretty basic. You can view a class description by selecting the class and then showing the "Documentation Panel". I added documentation for all classes to explain the responsibility of each one. By the way is is uploaded to the SVN, maybe I could put it on the wiki if someone wants. All ideas are welcome, this is still work in progress. Regards, Javier |
From: Steven G. <laz...@gm...> - 2008-11-05 23:15:51
|
Hello I created a class diagram to show what I'm going to do for the > GUI-Plugin Framework. > > It is made using StarUML, maybe someday we will be able to open it using > SunUML. Which version of StarUML did you use ? Because with my version 5.0.2.1570 (Win32) I can't load the .uml and get the error: *Could not convert variant of type (OleStr) into type (Double)* Any idea? We need SunUML ;) Steven |
From: Javier C. <ja...@ya...> - 2008-11-06 03:20:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> No idea, I have the same version as you and I can open it fine.<br> <br> Try opening StarUML first and then opening the diagram with File/Open instead of double clicking on the file.<br> I have no clue why you get this error.<br> <br> If you can't open it I can upload the design to the wiki with explanations as text.<br> <br> Steven Gay escribió: <blockquote cite="mid:ad8...@ma..." type="cite">Hello<br> <br> <div class="gmail_quote"> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I created a class diagram to show what I'm going to do for the<br> GUI-Plugin Framework.<br> <br> It is made using StarUML, maybe someday we will be able to open it using<br> SunUML.</blockquote> </div> <br> Which version of StarUML did you use ?<br> <br> Because with my version 5.0.2.1570 (Win32) I can't load the .uml and get the error:<br> <br> <div style="margin-left: 40px;"><i>Could not convert variant of type (OleStr) into type (Double)</i><br> </div> <br> <br> Any idea?<br> <br> We need SunUML ;)<br> <br> Steven<br> <br> <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world <a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a></pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Sunuml-developers mailing list <a class="moz-txt-link-abbreviated" href="mailto:Sun...@li...">Sun...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/sunuml-developers">https://lists.sourceforge.net/lists/listinfo/sunuml-developers</a> </pre> </blockquote> </body> </html> |
From: Javier C. <ja...@ya...> - 2008-11-05 02:15:42
|
Searching for widgets I found various of them that could help me do SunUML main frame. For panel arrangement I thought of using the AUI Manager, handles automatic panel arrangement using perspective or with user input by dragging the panels. For center panel (diagram pages) FlatNotebook, this allows showing, closing and rearraging tabs. Can anyone tell if this choices are good or are there any better controls to replicate/improve StarUML interface on SunUML? And finally I don't have a good control for the toolbox (maybe a vertical toolbar?), any sugestions? That's it, thanks Javier |
From: Steven G. <laz...@gm...> - 2008-11-05 23:56:10
|
Hey For panel arrangement I thought of using the AUI Manager, handles > automatic panel arrangement using perspective or with user input by > dragging the panels. AUI is a good choice I use it for my editor. > For center panel (diagram pages) FlatNotebook, this allows showing, > closing and rearraging tabs. We will also need progrid and later wxScintilla: - wxScintilla - http://www.scintilla.org/ - progrid - http://wxpropgrid.sourceforge.net/ Btw don't forget to note the version of the libraries you are using. We should create a "Building from Source" page something like this: http://www.opengameengine.org/wiki/index.php?title=DanuNotes > And finally I don't have a good control for the toolbox (maybe a > vertical toolbar?), any sugestions? If I am not mistaken you can't with a wxToolBar add a string next to the icon which makes it less clear for beginners. Perhaps a vertical *wxMenu* would better suits our need. If not then a simple *wxListView* should do the trick. About the StarUML tool bar there is one point I don't like: I am constantly switching between the "Annotation" and "Class" sub-panel which oblige me to go up and down the toolbar. Any idea how we could avoid this? Use tabs instead? Putting all in one bar would make it too big and oblige to scroll. Which is not really better (except if we list the tools by usage frequency). Regards, Steven |
From: Aidar T. <ata...@ya...> - 2008-11-06 22:01:56
Attachments:
foldpanelbar_collapsed.JPG
foldpanelbar.JPG
|
Hi, For toolbox we can use FoldPanelBar class (comes with wxPython). I attached two screenshots from wxPython demo. Also I recommend to use AuiNotebook - as it is integrates better with AUI manager. Code style: I think we should follow wxPython style guide (http://wiki.wxpython.org/wxPython%20Style%20Guide) Regards, Aidar Talibzhanov ----- Original Message ---- From: Javier Capanegra <ja...@ya...> To: sun...@li... Sent: Wednesday, 5 November, 2008 3:15:26 Subject: [Sunuml-developers] wxPython/wxWidgets help Searching for widgets I found various of them that could help me do SunUML main frame. For panel arrangement I thought of using the AUI Manager, handles automatic panel arrangement using perspective or with user input by dragging the panels. For center panel (diagram pages) FlatNotebook, this allows showing, closing and rearraging tabs. Can anyone tell if this choices are good or are there any better controls to replicate/improve StarUML interface on SunUML? And finally I don't have a good control for the toolbox (maybe a vertical toolbar?), any sugestions? That's it, thanks Javier ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sunuml-developers mailing list Sun...@li... https://lists.sourceforge.net/lists/listinfo/sunuml-developers |
From: Steven G. <laz...@gm...> - 2008-11-07 00:02:18
|
For toolbox we can use FoldPanelBar class (comes with wxPython). ok - it true that you can have two panel open at the same time. Which avoid the StarUML behavior of having to reopen all them all the time. Code style: I think we should follow wxPython style guide ( > http://wiki.wxpython.org/wxPython%20Style%20Guide) > Arghh... wxPython doesn't follow the Python guidelines but the wx style :( The Python patch styles guidelines: http://www.python.org/dev/patches/style/ *A tab character should always be equivalent to 8 spaces, not 4 as is the default in most editors on Mac and Windows.) Make sure all lines fit in 78 columns. When submitting C code, don't use C++ style (//) comments. Write function and method calls like this; foo(arg1, arg2); * http://www.python.org/dev/peps/pep-0257/ http://www.python.org/dev/peps/ http://www.python.org/dev/peps/pep-0008/* * Should we follow wxPython or Python ? IMO Python as it is the *language* we choice but I will follow the majority... :/ Regards, Steven |
From: Javier C. <ja...@ya...> - 2008-11-07 00:33:10
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> 4 spaces is the default for tab now. 8 spaces was the default before, it says that is for old code.<br> <br> I think we should use PEP8.<br> <br> Should we use mixed case function names instead of words sepparated by underscores?<br> <br> That's the only objection I have to that standard<br> <br> Steven Gay escribió: <blockquote cite="mid:ad8...@ma..." type="cite"><br> <br> <div class="gmail_quote"> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">For toolbox we can use FoldPanelBar class (comes with wxPython).</blockquote> <div><br> ok - it true that you can have two panel open at the same time. Which avoid the StarUML behavior of having to reopen all them all the time.<br> <br> <br> <br> </div> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Code style: I think we should follow wxPython style guide (<a moz-do-not-send="true" href="http://wiki.wxpython.org/wxPython%20Style%20Guide" target="_blank">http://wiki.wxpython.org/wxPython%20Style%20Guide</a>)<br> </blockquote> <br> Arghh... wxPython doesn't follow the Python guidelines but the wx style :(<br> <br> The Python patch styles guidelines: <a moz-do-not-send="true" href="http://www.python.org/dev/patches/style/">http://www.python.org/dev/patches/style/</a><br> <br> </div> <div style="margin-left: 40px;"><i>A tab character should <em>always</em> be equivalent to 8 spaces, not 4 as is the default in most editors on Mac and Windows.) <strong style="font-weight: normal;">Make sure all lines fit in 78 columns.</strong> When submitting C code, don't use C++ style (//) comments. Write function and method calls like this; <b>foo(arg1, arg2);</b><br> </i></div> <br> <a moz-do-not-send="true" href="http://www.python.org/dev/peps/pep-0257/">http://www.python.org/dev/peps/pep-0257/</a><br> <a moz-do-not-send="true" href="http://www.python.org/dev/peps/">http://www.python.org/dev/peps/</a><br> <a moz-do-not-send="true" href="http://www.python.org/dev/peps/pep-0008/">http://www.python.org/dev/peps/pep-0008/</a><i><br> </i><br> Should we follow wxPython or Python ?<br> <br> IMO Python as it is the <b>language</b> we choice but I will follow the majority... :/<br> <br> Regards,<br> Steven<br> <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world <a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a></pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Sunuml-developers mailing list <a class="moz-txt-link-abbreviated" href="mailto:Sun...@li...">Sun...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/sunuml-developers">https://lists.sourceforge.net/lists/listinfo/sunuml-developers</a> </pre> </blockquote> </body> </html> |
From: Steven.Gay <laz...@gm...> - 2008-11-07 00:39:12
|
Hey Javier, > 4 spaces is the default for tab now. 8 spaces was the default before, > it says that is for old code. ok - for me. > Should we use mixed case function names instead of words sepparated by > underscores? > > That's the only objection I have to that standard I prefer also mixedCase. Btw this is what I proposed on the http://sunuml.wiki.sourceforge.net/Rules+%26+Coding+Style+Convention page ;) What do the others think? Steven |
From: Steven G. <laz...@gm...> - 2008-11-06 04:58:51
|
Seems it is a localisation issue: https://sourceforge.net/forum/message.php?msg_id=4214447 I didn't touch any default settings of StarUML. Is this because my machine in a Swiss-French WinXP and StarUML is in english? If yes I don't see how to correct this problem :/ I will try to change the digits to confirm this. We will need to discuss via .png images :/ Regards, Steven |