[GRASS-SVN] r68663 - in grass/branches/releasebranch_7_2: . general/g.version gui/wxpython/gui_core include lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 10 15:06:51 PDT 2016


Author: neteler
Date: 2016-06-10 15:06:51 -0700 (Fri, 10 Jun 2016)
New Revision: 68663

Added:
   grass/branches/releasebranch_7_2/CITING
Modified:
   grass/branches/releasebranch_7_2/Makefile
   grass/branches/releasebranch_7_2/general/g.version/Makefile
   grass/branches/releasebranch_7_2/general/g.version/main.c
   grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py
   grass/branches/releasebranch_7_2/include/Makefile
   grass/branches/releasebranch_7_2/lib/init/grass.py
Log:
g.version, wxGUI: backport of citation flag and menu entry (trunk r68657, r68658, r68659, r68662 with change to number 7.2)

Copied: grass/branches/releasebranch_7_2/CITING (from rev 68657, grass/trunk/CITING)
===================================================================
--- grass/branches/releasebranch_7_2/CITING	                        (rev 0)
+++ grass/branches/releasebranch_7_2/CITING	2016-06-10 22:06:51 UTC (rev 68663)
@@ -0,0 +1,28 @@
+The GRASS Development Team, the addon authors, further contributors and the user community have invested enormous efforts in making GRASS GIS available to you. Please give credit where credit is due and cite GRASS GIS and its addons when you use them for data analysis.
+
+For citation choices see below; for citing a particular GRASS GIS module, you may cite the main author(s) along with the GRASS Development Team.
+
+
+Choices for citing the main GRASS GIS software (update YEAR and version number accordingly):
+* GRASS Development Team, YEAR. Geographic Resources Analysis Support System (GRASS) Software, Version 7.2. Open Source Geospatial Foundation. http://grass.osgeo.org
+* GRASS Development Team, YEAR. Geographic Resources Analysis Support System (GRASS) Programmer's Manual. Open Source Geospatial Foundation. Electronic document: http://grass.osgeo.org/programming7
+
+
+Citing a GRASS GIS Addon (update AUTHOR(S), YEAR, Addon-NAME, and version number accordingly):
+* AUTHOR(S), and GRASS Development Team, YEAR Addon-NAME. Geographic Resources Analysis Support System (GRASS) Software, Version 7.2. Open Source Geospatial Foundation. https://grass.osgeo.org/grass72/manuals/addons/Addon-NAME.html
+
+
+For other (scientific) references, see
+* https://grasswiki.osgeo.org/wiki/GRASS_Citation_Repository
+
+
+A BibTeX entry for LaTeX users is:
+
+ at Manual{GRASS_GIS_software,
+  title = {Geographic Resources Analysis Support System (GRASS) Software},
+  author = {{GRASS Development Team}},
+  organization = {Open Source Geospatial Foundation},
+  address = {USA},
+  year = {YEAR},
+  url = {http://grass.osgeo.org},
+}

Modified: grass/branches/releasebranch_7_2/Makefile
===================================================================
--- grass/branches/releasebranch_7_2/Makefile	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/Makefile	2016-06-10 22:06:51 UTC (rev 68663)
@@ -50,7 +50,7 @@
 
 SUBDIRS = $(DIRS)
 
-FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv contributors_extra.csv translators.csv
+FILES = AUTHORS CITING COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv contributors_extra.csv translators.csv
 FILES_DST = $(patsubst %,$(ARCH_DISTDIR)/%,$(FILES))
 
 default:

Modified: grass/branches/releasebranch_7_2/general/g.version/Makefile
===================================================================
--- grass/branches/releasebranch_7_2/general/g.version/Makefile	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/general/g.version/Makefile	2016-06-10 22:06:51 UTC (rev 68663)
@@ -3,7 +3,7 @@
 PGM=g.version
 
 # cat the COPYING file, add a c line-break \n at each line end
-# and remove the unix newline. 
+# and remove the unix newline (see: include/Makefile)
 
 EXTRA_CFLAGS = $(PROJINC) $(GEOSCFLAGS) \
 	-DGRASS_VERSION_NUMBER=\"'$(GRASS_VERSION_NUMBER)'\" \

Modified: grass/branches/releasebranch_7_2/general/g.version/main.c
===================================================================
--- grass/branches/releasebranch_7_2/general/g.version/main.c	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/general/g.version/main.c	2016-06-10 22:06:51 UTC (rev 68663)
@@ -46,6 +46,10 @@
 #include <grass/copying.h>
 ;
 
+static const char CITING[] =
+#include <grass/citing.h>
+;
+
 static const char GRASS_CONFIGURE_PARAMS[] =
 #include <grass/confparms.h>
 ;
@@ -53,7 +57,7 @@
 int main(int argc, char *argv[])
 {
     struct GModule *module;
-    struct Flag *copyright, *build, *gish_rev, *shell, *extended;
+    struct Flag *copyright, *build, *gish_rev, *cite_flag, *shell, *extended;
 
     G_gisinit(argv[0]);
 
@@ -72,6 +76,11 @@
     copyright->description = _("Print also the copyright message");
     copyright->guisection = _("Additional info");
 
+    cite_flag = G_define_flag();
+    cite_flag->key = 'x';
+    cite_flag->description = _("Print also the citation options");
+    cite_flag->guisection = _("Additional info");
+
     build = G_define_flag();
     build->key = 'b';
     build->description = _("Print also the build information");
@@ -115,6 +124,11 @@
 	fputs(COPYING, stdout);
     }
 
+    if (cite_flag->answer) {
+	fprintf(stdout, "\n");
+	fputs(CITING, stdout);
+    }
+
     if (build->answer) {
 	fprintf(stdout, "\n");
 	fputs(GRASS_CONFIGURE_PARAMS, stdout);

Modified: grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gui_core/ghelp.py	2016-06-10 22:06:51 UTC (rev 68663)
@@ -70,6 +70,7 @@
         for title, win in ((_("Info"), self._pageInfo()),
                            (_("Copyright"), self._pageCopyright()),
                            (_("License"), self._pageLicense()),
+                           (_("Citation"), self._pageCitation()),
                            (_("Authors"), self._pageCredit()),
                            (_("Contributors"), self._pageContributors()),
                            (_("Extra contributors"), self._pageContributors(extra=True)),
@@ -284,6 +285,32 @@
 
         return licensewin
 
+    def _pageCitation(self):
+        """Citation information"""
+        try:
+            # import only when needed
+            import grass.script as gscript
+            text = gscript.read_command('g.version', flags='x')
+        except CalledModuleError as error:
+            text = _("Unable to provide citation suggestion,"
+                     " see GRASS GIS website instead."
+                     " The error was: {}").format(error)
+
+        # put text into a scrolling panel
+        window = ScrolledPanel(self.aboutNotebook)
+        window.SetBackgroundColour('WHITE')
+        stat_text = wx.StaticText(
+            window, id=wx.ID_ANY, label=text)
+        window.SetAutoLayout(True)
+        window.sizer = wx.BoxSizer(wx.VERTICAL)
+        window.sizer.Add(item=stat_text, proportion=1,
+                         flag=wx.EXPAND | wx.ALL, border=3)
+        window.SetSizer(window.sizer)
+        window.Layout()
+        window.SetupScrolling()
+
+        return window
+
     def _pageCredit(self):
         """Credit about"""
         # credits

Modified: grass/branches/releasebranch_7_2/include/Makefile
===================================================================
--- grass/branches/releasebranch_7_2/include/Makefile	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/include/Makefile	2016-06-10 22:06:51 UTC (rev 68663)
@@ -5,7 +5,7 @@
 
 SRCH := $(wildcard ../include/*.h ../include/defs/*.h ../include/vect/*.h ../include/iostream/*.h)
 DSTH := $(patsubst ../include/%.h,$(ARCH_INCDIR)/%.h,$(SRCH))
-DSTH_EXTRA = $(ARCH_INCDIR)/copying.h $(ARCH_INCDIR)/confparms.h
+DSTH_EXTRA = $(ARCH_INCDIR)/copying.h $(ARCH_INCDIR)/citing.h $(ARCH_INCDIR)/confparms.h
 
 SRCMAKE := $(wildcard ../include/Make/*.make)
 DSTMAKE := $(patsubst ../include/Make/%.make,$(ARCH_DISTDIR)/include/Make/%.make,$(SRCMAKE))
@@ -45,5 +45,8 @@
 $(ARCH_INCDIR)/copying.h: $(MODULE_TOPDIR)/COPYING | $(ARCH_INCDIR)
 	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
 
+$(ARCH_INCDIR)/citing.h: $(MODULE_TOPDIR)/CITING | $(ARCH_INCDIR)
+	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
+
 $(ARCH_INCDIR)/confparms.h: $(MODULE_TOPDIR)/config.status | $(ARCH_INCDIR)
 	sed -n '7s/^#\(.*\)$$/"\1"/p' $< > $@

Modified: grass/branches/releasebranch_7_2/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass.py	2016-06-10 20:14:48 UTC (rev 68662)
+++ grass/branches/releasebranch_7_2/lib/init/grass.py	2016-06-10 22:06:51 UTC (rev 68663)
@@ -1429,12 +1429,14 @@
 %-41s%s (%s)
 %-41sg.manual -i
 %-41sg.version -c
+%-41sg.version -x
 """ % (_("GRASS GIS homepage:"),
         # GTC Running through: SHELL NAME
        _("This version running through:"),
        shellname, os.getenv('SHELL'),
        _("Help is available with the command:"),
-       _("See the licence terms with:")))
+       _("See the licence terms with:"),
+       _("See citation options with:")))
 
     if grass_gui == 'wxpython':
         message("%-41sg.gui wxpython" % _("If required, restart the GUI with:"))



More information about the grass-commit mailing list