[GRASS-SVN] r54953 - grass/trunk
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Feb 6 06:16:24 PST 2013
Author: wenzeslaus
Date: 2013-02-06 06:16:23 -0800 (Wed, 06 Feb 2013)
New Revision: 54953
Added:
grass/trunk/SUBMITTING_WXGUI
Modified:
grass/trunk/SUBMITTING
grass/trunk/SUBMITTING_DOCS
grass/trunk/SUBMITTING_PYTHON
Log:
wxGUI: submitting file created
Modified: grass/trunk/SUBMITTING
===================================================================
--- grass/trunk/SUBMITTING 2013-02-06 10:49:54 UTC (rev 54952)
+++ grass/trunk/SUBMITTING 2013-02-06 14:16:23 UTC (rev 54953)
@@ -5,8 +5,9 @@
when submitting C code to GRASS SVN repository, please take care of
following rules:
-[ see also SUBMITTING_PYTHON for Python code hints ]
-[ see alse SUBMITTING_DOCS for documentation ]
+[ see SUBMITTING_PYTHON for Python code hints ]
+[ see SUBMITTING_WXGUI for wxPython GUI code hints ]
+[ see SUBMITTING_DOCS for documentation ]
1. Get and read the GRASS Programmer's Manual here:
http://grass.osgeo.org/programming7/
Modified: grass/trunk/SUBMITTING_DOCS
===================================================================
--- grass/trunk/SUBMITTING_DOCS 2013-02-06 10:49:54 UTC (rev 54952)
+++ grass/trunk/SUBMITTING_DOCS 2013-02-06 14:16:23 UTC (rev 54953)
@@ -5,7 +5,8 @@
when submitting documentation to GRASS SVN repository, please take
care of following rules:
-[ see SUBMITTING for C hints ]
+[ see SUBMITTING for C hints ]
+[ see SUBMITTING_WXGUI for wxPython GUI code hints ]
[ see SUBMITTING_PYTHON for Python code hints ]
Modified: grass/trunk/SUBMITTING_PYTHON
===================================================================
--- grass/trunk/SUBMITTING_PYTHON 2013-02-06 10:49:54 UTC (rev 54952)
+++ grass/trunk/SUBMITTING_PYTHON 2013-02-06 14:16:23 UTC (rev 54953)
@@ -5,7 +5,8 @@
when submitting Python code to GRASS SVN repository, please take
care of following rules:
-[ see SUBMITTING for C hints ]
+[ see SUBMITTING for C hints ]
+[ see SUBMITTING_WXGUI for wxPython GUI code hints ]
[ see SUBMITTING_DOCS for documentation ]
See also http://www.python.org/dev/peps/pep-0008/
@@ -148,58 +149,27 @@
svn:ignore : *.pyc
or e.g. for Python file
-
+
svn:mime-type : text/python
svn:keywords : Author Date Id
svn:eol-style : native
+ svn propset svn:mime-type text/python new/file.py
+ svn propset svn:keywords "Author Date Id" new/file.py
+ svn propset svn:eol-style native new/file.py
+
See
http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html
-13. wxGUI (gui/wxpython)
-
- See http://wiki.wxpython.org/wxPython_Style_Guide
-
- Major rules:
-
- - use named parameters in functions, e.g.
-
- dlg = wx.FileDialog(parent = self, message = _("Choose file to save current workspace"),
- wildcard = _("GRASS Workspace File (*.gxw)|*.gxw"), style = wx.FD_SAVE)
-
- instead of
-
- dlg = wx.FileDialog(self, _("Choose file to save current workspace"),
- _("GRASS Workspace File (*.gxw)|*.gxw"), wx.FD_SAVE)
-
- - use wx.ID_ANY instead of `-1`
-
- - use gcmd.GError(), gcmd.GWarning and gcmd.GMessage instead of wx.MessageBox()
-
- - use gcmd.RunCommand() instead of grass.run_command() or grass.read_command()
-
- - use full strings, eg.
-
- if ...:
- win.SetLabel(_('Name for new 3D raster map to create'))
- else:
- win.SetLabel(_('Name for new raster map to create'))
-
- instead of
-
- _('Name for new %s to create') % maplabel
-
- where `maplabel` can be 'raster map' or '3D raster map'
-
-14. Tell the other developers about the new code using the following e-mail:
+13. Tell the other developers about the new code using the following e-mail:
grass-dev at lists.osgeo.org
To subscribe to this mailing list, see
http://lists.osgeo.org/mailman/listinfo/grass-dev
-15. In case of questions feel free to contact the developers at the above
+14. In case of questions feel free to contact the developers at the above
mailing list.
http://grass.osgeo.org/devel/index.php#submission
Added: grass/trunk/SUBMITTING_WXGUI
===================================================================
--- grass/trunk/SUBMITTING_WXGUI (rev 0)
+++ grass/trunk/SUBMITTING_WXGUI 2013-02-06 14:16:23 UTC (rev 54953)
@@ -0,0 +1,156 @@
+NOTE: Please improve this list!
+
+Dear (new) GRASS developer,
+
+when submitting Python code to GRASS SVN repository, please take
+care of following rules:
+
+[ see SUBMITTING for C hints ]
+[ see SUBMITTING_PYTHON for Python code hints ]
+[ see SUBMITTING_DOCS for documentation ]
+
+
+0. Introduction
+
+ For general GRASS, svn and Python issues and module related issues see
+ SUBMITTING_PYTHON and SUBMITTING.
+
+ GUI is divided into components. One component is usually placed in one
+ directory.
+
+
+1. GRASS documentation
+
+ GRASS Programming manual for API and existing classes
+ http://grass.osgeo.org/programming7/wxpythonlib.html
+
+ GRASS wiki has pages about how to develop wxGUI
+ http://grasswiki.osgeo.org
+
+ GRASS Trac wiki has pages about the state of wxGUI development
+ http://trac.osgeo.org/grass/wiki/wxGUIDevelopment
+
+
+2. External documentation
+
+ Style Guide for Python Code
+ http://www.python.org/dev/peps/pep-0008/
+
+ Python Style Guide by Guido van Rossum
+ http://www.python.org/doc/essays/styleguide.html
+
+ wxPython Style Guide
+ http://wiki.wxpython.org/wxPython_Style_Guide
+
+ Additional info on Python docstrings
+ http://epydoc.sourceforge.net/docstrings.html
+
+
+3. Remember that functionality such as generating plots should be primarily
+ provided by modules not GUI.
+
+
+4. Try to create create also g.gui.* module for the new GUI component. It helps
+ advanced users to access functionality and developers to test it. Moreover,
+ it helps to keep components separated and thus, supports re-usability.
+
+
+5. Add a header section to each file you submit and make sure you
+ include the copyright. The purpose section is meant to contain a
+ general over view of the code in the file to assist other
+ programmers that will need to make changes to your code. For this
+ purpose use Python docstring.
+
+ The copyright protects your rights according to GNU General Public
+ License (www.gnu.org).
+
+ Please use the following docstring template:
+
+ """!
+ @package dir.example
+
+ @brief Short example package description
+
+ Classes:
+ - example::ExampleClass
+
+ (C) 2012 by the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ @author First Author <first somewhere.com>
+ @author Second Author <second somewhere.com>
+ @author Some Other <third somewhere.com> (some particular change)
+ """
+
+
+6. Comment your classes and functions with docstrings. Use Doxygen syntax,
+ particularly, use commands which begins with @
+ (www.doxygen.org/manual/commands.html).
+
+ Comment also the code itself such as the meaning of variables,
+ conditions etc.
+
+
+7. Make sure a new line is at the end of each file. Non empty line breaks the
+ build process.
+
+
+8. Basic rules
+
+ Do not use print command unless you know what are you doing.
+
+ Use named parameters in functions, e.g.
+
+ dlg = wx.FileDialog(parent=self, message=_("Choose file to save current workspace"),
+ wildcard=_("GRASS Workspace File (*.gxw)|*.gxw"), style = wx.FD_SAVE)
+
+ instead of
+
+ dlg = wx.FileDialog(self, _("Choose file to save current workspace"),
+ _("GRASS Workspace File (*.gxw)|*.gxw"), wx.FD_SAVE)
+
+ Use wx.ID_ANY instead of `-1`.
+
+ Use GError, GWarning and GMessage instead of wx.MessageBox()
+
+ Do not use grass.run_command() or grass.read_command(). Use functions and
+ classes which uses threads such as RunCommand.
+
+ Use full strings, e.g.
+
+ if ...:
+ win.SetLabel(_('Name for new 3D raster map to create'))
+ else:
+ win.SetLabel(_('Name for new raster map to create'))
+
+ instead of
+
+ _('Name for new %s to create') % maplabel
+
+ where `maplabel` can be 'raster map' or '3D raster map'
+
+
+9. Use tools such as pylint and pep8 to check your code (both style and
+ correctness). Just note that default settings of these tools is not fully
+ compatible with wxGUI/wxPython style and that some of the reported errors
+ may not apply to your code.
+
+
+14. Tell the other developers about the new code using the following e-mail:
+ grass-dev at lists.osgeo.org
+
+ To subscribe to this mailing list, see
+ http://lists.osgeo.org/mailman/listinfo/grass-dev
+
+
+15. In case of questions feel free to contact the other developers at the above
+ mailing list.
+ http://grass.osgeo.org/devel/index.php#submission
+
+
+[please add further hints if required]
+
+
+"Your attention to detail is appreciated."
Property changes on: grass/trunk/SUBMITTING_WXGUI
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
More information about the grass-commit
mailing list