From fba9b2f3b0f6ffc6c3df264c701c26417930e91f Mon Sep 17 00:00:00 2001 From: mfrasca Date: Thu, 31 May 2018 11:39:09 -0500 Subject: [PATCH 01/42] "bumping_to_1.0.86" --- bauble/version.py | 2 +- data/ghini.desktop | 2 +- doc/conf.py | 2 +- packages/builddeb.sh | 2 +- scripts/build-multiuser.nsi | 2 +- scripts/installer.cfg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bauble/version.py b/bauble/version.py index 75c3e28a4..fc4f10111 100644 --- a/bauble/version.py +++ b/bauble/version.py @@ -22,4 +22,4 @@ # The Ghini version. # major, minor, revision version tuple -version = "1.0.85" # :bump +version = "1.0.86" # :bump diff --git a/data/ghini.desktop b/data/ghini.desktop index 0006c6051..3dc669d44 100644 --- a/data/ghini.desktop +++ b/data/ghini.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Encoding=UTF-8 Name=Ghini -Version=1.0.85 # :bump +Version=1.0.86 # :bump Comment=An application for managing botanical collections Terminal=False Icon=ghini diff --git a/doc/conf.py b/doc/conf.py index 64f0a7eac..b574a00ea 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -70,7 +70,7 @@ # The short X.Y version. version = '1.0' # The full version, including alpha/beta/rc tags. -release = '1.0.85' # :bump +release = '1.0.86' # :bump # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/packages/builddeb.sh b/packages/builddeb.sh index b7fb87437..83a9ed7c7 100755 --- a/packages/builddeb.sh +++ b/packages/builddeb.sh @@ -3,7 +3,7 @@ # Requires bzr, devscripts, debhelper packages TOPLEVEL=`pwd` -VERSION="1.0.85" # :bump +VERSION="1.0.86" # :bump TARBALL="bauble-$VERSION.tar.gz" ORIG_TARBALL="bauble_$VERSION.orig.tar.gz" diff --git a/scripts/build-multiuser.nsi b/scripts/build-multiuser.nsi index 81c94d07f..a0af3ac4d 100755 --- a/scripts/build-multiuser.nsi +++ b/scripts/build-multiuser.nsi @@ -58,7 +58,7 @@ ; Global Name "ghini.desktop" -!define VERSION "1.0.85" ; :bump +!define VERSION "1.0.86" ; :bump !define SRC_DIR "..\dist" !define PRODUCT_NAME "ghini.desktop" Outfile "${PRODUCT_NAME}-${VERSION}-setup.exe" diff --git a/scripts/installer.cfg b/scripts/installer.cfg index 9c5f9180c..46d1124ae 100644 --- a/scripts/installer.cfg +++ b/scripts/installer.cfg @@ -1,6 +1,6 @@ [Application] name=Bauble -version=1.0.85 # :bump +version=1.0.86 # :bump entry_point=bauble:main icon=images/icon.ico From 5b884a14a9e13bdd1335ab1aafa8a964ed646c1e Mon Sep 17 00:00:00 2001 From: mfrasca Date: Thu, 31 May 2018 18:21:52 -0500 Subject: [PATCH 02/42] close #373 --- bauble/plugins/tag/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bauble/plugins/tag/__init__.py b/bauble/plugins/tag/__init__.py index 4ee241ace..8cedb2af3 100755 --- a/bauble/plugins/tag/__init__.py +++ b/bauble/plugins/tag/__init__.py @@ -216,6 +216,7 @@ def edit_callback(tags): presenter.session.rollback() else: presenter.commit_changes() + tags_menu_manager.reset() presenter.cleanup() return error_state From 2b2c47f940e849bacab2073f487fa30c068d4b75 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 06:58:18 -0500 Subject: [PATCH 03/42] place the relocatable runtime in ghini-runtime --- scripts/build-multiuser.nsi | 2 +- scripts/build_win.bat | 5 +++-- setup.py | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/build-multiuser.nsi b/scripts/build-multiuser.nsi index a0af3ac4d..c00e43e29 100755 --- a/scripts/build-multiuser.nsi +++ b/scripts/build-multiuser.nsi @@ -59,7 +59,7 @@ ; Global Name "ghini.desktop" !define VERSION "1.0.86" ; :bump -!define SRC_DIR "..\dist" +!define SRC_DIR "..\ghini-runtime" !define PRODUCT_NAME "ghini.desktop" Outfile "${PRODUCT_NAME}-${VERSION}-setup.exe" !define PROGEXE "ghini.exe" diff --git a/scripts/build_win.bat b/scripts/build_win.bat index d354a6839..a1f7bbd87 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -44,13 +44,14 @@ IF "%VIRTUAL_ENV%"=="" ( ECHO Installing dependencies REM STEP 3 - Install dependencies into the virtual environment +pip install --upgrade pip pip install py2exe_py2 pip install psycopg2 pip install Pygments ECHO cleaning up REM STEP 4 - clean up any previous builds -python setup.py clean +deltree ghini-runtime /y forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL @@ -71,7 +72,7 @@ python setup.py nsis GOTO :END :SKIP_NSIS -copy scripts\win_gtk.bat dist +copy scripts\win_gtk.bat ghini-runtime :END ENDLOCAL diff --git a/setup.py b/setup.py index eb2e72fa0..94a08d5e4 100755 --- a/setup.py +++ b/setup.py @@ -89,12 +89,13 @@ 'encodings', 'mako', 'mako.cache', 'pygments.styles.default', 'pyparsing'] py2exe_includes += gtk_pkgs + plugins_pkgs + sqlalchemy_includes - py2exe_setup_args = { + setup_args = { 'windows': [{'script': 'scripts/ghini', 'icon_resources': [(1, "bauble/images/icon.ico")]}]} - py2exe_options = { + setup_options = { "py2exe": { #no compression makes for better NSIS compression + "dist_dir": "ghini-runtime", "compressed": False, "optimize": 2, "includes": py2exe_includes, @@ -223,9 +224,8 @@ def run(self): os.system('"%s" %s' % (self.makensis, self.nsis_script)) else: - py2exe_options = {} - py2exe_setup_args = {} - py2exe_includes = [] + setup_options = {} + setup_args = {} class _empty_cmd(Command): user_options = [] @@ -495,6 +495,6 @@ def run(self): keywords="database biodiversity botanic collection " "botany herbarium arboretum", url="http://github.com/Ghini/ghini.desktop/", - options=py2exe_options, - **py2exe_setup_args + options=setup_options, + **setup_args ) From bb38fa0575b52e430c841f307c9bb51ee3554dd2 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 08:05:04 -0500 Subject: [PATCH 04/42] other attempt at windows equivalent for `rm -fr` --- scripts/build_win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index a1f7bbd87..64b29a825 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -51,7 +51,7 @@ pip install Pygments ECHO cleaning up REM STEP 4 - clean up any previous builds -deltree ghini-runtime /y +del /f /s /q ghini-runtime 1>nul forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL From 243c32c0560ec9e851dcf73a7e1f9f5c24152cd6 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 08:11:34 -0500 Subject: [PATCH 05/42] correcting paths --- scripts/build-multiuser.nsi | 4 ++-- scripts/build_win.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build-multiuser.nsi b/scripts/build-multiuser.nsi index c00e43e29..1673b3679 100755 --- a/scripts/build-multiuser.nsi +++ b/scripts/build-multiuser.nsi @@ -141,8 +141,8 @@ CRCCheck on ; NsisMultiUser - all settings need to be set before including the NsisMultiUser.nsh header file. ; thanks to Richard Drizin https://github.com/Drizin/NsisMultiUser -!include ..\data\nsis\Include\NsisMultiUser.nsh -!include ..\data\nsis\Include\UAC.nsh +!include ..\nsis\Include\NsisMultiUser.nsh +!include ..\nsis\Include\UAC.nsh !include MUI2.nsh !include WordFunc.nsh !include FileFunc.nsh diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 64b29a825..a74c37dc9 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -44,7 +44,7 @@ IF "%VIRTUAL_ENV%"=="" ( ECHO Installing dependencies REM STEP 3 - Install dependencies into the virtual environment -pip install --upgrade pip +"%VIRTUAL_ENV%"\Scripts\Python.exe -m pip install --upgrade pip pip install py2exe_py2 pip install psycopg2 pip install Pygments From 74919efd852e8af54b640b97d12150e5222c6ea8 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 08:20:59 -0500 Subject: [PATCH 06/42] should tell nsis to produce it in `dist`, but `move` is faster. --- scripts/build_win.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index a74c37dc9..698b3d1da 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -69,6 +69,7 @@ if defined exeonly GOTO SKIP_NSIS ECHO building NSIS installer REM STEP 7 - build the installer python setup.py nsis +move scripts\ghini.desktop*setup.exe dist\ GOTO :END :SKIP_NSIS From a6a8f5dca4407ef1453b786bf2183806bdf5b08a Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 08:22:23 -0500 Subject: [PATCH 07/42] but don't mention it --- scripts/build_win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 698b3d1da..864cd5140 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -69,7 +69,7 @@ if defined exeonly GOTO SKIP_NSIS ECHO building NSIS installer REM STEP 7 - build the installer python setup.py nsis -move scripts\ghini.desktop*setup.exe dist\ +move scripts\ghini.desktop*setup.exe dist\ >nul GOTO :END :SKIP_NSIS From 06345f2b2d4d82419713e9035515edec8e994631 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 08:58:11 -0500 Subject: [PATCH 08/42] create the output, a distributable file, straight into `dist` --- scripts/build-multiuser.nsi | 2 +- scripts/build_win.bat | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/build-multiuser.nsi b/scripts/build-multiuser.nsi index 1673b3679..d400b1a52 100755 --- a/scripts/build-multiuser.nsi +++ b/scripts/build-multiuser.nsi @@ -61,7 +61,7 @@ Name "ghini.desktop" !define VERSION "1.0.86" ; :bump !define SRC_DIR "..\ghini-runtime" !define PRODUCT_NAME "ghini.desktop" -Outfile "${PRODUCT_NAME}-${VERSION}-setup.exe" +Outfile "..\dist\${PRODUCT_NAME}-${VERSION}-setup.exe" !define PROGEXE "ghini.exe" !define COMPANY_NAME "" !define LICENSE_FILE "LICENSE" diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 864cd5140..a74c37dc9 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -69,7 +69,6 @@ if defined exeonly GOTO SKIP_NSIS ECHO building NSIS installer REM STEP 7 - build the installer python setup.py nsis -move scripts\ghini.desktop*setup.exe dist\ >nul GOTO :END :SKIP_NSIS From 103a2ce40549b81a83e2bd3e301f6c618b2ba135 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 09:25:43 -0500 Subject: [PATCH 09/42] put publishing command lines to be copied at end of output --- scripts/publish.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index 67c418671..ae602a7ce 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -22,11 +22,7 @@ cp debian/* /tmp/ghini.desktop-${PUBLISHING}/debian find debian -iname "*.ex" -execdir rm {} \; -or -name "*.source" -execdir rm {} \; -or -name "*~" -execdir rm {} \; debuild ) -# decide whether we continue -# in case, we should really dput the following to mentors.debian.org -echo -echo dput mentors $(ls /tmp/ghini.desktop_${PUBLISHING}-*_*.changes | tail -n 1) -echo +# all done for debian, publishing may follow, manually. # make sure you have locally all remote branches # @@ -38,14 +34,6 @@ git checkout $LINE git merge $LINE-dev --no-edit -m "Merge branch 'ghini-1.0-dev' into ghini-1.0, as $PUBLISHING" git push -# publish on pypi -# -echo -echo python setup.py sdist --formats zip upload -r pypi -echo - -# some day also produce a debian package - # some day also produce a windows installable # get back to work, and bump counters @@ -56,3 +44,9 @@ tmpfile=$(mktemp /tmp/bump-commit.XXXXXX) scripts/bump_version.py + | tee $tmpfile $(tail -n 1 $tmpfile) git push + +echo '******************************************************' +echo 'consider the following debian and pypi publishing steps' +echo +echo dput mentors $(ls /tmp/ghini.desktop_${PUBLISHING}-*_*.changes | tail -n 1) +echo python setup.py sdist --formats zip upload -r pypi From 28d5e99da7d09977f1fe4902575f82166d6a4945 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 09:33:18 -0500 Subject: [PATCH 10/42] make sure target directory exists --- scripts/build_win.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index a74c37dc9..583d9aeef 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -68,6 +68,7 @@ if defined exeonly GOTO SKIP_NSIS ECHO building NSIS installer REM STEP 7 - build the installer +mkdir dist 2>nul python setup.py nsis GOTO :END From 5e2ddbc7ad33e6c4e185e823b02d8dc06bdddc08 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 12:31:45 -0500 Subject: [PATCH 11/42] repeated install did not work out. make copying unconditional. --- setup.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 94a08d5e4..c7f4ecfef 100755 --- a/setup.py +++ b/setup.py @@ -142,19 +142,21 @@ def run(self): src = os.path.join(build_base, locales) dir_util.copy_tree(src, os.path.join(self.dist_dir, locales)) - # copy GTK to the dist directory, assuming PyGTK - # all-in-one installer + # copy GTK to the ghini-runtime directory, assuming PyGTK + # all-in-one installer. gtk_root = 'c:\\python27\\lib\\site-packages\\gtk-2.0\\runtime' dist_gtk = os.path.join(self.dist_dir, 'gtk') import shutil - if not os.path.exists(dist_gtk): - ignore = shutil.ignore_patterns('src', 'gtk-doc', 'icons', - 'man', 'demo', 'aclocal', - 'doc', 'include', 'emacs', - 'gettext', 'glade3', - 'gtksourceview-2.0', 'info', - 'intltool') - shutil.copytree(gtk_root, dist_gtk, ignore=ignore) + shutil.rmtree(dist_gtk) # overkill cleaning up + # ghini-runtime gets reconstructed from scratch each time, so + # there's no conditional copying + ignore = shutil.ignore_patterns('src', 'gtk-doc', 'icons', + 'man', 'demo', 'aclocal', + 'doc', 'include', 'emacs', + 'gettext', 'glade3', + 'gtksourceview-2.0', 'info', + 'intltool') + shutil.copytree(gtk_root, dist_gtk, ignore=ignore) # register the pixbuf loaders # populate loaders.cache also @@ -164,8 +166,8 @@ def run(self): cmd1 = 'call "%s" > "%s"' % (exe, dest1) cmd2 = 'call "%s" > "%s"' % (exe, dest2) print cmd1 - print cmd2 os.system(cmd1) + print cmd2 os.system(cmd2) # copy the the MS-Windows gtkrc to make it the default theme From a9be285651cc433791ff2bf02fa58033b47b11f1 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 12:33:24 -0500 Subject: [PATCH 12/42] parser gave syntax error ;-) --- scripts/build_win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 583d9aeef..730b5d59d 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -56,7 +56,7 @@ forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL ECHO installing without eggs -REM STEP 5 - install ghini.desktop and it's dependencies into the virtual environment +REM STEP 5 - install ghini.desktop and its dependencies into the virtual environment pip install . ECHO building executable From c9b5eb7d68e6176c0a3fa4d3cce70c14a6a2b474 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 14:05:39 -0500 Subject: [PATCH 13/42] reviewing docs --- doc/building.rst | 172 ++++++++++++++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 60 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 9b5543761..3f065ec09 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -1,13 +1,14 @@ Developer's Manual ======================== +If you ran the ``devinstall`` installation instructions, you have downloaded +the sources, connected to the github repository. You are in the ideal +situation to start looking into the software, understand how it works, +contribute to ghini.desktop's development. + Helping Ghini development -------------------------- -Installing Ghini always includes downloading the sources, connected to the -github repository. This is so because in our eyes, every user is always -potentially also a developer. - If you want to contribute to Ghini, you can do so in quite a few different ways: * Use the software, note the things you don't like, `open an issue @@ -29,6 +30,9 @@ history, you can open our `github project page `_ and see all that has been going on around Ghini since its inception as Bauble, back in the year 2004. +If you install the software according to the ``devinstall`` instructions, +you have the whole history in your local git clone. + Software source, versions, branches ------------------------------------------------------------- @@ -732,17 +736,91 @@ closing step * review this workflow. consider this as a guideline, to yourself and to your colleagues. please help make it better and matching the practice. -distributing for windows --------------------------- +Distributing ghini.desktop +---------------------------- + +Debian +^^^^^^^^^^^^^^^ + +Windows +^^^^^^^^^^^^^^^ + +For building a Windows installer or executable you need a running Windows +system. The methods described here has been used successfully on Windows 7, 8 +and 10. Windows Vista should also work but has not been tested. If you are on +GNU/Linux, or on OSX, you are not interested in the remainder of this section. + +The goal of the present instructions is to help you produce a Windows installer, +that is a single executable that you can run on any Windows workstation and that +will install a specific version of ghini.desktop. This is achieved with the +NSIS script-driven installer authoring tool. + +As a side product of the installer production, you will have a massive but +relocatable directory, which you can copy to a USB drive and which will let you +use the software without needing an installation. + +The files and directories relevant to this section: + +- ``scripts/build-win.bat`` — the single batch script to run. +- ``setup.py`` — implements the NSIS and py2exe commands. +- ``scripts/build-multiuser.nsi`` — the nsis script, used by the above. +- ``nsis/`` — contains redistributable NSIS files, put here for conveniency. +- ``ghini-runtime/`` — built by ``py2exe``, used by ``nsis``. +- ``dist/`` — receives the executable installation file. + +Most steps are automated in the ``build-win.bat`` script. Installation of a few +tools needs to be done manually: + +#. Download and install Python 2.7 and PyGTK as outlined in the + ``devinstall``-based :ref:`installation` instructions. Git will not be + needed here, having it however will not do any harm. + +#. Download and install `NSIS v3 `_. + +#. A **reboot** is recommended. + +#. Fork the ghini.desktop project on GitHub, or use the organization's + repository ``https://github.com/Ghini/ghini.desktop.git``. Clone the + repository from GitHub to wherever you want to keep it (replace + ```` with the path of your choice, + e.g. ``Local\github\Ghini\``) and checkout a production branch (``ghini-1.0`` + is recommended as used in the example). To do this, open a command prompt + and type these commands:: + + cd + git clone + cd ghini.desktop + git checkout ghini-1.0 + +The result of the above is a complete development environment. Use it to follow +development, or to propose your pull requests, and to build Windows installers. + +All subsequent steps are automated in the ``scripts\build_win.bat`` script. Run +it, and after a couple of minutes you should have a new +``dist\ghini.desktop--setup.exe`` file, and a working, complete +relocatable directory named ``ghini-runtime``. + +Read the rest if you need details about the way the script works. + +.. admonition:: The ``build_win.bat`` script + :class: toggle -For building a Windows installer or executable you will need an installation of -Windows. The methods described here has been used successfully on Windows 7, -8 and 10. Windows Vista should also work but has not been tested. + A batch file is available that can complete the last few steps. To use + it use this command:: -In the remainder of this section we assume you're using a Windows -workstation. We also assume assume you do not use it as your software -development platform. All steps described here are very similar to the -steps for a normal Windows :ref:`installation`. + scripts\build_win.bat + + ``build_win.bat`` accepts 2 arguments: + + #. ``/e`` will produce an executable only, skipping the extra step of + building an installer, and will copy ``win_gtk.bat`` into place. + + #. A path to the location for the virtual environment to use. (defaults + to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe``) + + e.g. to produce an executable only and use a virtual environment in + a folder beside where you have ghini.desktop you could execute + ``scripts\build_win.bat /e ..\ghi2exe`` .. admonition:: py2exe will not work with eggs :class: toggle @@ -750,7 +828,7 @@ steps for a normal Windows :ref:`installation`. Building a Windows executable with py2exe requires packages **not** be installed as eggs. There are several methods to accomplish this, including: - - Using pip to install. The easiest method is to install into a virtual + - Install using ``pip``. The easiest method is to install into a virtual environment that doesn't currently have any modules installed as eggs using ``pip install .`` as described below. If you do wish to install over the top of an install with eggs (e.g. the environment created by @@ -768,45 +846,10 @@ steps for a normal Windows :ref:`installation`. `_ to get any of the C extensions and will need a fresh virtual environment with no dependent packages installed as eggs. -#. Download and install git, Python 2.7 and PyGTK as outlined in the generic - :ref:`installation` instructions. - -#. Additionally, download and install `NSIS v3 `_. - -#. A **reboot** is recommended. - - .. admonition:: we have a script that automates the remaining steps - :class: toggle - - A batch file is available that can complete the last few steps. To use - it use this command:: - - scripts\build_win.bat - - ``build_win.bat`` accepts 2 arguments: - - #. ``/e`` will produce an executable only, skipping the extra step of - building an installer, and will copy ``win_gtk.bat`` into place. - - #. A path to the location for the virtual environment to use. (defaults - to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe``) - - e.g. to produce an executable only and use a virtual environment in - a folder beside where you have ghini.desktop you could execute - ``scripts\build_win.bat /e ..\ghi2exe`` - -#. Clone ghini.desktop to wherever you want to keep it (replace - ```` with the path of your choice, e.g. ``Local\github\Ghini\``) - and checkout a production branch (``ghini-1.0`` is recommended as - used in the example). To do this, open a command prompt and type these - commands:: - - cd - git clone https://github.com/Ghini/ghini.desktop.git - cd ghini.desktop - git checkout ghini-1.0 +.. admonition:: installing virtualenv and working with environments + :class: toggle -#. Install virtualenv, create a virtual environment and activate it. With only + Install virtualenv, create a virtual environment and activate it. With only Python 2.7 on your system (where ```` is the path to where you wish to keep the virtual environment) use:: @@ -815,39 +858,48 @@ steps for a normal Windows :ref:`installation`. call \Scripts\activate.bat On systems where Python 3 is also installed you may need to either call pip - and virtualenv with absolute paths e.g. ``C:\Python27\Scripts\pip`` or use + and virtualenv with absolute paths, e.g. ``C:\Python27\Scripts\pip`` or use the Python launcher e.g. ``py -2.7 -m pip`` (run ``python --version`` first to check. If you get anything other than version 2.7 you'll need to use one of these methods.) -#. Install dependencies and ghini.desktop into the virtual environment:: +.. admonition:: Populate the virtual environment + :class: toggle + + Install dependencies and ghini.desktop into the virtual environment:: pip install psycopg2 Pygments py2exe_py2 pip install . -#. Build the executable:: +.. admonition:: Compile for Windows + :class: toggle + + Build the executable:: python setup.py py2exe - The ``dist`` folder will now contain a full working copy of the software in + The ``ghini-runtime`` folder will now contain a full working copy of the software in a frozen, self contained state, that can be transferred however you like and will work in place. (e.g. placed on a USB flash drive for demonstration purposes or copied manually to ``C:\Program Files`` with a shortcut created on the desktop). To start ghini.desktop double click ``ghini.exe`` in explorer (or create a shortcut to it). If you have issues with the UI not displaying correctly you need to run the script ``win_gtk.bat`` from the - ``dist`` folder to set up paths to the GTK components correctly. (Running - ``build_win /e`` will place this script in the dist folder for you or you + ``ghini-runtime`` folder to set up paths to the GTK components correctly. (Running + ``build_win /e`` will place this script in the ``ghini-runtime`` folder for you or you can copy it from the ``scripts`` folder yourself.) You will only need to run this once each time the location of the folder changes. Thereafter ``ghini.exe`` will run as expected. -#. Build the installer:: +.. admonition:: Finally, invoke NSIS + :class: toggle + + Build the installer:: python setup.py nsis This should leave a file named ``ghini.desktop--setup.exe`` in the - ``scripts`` folder. This is your Windows installer. + ``dist`` folder. This is your Windows installer. .. admonition:: about the installer :class: toggle From 633996f1d722abf5f496f37a4ddd87e3da168312 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 15:05:42 -0500 Subject: [PATCH 14/42] describing PyPI and Debian packaging and publication --- doc/building.rst | 214 ++++++++++++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 84 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 3f065ec09..1063555db 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -736,19 +736,36 @@ closing step * review this workflow. consider this as a guideline, to yourself and to your colleagues. please help make it better and matching the practice. + Distributing ghini.desktop ---------------------------- -Debian -^^^^^^^^^^^^^^^ +Python Package Index - PyPI +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This is not much mentioned, but we keep ghini.desktop on the Python Package +Index, so you could install it by no more than:: + + pip install ghini.desktop + +There are a couple packages that can't be installed with ``pip``, but +otherwise that's really all you need to type, and it's platform independent. + +Publishing on PyPI is a standard ``setup`` command:: + + python setup.py sdist --formats zip upload -r pypi + Windows ^^^^^^^^^^^^^^^ For building a Windows installer or executable you need a running Windows system. The methods described here has been used successfully on Windows 7, 8 -and 10. Windows Vista should also work but has not been tested. If you are on -GNU/Linux, or on OSX, you are not interested in the remainder of this section. +and 10. Windows Vista should also work but has not been tested. + +If you are on GNU/Linux, or on OSX, you are not interested in the remainder of +this section. None of Ghini's contributors knows how to produce a Windows +installer without having a Windows system. The goal of the present instructions is to help you produce a Windows installer, that is a single executable that you can run on any Windows workstation and that @@ -805,134 +822,163 @@ Read the rest if you need details about the way the script works. .. admonition:: The ``build_win.bat`` script :class: toggle - A batch file is available that can complete the last few steps. To use - it use this command:: + A batch file is available that can complete the last few steps. To use + it use this command:: - scripts\build_win.bat + scripts\build_win.bat - ``build_win.bat`` accepts 2 arguments: + ``build_win.bat`` accepts 2 arguments: - #. ``/e`` will produce an executable only, skipping the extra step of - building an installer, and will copy ``win_gtk.bat`` into place. + #. ``/e`` will produce an executable only, skipping the extra step of + building an installer, and will copy ``win_gtk.bat`` into place. - #. A path to the location for the virtual environment to use. (defaults - to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe``) + #. A path to the location for the virtual environment to use. (defaults + to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe``) - e.g. to produce an executable only and use a virtual environment in - a folder beside where you have ghini.desktop you could execute - ``scripts\build_win.bat /e ..\ghi2exe`` + e.g. to produce an executable only and use a virtual environment in + a folder beside where you have ghini.desktop you could execute + ``scripts\build_win.bat /e ..\ghi2exe`` .. admonition:: py2exe will not work with eggs :class: toggle - Building a Windows executable with py2exe requires packages **not** be - installed as eggs. There are several methods to accomplish this, including: + Building a Windows executable with py2exe requires packages **not** be + installed as eggs. There are several methods to accomplish this, including: - - Install using ``pip``. The easiest method is to install into a virtual - environment that doesn't currently have any modules installed as eggs - using ``pip install .`` as described below. If you do wish to install over - the top of an install with eggs (e.g. the environment created by - ``devinstall.bat``) you can try ``pip install -I .`` but your mileage - may vary. + - Install using ``pip``. The easiest method is to install into a virtual + environment that doesn't currently have any modules installed as eggs + using ``pip install .`` as described below. If you do wish to install over + the top of an install with eggs (e.g. the environment created by + ``devinstall.bat``) you can try ``pip install -I .`` but your mileage + may vary. - - By adding:: + - By adding:: - [easy_install] - zip_ok = False + [easy_install] + zip_ok = False - to setup.cfg (or similarly ``zip_safe = False`` to ``setuptools.setup()`` - in ``setup.py``) you can use ``python setup.py install`` but you will need - to download and install `Microsoft Visual C++ Compiler for Python 2.7 - `_ to get any of the C extensions and will need - a fresh virtual environment with no dependent packages installed as eggs. + to setup.cfg (or similarly ``zip_safe = False`` to ``setuptools.setup()`` + in ``setup.py``) you can use ``python setup.py install`` but you will need + to download and install `Microsoft Visual C++ Compiler for Python 2.7 + `_ to get any of the C extensions and will need + a fresh virtual environment with no dependent packages installed as eggs. .. admonition:: installing virtualenv and working with environments :class: toggle - Install virtualenv, create a virtual environment and activate it. With only - Python 2.7 on your system (where ```` is the path to where you - wish to keep the virtual environment) use:: + Install virtualenv, create a virtual environment and activate it. With only + Python 2.7 on your system (where ```` is the path to where you + wish to keep the virtual environment) use:: - pip install virtualenv - virtualenv --system-site-packages - call \Scripts\activate.bat + pip install virtualenv + virtualenv --system-site-packages + call \Scripts\activate.bat - On systems where Python 3 is also installed you may need to either call pip - and virtualenv with absolute paths, e.g. ``C:\Python27\Scripts\pip`` or use - the Python launcher e.g. ``py -2.7 -m pip`` (run ``python --version`` first - to check. If you get anything other than version 2.7 you'll need to use one - of these methods.) + On systems where Python 3 is also installed you may need to either call pip + and virtualenv with absolute paths, e.g. ``C:\Python27\Scripts\pip`` or use + the Python launcher e.g. ``py -2.7 -m pip`` (run ``python --version`` first + to check. If you get anything other than version 2.7 you'll need to use one + of these methods.) .. admonition:: Populate the virtual environment :class: toggle - Install dependencies and ghini.desktop into the virtual environment:: + Install dependencies and ghini.desktop into the virtual environment:: - pip install psycopg2 Pygments py2exe_py2 - pip install . + pip install psycopg2 Pygments py2exe_py2 + pip install . .. admonition:: Compile for Windows :class: toggle - Build the executable:: + Build the executable:: - python setup.py py2exe + python setup.py py2exe - The ``ghini-runtime`` folder will now contain a full working copy of the software in - a frozen, self contained state, that can be transferred however you like and - will work in place. (e.g. placed on a USB flash drive for demonstration - purposes or copied manually to ``C:\Program Files`` with a shortcut created - on the desktop). To start ghini.desktop double click ``ghini.exe`` in - explorer (or create a shortcut to it). If you have issues with the UI not - displaying correctly you need to run the script ``win_gtk.bat`` from the - ``ghini-runtime`` folder to set up paths to the GTK components correctly. (Running - ``build_win /e`` will place this script in the ``ghini-runtime`` folder for you or you - can copy it from the ``scripts`` folder yourself.) You will only need to - run this once each time the location of the folder changes. Thereafter - ``ghini.exe`` will run as expected. + The ``ghini-runtime`` folder will now contain a full working copy of the software in + a frozen, self contained state, that can be transferred however you like and + will work in place. (e.g. placed on a USB flash drive for demonstration + purposes or copied manually to ``C:\Program Files`` with a shortcut created + on the desktop). To start ghini.desktop double click ``ghini.exe`` in + explorer (or create a shortcut to it). If you have issues with the UI not + displaying correctly you need to run the script ``win_gtk.bat`` from the + ``ghini-runtime`` folder to set up paths to the GTK components correctly. (Running + ``build_win /e`` will place this script in the ``ghini-runtime`` folder for you or you + can copy it from the ``scripts`` folder yourself.) You will only need to + run this once each time the location of the folder changes. Thereafter + ``ghini.exe`` will run as expected. .. admonition:: Finally, invoke NSIS :class: toggle - Build the installer:: + Build the installer:: - python setup.py nsis + python setup.py nsis - This should leave a file named ``ghini.desktop--setup.exe`` in the - ``dist`` folder. This is your Windows installer. + This should leave a file named ``ghini.desktop--setup.exe`` in the + ``dist`` folder. This is your Windows installer. .. admonition:: about the installer :class: toggle - - Capable of single user or global installs. + - Capable of single user or global installs. + + - At this point in time ghini.desktop installed this way will not + check or or notify you of any updated version. You will need to + check yourself. - - At this point in time ghini.desktop installed this way will not check - or or notify you of any updated version. You will need to check - yourself. + - Capable of downloading and installing optional extra components: - - Capable of downloading and installing optional extra components: + - Apache FOP - If you want to use xslt report templates install FOP. + FOP requires Java Runtime. If you do not currently have it + installed the installer will let you know and offer to open the + Oracle web site for you to download and install it from. - - Apache FOP - If you want to use xslt report templates install FOP. - FOP requires Java Runtime. If you do not currently have it installed - the installer will let you know and offer to open the Oracle web site - for you to download and install it from. + - MS Visual C runtime - You most likely don't need this but if you + have any trouble getting ghini.desktop to run try installing the + MS Visual C runtime (e.g. rerun the installer and select this + component only). - - MS Visual C runtime - You most likely don't need this but if you have - any trouble getting ghini.desktop to run try installing the MS Visual - C runtime (e.g. rerun the installer and select this component only). + - Can be run silently from the commandline (e.g. for remote + deployment) with the following arguments: - - Can be run silently from the commandline (e.g. for remote deployment) - with the following arguments: + - ``/S`` for silent; - - ``/S`` for silent; + - ``/AllUser`` (when run as administrator) or ``/CurrentUser`` - - ``/AllUser`` (when run as administrator) or ``/CurrentUser`` + - ``/C=[gFC]`` to specify components where: - - ``/C=[gFC]`` to specify components where: + ``g`` = Deselect the main ghini.desktop component (useful for + adding optional component after an initial install) - ``g`` = Deselect the main ghini.desktop component (useful for - adding optional component after an initial install) + ``F`` = select Apache FOP - ``F`` = select Apache FOP + ``C`` = select MS Visual C runtime + +Debian +^^^^^^^^^^^^^^^ - ``C`` = select MS Visual C runtime +Some time in the past someone published a version of Bauble for Debian, and +for Ubuntu. This was at the time of Bauble 0.9.7, and that version is +[still being distributed](https://packages.ubuntu.com/xenial/bauble), +regardless being it impossible to install. It's since 2007 that we've made +the people on Ubuntu and Debian aware of the problem. + +Only recently has Mario Frasca produced a new bauble debian package, for the +latest bauble.classic version 1.0.56, and proposed for inclusion in Debian. +View it on [mentors](https://mentors.debian.net/package/bauble). This +version depends on ``fibra``, a package that was never added to Debian and +which Mario also has packaged and [proposed for inclusion in +Debian](https://mentors.debian.net/package/fibra). Now we're waiting for a +sponsor, and hoping the package will eventually get all the way to Ubuntu. + +Once we get in contact with a [Debian +Sponsor](https://mentors.debian.net/sponsors) who will review what we +publish on [mentors](https://mentors.debian.net/intro-maintainers), then we +will be definitely expected to keep updating the debian package for +``ghini.desktop`` and ``fibra``. + +I am not going to explain in a few words the content of several books on +Debian packaging. Please choose your sources. For a very compact idea of +what you're expected to do, have a look at ``scripts/pubish.sh``. + From b31bf0668b931804ca7b867d8254e2d92856de0d Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 15:24:26 -0500 Subject: [PATCH 15/42] ignore the ghini-runtime directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 744a04329..a3f9fa65b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ env/ build/ develop-eggs/ dist/ +ghini-runtime/ downloads/ eggs/ .eggs/ From 19f9b164249567f4d6f3b24bb5e062680a2f45c6 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 15:58:41 -0500 Subject: [PATCH 16/42] uniform capitalization for readability; unconditional copying of path fixing script --- scripts/build_win.bat | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 730b5d59d..a4b71017b 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -6,38 +6,38 @@ REM only other argument proccessed must be a pathname to a virtualenv) :Loop IF [%1]==[] GOTO Continue IF "%1"=="/e" ( - set exeonly=y + set EXEONLY=y ) ELSE ( - set venv="%~f1" + set CUSTOMVENV="%~f1" ) SHIFT GOTO Loop :Continue -if defined exeonly ECHO build exe only -if defined venv ( - echo using venv %venv% +if defined EXEONLY ECHO build exe only +if defined CUSTOMVENV ( + echo using custom virtual environment %CUSTOMVENV% ) else ( - set venv="%HOMEDRIVE%%HOMEPATH%\.virtualenvs\ghi2exe" + set CUSTOMVENV="%HOMEDRIVE%%HOMEPATH%\.virtualenvs\ghi2exe" ) -IF NOT EXIST %venv%\Scripts\activate.bat ( +IF NOT EXIST %CUSTOMVENV%\Scripts\activate.bat ( ECHO creating build environment REM STEP 1 - install virtualenv and create a virtual environment C:\Python27\Scripts\pip install virtualenv - C:\Python27\Scripts\virtualenv --system-site-packages %venv% + C:\Python27\Scripts\virtualenv --system-site-packages %CUSTOMVENV% ) IF "%VIRTUAL_ENV%"=="" ( ECHO Activating build environment REM STEP 2 - activate the virtual environment - call %venv%\Scripts\activate.bat + call %CUSTOMVENV%\Scripts\activate.bat ) else ( ECHO Current virtual environment: "%VIRTUAL_ENV%" - IF NOT "%VIRTUAL_ENV%"==%venv% ( + IF NOT "%VIRTUAL_ENV%"==%CUSTOMVENV% ( ECHO deactivating current virtual environment and activating build environment call deactivate - call %venv%\Scripts\activate.bat + call %CUSTOMVENV%\Scripts\activate.bat ) ) @@ -64,16 +64,14 @@ REM STEP 6 - build the executable python setup.py py2exe REM executable only? -if defined exeonly GOTO SKIP_NSIS +if defined EXEONLY GOTO Skip_NSIS ECHO building NSIS installer REM STEP 7 - build the installer mkdir dist 2>nul python setup.py nsis -GOTO :END -:SKIP_NSIS +:Skip_NSIS copy scripts\win_gtk.bat ghini-runtime -:END ENDLOCAL From 9fd1f7bbeda61d0a392ae9bafc5b828dd42b7003 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 15:58:57 -0500 Subject: [PATCH 17/42] still reviewing --- doc/building.rst | 69 +++++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 1063555db..1c99fdd7a 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -809,8 +809,9 @@ tools needs to be done manually: cd ghini.desktop git checkout ghini-1.0 -The result of the above is a complete development environment. Use it to follow -development, or to propose your pull requests, and to build Windows installers. +The result of the above is a complete development environment, on Windows, with +NSIS. Use it to follow development, or to propose your pull requests, and to +build Windows installers. All subsequent steps are automated in the ``scripts\build_win.bat`` script. Run it, and after a couple of minutes you should have a new @@ -829,15 +830,19 @@ Read the rest if you need details about the way the script works. ``build_win.bat`` accepts 2 arguments: - #. ``/e`` will produce an executable only, skipping the extra step of - building an installer, and will copy ``win_gtk.bat`` into place. + #. ``/e`` — executable only. - #. A path to the location for the virtual environment to use. (defaults - to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe``) + Produce an executable only, skipping the extra step of building an + installer, and will copy ``win_gtk.bat`` into place. - e.g. to produce an executable only and use a virtual environment in - a folder beside where you have ghini.desktop you could execute - ``scripts\build_win.bat /e ..\ghi2exe`` + #. ``venv_path`` — A path to the location for the virtual environment to use. + + Defaults to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe`` + + If you want to produce an executable only and use a virtual + environment in a folder beside where you have ghini.desktop, you could + execute ``scripts\build_win.bat /e ..\ghi2exe`` + .. admonition:: py2exe will not work with eggs :class: toggle @@ -863,12 +868,15 @@ Read the rest if you need details about the way the script works. `_ to get any of the C extensions and will need a fresh virtual environment with no dependent packages installed as eggs. + The included ``build-win`` script uses the ``pip`` method. + .. admonition:: installing virtualenv and working with environments :class: toggle - Install virtualenv, create a virtual environment and activate it. With only - Python 2.7 on your system (where ```` is the path to where you - wish to keep the virtual environment) use:: + Install virtualenv, create a virtual environment and activate it. + + With only Python 2.7 on your system (where ```` is the + path to where you wish to keep the virtual environment) use:: pip install virtualenv virtualenv --system-site-packages @@ -895,18 +903,31 @@ Read the rest if you need details about the way the script works. python setup.py py2exe - The ``ghini-runtime`` folder will now contain a full working copy of the software in - a frozen, self contained state, that can be transferred however you like and - will work in place. (e.g. placed on a USB flash drive for demonstration - purposes or copied manually to ``C:\Program Files`` with a shortcut created - on the desktop). To start ghini.desktop double click ``ghini.exe`` in - explorer (or create a shortcut to it). If you have issues with the UI not - displaying correctly you need to run the script ``win_gtk.bat`` from the - ``ghini-runtime`` folder to set up paths to the GTK components correctly. (Running - ``build_win /e`` will place this script in the ``ghini-runtime`` folder for you or you - can copy it from the ``scripts`` folder yourself.) You will only need to - run this once each time the location of the folder changes. Thereafter - ``ghini.exe`` will run as expected. + The ``ghini-runtime`` folder will now contain a full working copy of the + software in a frozen, self contained state. + + This folder is what is packaged by NSIS. + + This same folder can also be transferred however you like and will work in + place. (e.g. placed on a USB flash drive for demonstration purposes or + copied manually to ``C:\Program Files`` with a shortcut created on the + desktop). To start ghini.desktop double click ``ghini.exe`` in explorer + (or create a shortcut to it). + + +.. admonition:: Fixing paths to GTK components. + :class: toggle + + If you run the relocatable compiled program, unpackaged, you might + occasionally have trouble with the GUI not displaying correctly. + + Should this happen, you need to set up paths to the GTK components + correctly. You can do this by running the ``win_gtk.bat``, from the + ``ghini-runtime`` folder. + + You will only need to run this once each time the location of the folder + changes. Thereafter ``ghini.exe`` will run as expected. + .. admonition:: Finally, invoke NSIS :class: toggle From 3378f5c0852923ab583390277f3402ff5c62b20e Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 17:03:08 -0500 Subject: [PATCH 18/42] include checkout name in default virtualenv name --- doc/building.rst | 30 ++++++++++++++++---------- scripts/build_win.bat | 49 ++++++++++++++++++++++-------------------- scripts/devinstall.bat | 8 +++---- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 1c99fdd7a..30869a579 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -788,21 +788,27 @@ The files and directories relevant to this section: Most steps are automated in the ``build-win.bat`` script. Installation of a few tools needs to be done manually: -#. Download and install Python 2.7 and PyGTK as outlined in the - ``devinstall``-based :ref:`installation` instructions. Git will not be - needed here, having it however will not do any harm. +#. Download and install Git, Python 2.7 and PyGTK. + + This is outlined in the ``devinstall``-based :ref:`installation` + instructions. #. Download and install `NSIS v3 `_. #. A **reboot** is recommended. -#. Fork the ghini.desktop project on GitHub, or use the organization's - repository ``https://github.com/Ghini/ghini.desktop.git``. Clone the - repository from GitHub to wherever you want to keep it (replace - ```` with the path of your choice, - e.g. ``Local\github\Ghini\``) and checkout a production branch (``ghini-1.0`` - is recommended as used in the example). To do this, open a command prompt - and type these commands:: +#. Clone the ghini.desktop repository. + + Use your own fork if you plan contributing patches, or the organization's + repository ``https://github.com/Ghini/ghini.desktop.git`` if you only wish to + follow development. + + Clone the repository from GitHub to wherever you want to keep it, and checkout + a branch. Replace ```` with the path of your choice, + e.g. ``Local\github\Ghini\``. Production branch ``ghini-1.0`` is recommended + as used in the example. + + To do this, open a command prompt and type these commands:: cd git clone @@ -837,7 +843,9 @@ Read the rest if you need details about the way the script works. #. ``venv_path`` — A path to the location for the virtual environment to use. - Defaults to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\ghi2exe`` + Defaults to ``"%HOMEDRIVE%%HOMEPATH%"\.virtualenvs\%CHECKOUT%-exe``, + where ``CHECKOUT`` corresponds to the name of the branch you checked + out. If you want to produce an executable only and use a virtual environment in a folder beside where you have ghini.desktop, you could diff --git a/scripts/build_win.bat b/scripts/build_win.bat index a4b71017b..c5c690ecb 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -1,4 +1,4 @@ -@echo off +@ECHO off SETLOCAL REM process command line arguments (/e produces exe only not installer, @@ -6,39 +6,42 @@ REM only other argument proccessed must be a pathname to a virtualenv) :Loop IF [%1]==[] GOTO Continue IF "%1"=="/e" ( - set EXEONLY=y + SET EXEONLY=y ) ELSE ( - set CUSTOMVENV="%~f1" + SET CUSTOMVENV="%~f1" ) SHIFT GOTO Loop :Continue -if defined EXEONLY ECHO build exe only -if defined CUSTOMVENV ( - echo using custom virtual environment %CUSTOMVENV% -) else ( - set CUSTOMVENV="%HOMEDRIVE%%HOMEPATH%\.virtualenvs\ghi2exe" +FOR /F %%i in ('git rev-parse --abbrev-ref HEAD') DO CHECKOUT=%%i + +IF defined EXEONLY ECHO build exe only + +IF defined CUSTOMVENV ( + ECHO using custom virtual environment %CUSTOMVENV% +) ELSE ( + SET CUSTOMVENV="%HOMEDRIVE%%HOMEPATH%\.virtualenvs\%CHECKOUT%-exe" ) IF NOT EXIST %CUSTOMVENV%\Scripts\activate.bat ( - ECHO creating build environment - REM STEP 1 - install virtualenv and create a virtual environment - C:\Python27\Scripts\pip install virtualenv - C:\Python27\Scripts\virtualenv --system-site-packages %CUSTOMVENV% + ECHO creating build environment + REM STEP 1 - install virtualenv and create a virtual environment + C:\Python27\Scripts\pip install virtualenv + C:\Python27\Scripts\virtualenv --system-site-packages %CUSTOMVENV% ) IF "%VIRTUAL_ENV%"=="" ( - ECHO Activating build environment - REM STEP 2 - activate the virtual environment - call %CUSTOMVENV%\Scripts\activate.bat -) else ( - ECHO Current virtual environment: "%VIRTUAL_ENV%" - IF NOT "%VIRTUAL_ENV%"==%CUSTOMVENV% ( - ECHO deactivating current virtual environment and activating build environment - call deactivate + ECHO Activating build environment + REM STEP 2 - activate the virtual environment call %CUSTOMVENV%\Scripts\activate.bat - ) +) ELSE ( + ECHO Current virtual environment: "%VIRTUAL_ENV%" + IF NOT "%VIRTUAL_ENV%"==%CUSTOMVENV% ( + ECHO deactivating current virtual environment and activating build environment + call deactivate + call %CUSTOMVENV%\Scripts\activate.bat + ) ) @@ -53,7 +56,7 @@ ECHO cleaning up REM STEP 4 - clean up any previous builds del /f /s /q ghini-runtime 1>nul forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ - "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL + "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL ECHO installing without eggs REM STEP 5 - install ghini.desktop and its dependencies into the virtual environment @@ -64,7 +67,7 @@ REM STEP 6 - build the executable python setup.py py2exe REM executable only? -if defined EXEONLY GOTO Skip_NSIS +IF defined EXEONLY GOTO Skip_NSIS ECHO building NSIS installer REM STEP 7 - build the installer diff --git a/scripts/devinstall.bat b/scripts/devinstall.bat index 9525973ce..42b5283ea 100644 --- a/scripts/devinstall.bat +++ b/scripts/devinstall.bat @@ -5,19 +5,19 @@ SET SHOULD_CANCEL=0 python -c "1" 2>NUL IF %ERRORLEVEL% NEQ 0 ( - ECHO Python not properly installed + ECHO "Python not properly installed" SET SHOULD_CANCEL=1 - goto SKIP_GTK_TEST + GOTO SKIP_GTK_TEST ) python -c "import gtk" 2>NUL IF %ERRORLEVEL% NEQ 0 ( - ECHO PyGtk not properly installed + ECHO "PyGtk not properly installed" SET SHOULD_CANCEL=1 ) :SKIP_GTK_TEST git --version 2>NUL >NUL IF %ERRORLEVEL% NEQ 0 ( - ECHO git not properly installed + ECHO "git not properly installed" SET SHOULD_CANCEL=1 ) From 4873be2c77585ce32be0d27bdc71581430a8ea99 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 17:06:41 -0500 Subject: [PATCH 19/42] dist might not exist any more, create and ignore if it did exist --- scripts/build_win.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index c5c690ecb..b43e616c0 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -55,6 +55,7 @@ pip install Pygments ECHO cleaning up REM STEP 4 - clean up any previous builds del /f /s /q ghini-runtime 1>nul +mkdir dist 2>nul forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL From 77896db19b65061c42f029fc91b7e56e8f4bc579 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 17:08:16 -0500 Subject: [PATCH 20/42] forgot the existence of the SET command --- scripts/build_win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index b43e616c0..6c8d1491a 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -14,7 +14,7 @@ SHIFT GOTO Loop :Continue -FOR /F %%i in ('git rev-parse --abbrev-ref HEAD') DO CHECKOUT=%%i +FOR /F %%i in ('git rev-parse --abbrev-ref HEAD') DO SET CHECKOUT=%%i IF defined EXEONLY ECHO build exe only From 6d2227478fb9ae32cab6c3f2065c197a1a065e7a Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 19:46:50 -0500 Subject: [PATCH 21/42] there is no "default" report generator engine --- doc/installing.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/installing.rst b/doc/installing.rst index de9a7722b..561f11866 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -350,11 +350,14 @@ The installation steps on Windows: How to save a batch file, and how to run it: check the the quite detailed instructions given for ``devinstall.bat``. -If you would like to generate and print PDF reports using Ghini's default -report generator then you will need to download and install `Apache FOP +If you need to generate PDF reports, you can use the XLS based report +generator and you will need to download and install `Apache FOP `_. After extracting the FOP archive you will need to include the directory you extracted to in your PATH. +If you choose for PostScript reports, you can use the Mako based report +generator and there are no further dependencies. + .. rubric:: Next... :ref:`connecting`. From e3b3e606e2f0d210b4b544b5320b1ed94f9afc00 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Fri, 1 Jun 2018 23:02:00 -0500 Subject: [PATCH 22/42] correcting linking syntax --- doc/building.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 30869a579..9b03aa902 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -989,21 +989,20 @@ Debian Some time in the past someone published a version of Bauble for Debian, and for Ubuntu. This was at the time of Bauble 0.9.7, and that version is -[still being distributed](https://packages.ubuntu.com/xenial/bauble), +`still being distributed` `_, regardless being it impossible to install. It's since 2007 that we've made the people on Ubuntu and Debian aware of the problem. Only recently has Mario Frasca produced a new bauble debian package, for the latest bauble.classic version 1.0.56, and proposed for inclusion in Debian. -View it on [mentors](https://mentors.debian.net/package/bauble). This +View it on `mentors` `_. This version depends on ``fibra``, a package that was never added to Debian and -which Mario also has packaged and [proposed for inclusion in -Debian](https://mentors.debian.net/package/fibra). Now we're waiting for a +which Mario also has packaged and `proposed for inclusion in +Debian `_. Now we're waiting for a sponsor, and hoping the package will eventually get all the way to Ubuntu. -Once we get in contact with a [Debian -Sponsor](https://mentors.debian.net/sponsors) who will review what we -publish on [mentors](https://mentors.debian.net/intro-maintainers), then we +Once we get in contact with a `Debian Sponsor `_ who will review what we +publish on `mentors `_, then we will be definitely expected to keep updating the debian package for ``ghini.desktop`` and ``fibra``. From 0c058bde850d4f510cc6dfd9ea06ee8d660c05e4 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Sat, 2 Jun 2018 10:18:00 -0500 Subject: [PATCH 23/42] correct link syntax --- doc/building.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 9b03aa902..7f1e88288 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -989,13 +989,13 @@ Debian Some time in the past someone published a version of Bauble for Debian, and for Ubuntu. This was at the time of Bauble 0.9.7, and that version is -`still being distributed` `_, +`still being distributed `_, regardless being it impossible to install. It's since 2007 that we've made the people on Ubuntu and Debian aware of the problem. Only recently has Mario Frasca produced a new bauble debian package, for the latest bauble.classic version 1.0.56, and proposed for inclusion in Debian. -View it on `mentors` `_. This +View it on `mentors `_. This version depends on ``fibra``, a package that was never added to Debian and which Mario also has packaged and `proposed for inclusion in Debian `_. Now we're waiting for a From e5bb3124495f3d10c9220f7eea2667509b958f20 Mon Sep 17 00:00:00 2001 From: Mario Frasca Date: Sat, 2 Jun 2018 12:01:54 -0500 Subject: [PATCH 24/42] Update building.rst --- doc/building.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 7f1e88288..8f5b1aa13 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -987,19 +987,21 @@ Read the rest if you need details about the way the script works. Debian ^^^^^^^^^^^^^^^ -Some time in the past someone published a version of Bauble for Debian, and -for Ubuntu. This was at the time of Bauble 0.9.7, and that version is +Between 2009 and 2010 someone packaged the then already obsolete +Bauble 0.9.7 for Debian, and the package was included +in Ubuntu. That version is `still being distributed `_, -regardless being it impossible to install. It's since 2007 that we've made -the people on Ubuntu and Debian aware of the problem. +regardless being it impossible to install. Only recently has Mario Frasca produced a new bauble debian package, for the latest bauble.classic version 1.0.56, and proposed for inclusion in Debian. View it on `mentors `_. This version depends on ``fibra``, a package that was never added to Debian and -which Mario also has packaged and `proposed for inclusion in -Debian `_. Now we're waiting for a -sponsor, and hoping the package will eventually get all the way to Ubuntu. +which Mario also has packaged and `proposed for inclusion in Debian +`_. Mario has been trying to +activate some Debian Developer, to take action. There's not much more we can +do, other than wait for a sponsor, and hoping the package will eventually get +all the way to Ubuntu. Once we get in contact with a `Debian Sponsor `_ who will review what we publish on `mentors `_, then we From 167167b3851def9079471a90825eb82b2a5fc955 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 09:04:15 -0500 Subject: [PATCH 25/42] create a local appdata dir; if present, we are on a stick. --- bauble/paths.py | 16 +++++++++++++++- scripts/build_win.bat | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bauble/paths.py b/bauble/paths.py index 2cb9601ac..dadd6619e 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -116,7 +116,9 @@ def appdata_dir(): """ if sys.platform == "win32": - if 'APPDATA' in os.environ: + if is_portable_installation(): + pass + elif 'APPDATA' in os.environ: d = os.path.join(os.environ["APPDATA"], "Bauble") elif 'USERPROFILE' in os.environ: d = os.path.join(os.environ['USERPROFILE'], 'Application Data', @@ -139,3 +141,15 @@ def appdata_dir(): raise Exception('Could not get path for user settings: ' 'unsupported platform') return os.path.abspath(d) + + +def is_portable_installation(): + '''tell whether ghini is running on a USB stick + + only relevant on Windows + ''' + + print("main_dir: %s; installation_dir %s; data_dir: %s; user_dir : %s; locale_dir : %s; lib_dir: %s" % ( + main_dir(), installation_dir(), data_dir(), user_dir (), locale_dir(), lib_dir())) + + return False diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 6c8d1491a..5f9626767 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -77,5 +77,6 @@ python setup.py nsis :Skip_NSIS copy scripts\win_gtk.bat ghini-runtime +mkdir ghini-runtime\ghini.dat ENDLOCAL From 39e58f599ec2c2c12d21d95d9a01c4e0b29d82ab Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 09:13:36 -0500 Subject: [PATCH 26/42] correct typo --- bauble/paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bauble/paths.py b/bauble/paths.py index dadd6619e..089f4de3a 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -149,7 +149,7 @@ def is_portable_installation(): only relevant on Windows ''' - print("main_dir: %s; installation_dir %s; data_dir: %s; user_dir : %s; locale_dir : %s; lib_dir: %s" % ( - main_dir(), installation_dir(), data_dir(), user_dir (), locale_dir(), lib_dir())) + print("main_dir: %s; installation_dir %s; appdata_dir: %s; user_dir: %s; locale_dir: %s; lib_dir: %s" % ( + main_dir(), installation_dir(), appdata_dir(), user_dir (), locale_dir(), lib_dir())) return False From 1b89cff77ff211acf6df475d7c98e5ac073e7492 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 09:22:34 -0500 Subject: [PATCH 27/42] (fix silly mistakes: working in noisy enviroment) --- bauble/paths.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bauble/paths.py b/bauble/paths.py index 089f4de3a..5e322bd41 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -116,7 +116,7 @@ def appdata_dir(): """ if sys.platform == "win32": - if is_portable_installation(): + if is_portable_installation(None): pass elif 'APPDATA' in os.environ: d = os.path.join(os.environ["APPDATA"], "Bauble") @@ -140,16 +140,17 @@ def appdata_dir(): else: raise Exception('Could not get path for user settings: ' 'unsupported platform') + is_portable_installation(d) return os.path.abspath(d) -def is_portable_installation(): +def is_portable_installation(appdata_dir): '''tell whether ghini is running on a USB stick only relevant on Windows ''' print("main_dir: %s; installation_dir %s; appdata_dir: %s; user_dir: %s; locale_dir: %s; lib_dir: %s" % ( - main_dir(), installation_dir(), appdata_dir(), user_dir (), locale_dir(), lib_dir())) + main_dir(), installation_dir(), appdata_dir, user_dir (), locale_dir(), lib_dir())) return False From a59f0baaea56ca1f635b724ca4dfa8d1d978c43c Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 09:27:45 -0500 Subject: [PATCH 28/42] temporary edits --- bauble/paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bauble/paths.py b/bauble/paths.py index 5e322bd41..ac3eace8a 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -150,7 +150,7 @@ def is_portable_installation(appdata_dir): only relevant on Windows ''' - print("main_dir: %s; installation_dir %s; appdata_dir: %s; user_dir: %s; locale_dir: %s; lib_dir: %s" % ( - main_dir(), installation_dir(), appdata_dir, user_dir (), locale_dir(), lib_dir())) + print("main_dir: %s; installation_dir %s; appdata_dir: %s; locale_dir: %s; lib_dir: %s" % ( + main_dir(), installation_dir(), appdata_dir, locale_dir(), lib_dir())) return False From 385c59fb13a171e5d4fc1fe5d04b4cfe2b2e36cc Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 10:50:56 -0500 Subject: [PATCH 29/42] recognize portable appdata --- bauble/paths.py | 27 ++++++++++++++++++--------- scripts/build_win.bat | 5 +++-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/bauble/paths.py b/bauble/paths.py index ac3eace8a..424d2c98b 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2005,2006,2007,2008,2009 Brett Adams -# Copyright (c) 2012-2016 Mario Frasca +# Copyright (c) 2012-2016,2018 Mario Frasca # Copyright (c) 2016 Ross Demuth # # This file is part of ghini.desktop. @@ -26,6 +26,8 @@ """ import os import sys +import logging +logger = logging.getLogger(__name__) def main_is_frozen(): @@ -116,8 +118,8 @@ def appdata_dir(): """ if sys.platform == "win32": - if is_portable_installation(None): - pass + if is_portable_installation(): + d = os.path.join(installation_dir(), 'appdata.dir') elif 'APPDATA' in os.environ: d = os.path.join(os.environ["APPDATA"], "Bauble") elif 'USERPROFILE' in os.environ: @@ -140,17 +142,24 @@ def appdata_dir(): else: raise Exception('Could not get path for user settings: ' 'unsupported platform') - is_portable_installation(d) return os.path.abspath(d) -def is_portable_installation(appdata_dir): +def is_portable_installation(): '''tell whether ghini is running on a USB stick only relevant on Windows + + if the installation_dir contains a writable appdata.dir, then we are + running on a USB stick, and we are keeping appdata there. + ''' - - print("main_dir: %s; installation_dir %s; appdata_dir: %s; locale_dir: %s; lib_dir: %s" % ( - main_dir(), installation_dir(), appdata_dir, locale_dir(), lib_dir())) - return False + try: + test_file_name = os.path.join(installation_dir(), 'appdata.dir', 'temp.tmp') + with open(test_file_name, "w") as f: + f.write("test") + os.unlink(test_file_name) + return True + except: + return False diff --git a/scripts/build_win.bat b/scripts/build_win.bat index 5f9626767..aab303718 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -54,7 +54,8 @@ pip install Pygments ECHO cleaning up REM STEP 4 - clean up any previous builds -del /f /s /q ghini-runtime 1>nul +rmdir /s /q ghini-runtime 1>nul 2>nul +mkdir ghini-runtime 1>nul 2>nul mkdir dist 2>nul forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL @@ -77,6 +78,6 @@ python setup.py nsis :Skip_NSIS copy scripts\win_gtk.bat ghini-runtime -mkdir ghini-runtime\ghini.dat +mkdir ghini-runtime\appdata.dir ENDLOCAL From d02d97627fdd72ee8d34cfcc176ae859df56e45a Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 11:12:50 -0500 Subject: [PATCH 30/42] recognize portable appdata --- bauble/paths.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bauble/paths.py b/bauble/paths.py index 424d2c98b..f1b81c7e4 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -119,7 +119,7 @@ def appdata_dir(): """ if sys.platform == "win32": if is_portable_installation(): - d = os.path.join(installation_dir(), 'appdata.dir') + d = os.path.join(installation_dir(), 'Appdata') elif 'APPDATA' in os.environ: d = os.path.join(os.environ["APPDATA"], "Bauble") elif 'USERPROFILE' in os.environ: @@ -156,10 +156,10 @@ def is_portable_installation(): ''' try: - test_file_name = os.path.join(installation_dir(), 'appdata.dir', 'temp.tmp') - with open(test_file_name, "w") as f: + test_file_name = os.path.join(installation_dir(), 'Appdata', 'temp.tmp') + with open(test_file_name, "w+") as f: f.write("test") - os.unlink(test_file_name) + os.remove(test_file_name) return True except: return False From de2ffa3b1f75d2330aeee91fdcfaf6a019e32a4b Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 11:19:48 -0500 Subject: [PATCH 31/42] I keep breaking things on Windows, such a waste of time... --- scripts/build_win.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index aab303718..f9a29ac72 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -54,8 +54,8 @@ pip install Pygments ECHO cleaning up REM STEP 4 - clean up any previous builds -rmdir /s /q ghini-runtime 1>nul 2>nul -mkdir ghini-runtime 1>nul 2>nul +rmdir /s /q ghini-runtime +mkdir ghini-runtime mkdir dist 2>nul forfiles /P "%VIRTUAL_ENV%"\Lib\site-packages\ /M ghini.desktop-*.egg-info /C^ "cmd /c if @ISDIR==TRUE rmdir /s /q @PATH && echo removing @PATH" 2>NUL @@ -78,6 +78,6 @@ python setup.py nsis :Skip_NSIS copy scripts\win_gtk.bat ghini-runtime -mkdir ghini-runtime\appdata.dir +mkdir ghini-runtime\Appdata ENDLOCAL From 20eb8b6d5c53f9ebb58c3a8d6ccb8297222a7b6b Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 11:32:50 -0500 Subject: [PATCH 32/42] please don't duplicate code: import them. --- bauble/__init__.py | 16 +++------------- bauble/connmgr.py | 2 +- bauble/paths.py | 12 ++++++------ bauble/pluginmgr.py | 3 +-- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/bauble/__init__.py b/bauble/__init__.py index e251c7e9c..93f9afc38 100755 --- a/bauble/__init__.py +++ b/bauble/__init__.py @@ -69,17 +69,7 @@ def pb_release(): gui.progressbar.hide() gui.set_busy(False) -def main_is_frozen(): - """ - Return True if we are running in a py2exe environment, else - return False - """ - return (hasattr(sys, "frozen") or # new py2exe - hasattr(sys, "importers") or # old py2exe - imp.is_frozen("__main__")) # tools/freeze - - -if main_is_frozen(): # main is frozen +if paths.main_is_frozen(): # main is frozen # put library.zip first in the path when using py2exe so libxml2 # gets imported correctly, zipfile = sys.path[-1] @@ -240,7 +230,7 @@ def main(uri=None): # a hack to write stderr and stdout to a file in a py2exe environment # prevents failed attempts at creating ghini.exe.log - if main_is_frozen(): + if paths.main_is_frozen(): _stdout = os.path.join(paths.user_dir(), 'stdout.log') _stderr = os.path.join(paths.user_dir(), 'stderr.log') sys.stdout = open(_stdout, 'w') @@ -288,7 +278,7 @@ def main(uri=None): import gtk.gdk import pygtk - if not main_is_frozen(): + if not paths.main_is_frozen(): pygtk.require("2.0") display = gtk.gdk.display_get_default() diff --git a/bauble/connmgr.py b/bauble/connmgr.py index 832e959bd..046bd9e1b 100755 --- a/bauble/connmgr.py +++ b/bauble/connmgr.py @@ -265,7 +265,7 @@ def __init__(self, view=None): except: pass - from bauble import main_is_frozen + from bauble.paths import main_is_frozen # Don't check for new versions if we are in a py2exe environment if not main_is_frozen(): from threading import Thread diff --git a/bauble/paths.py b/bauble/paths.py index f1b81c7e4..b07fe2157 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -31,10 +31,8 @@ def main_is_frozen(): - """ - Returns True/False if Ghini is being run from a py2exe - executable. This method duplicates bauble.main_is_frozen in order - to make paths.py not depend on any other Bauble modules. + """tell whether Ghini is being run from a py2exe executable. + """ import imp return (hasattr(sys, "frozen") or # new py2exe @@ -119,7 +117,7 @@ def appdata_dir(): """ if sys.platform == "win32": if is_portable_installation(): - d = os.path.join(installation_dir(), 'Appdata') + d = os.path.join(main_dir(), 'Appdata') elif 'APPDATA' in os.environ: d = os.path.join(os.environ["APPDATA"], "Bauble") elif 'USERPROFILE' in os.environ: @@ -155,8 +153,10 @@ def is_portable_installation(): ''' + if not main_is_frozen(): + return False try: - test_file_name = os.path.join(installation_dir(), 'Appdata', 'temp.tmp') + test_file_name = os.path.join(main_dir(), 'Appdata', 'temp.tmp') with open(test_file_name, "w+") as f: f.write("test") os.remove(test_file_name) diff --git a/bauble/pluginmgr.py b/bauble/pluginmgr.py index 88ea9680f..1297bce37 100755 --- a/bauble/pluginmgr.py +++ b/bauble/pluginmgr.py @@ -120,8 +120,7 @@ def load(path=None): """ if path is None: - if bauble.main_is_frozen(): - #path = os.path.join(paths.lib_dir(), 'library.zip') + if paths.main_is_frozen(): path = os.path.join(paths.main_dir(), 'library.zip') else: path = os.path.join(paths.lib_dir(), 'plugins') From 18737d945d71ac966bd8e218957c0db8bcb557a9 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 13:51:24 -0500 Subject: [PATCH 33/42] if dir is not there, you can't delete it. --- setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index c7f4ecfef..d88793e7c 100755 --- a/setup.py +++ b/setup.py @@ -147,9 +147,12 @@ def run(self): gtk_root = 'c:\\python27\\lib\\site-packages\\gtk-2.0\\runtime' dist_gtk = os.path.join(self.dist_dir, 'gtk') import shutil - shutil.rmtree(dist_gtk) # overkill cleaning up - # ghini-runtime gets reconstructed from scratch each time, so - # there's no conditional copying + try: + shutil.rmtree(dist_gtk) # overkill cleaning up + except OSError: + pass # do not complain if it isn't there + # we are now totally sure there isn't anything there, so we can + # count on unconditional copying ignore = shutil.ignore_patterns('src', 'gtk-doc', 'icons', 'man', 'demo', 'aclocal', 'doc', 'include', 'emacs', From 882534ab426e430c77272998e01b6831922726c7 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 13:52:11 -0500 Subject: [PATCH 34/42] if dir is not there, you can't delete it. --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index d88793e7c..afbc4eb16 100755 --- a/setup.py +++ b/setup.py @@ -147,10 +147,7 @@ def run(self): gtk_root = 'c:\\python27\\lib\\site-packages\\gtk-2.0\\runtime' dist_gtk = os.path.join(self.dist_dir, 'gtk') import shutil - try: - shutil.rmtree(dist_gtk) # overkill cleaning up - except OSError: - pass # do not complain if it isn't there + shutil.rmtree(dist_gtk, ignore_errors=True) # overkill cleaning up # we are now totally sure there isn't anything there, so we can # count on unconditional copying ignore = shutil.ignore_patterns('src', 'gtk-doc', 'icons', From 11381326f6e3656d16933099831ee28fc20bb7ad Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 14:59:05 -0500 Subject: [PATCH 35/42] do not store the leading appdatadir in config - #62 --- bauble/connmgr.py | 35 ++++++++++++++++++++++++++--------- bauble/paths.py | 2 ++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/bauble/connmgr.py b/bauble/connmgr.py index 046bd9e1b..05aae7cff 100755 --- a/bauble/connmgr.py +++ b/bauble/connmgr.py @@ -201,6 +201,12 @@ def show_message_box(): % type(e), e) +def make_absolute(path): + if path.startswith('./') or path.startswith('.\\'): + path = os.path.join(paths.appdata_dir(), path[2:]) + return path + + class ConnMgrPresenter(GenericEditorPresenter): """ The main class that starts the connection manager GUI. @@ -283,6 +289,7 @@ def on_file_btnbrowse_clicked(self, *args): buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL), last_folder=last_folder, target='file_entry') + self.replace_leading_appdata('file_entry') def on_pictureroot_btnbrowse_clicked(self, *args): previously = self.view.widget_get_value('pictureroot_entry') @@ -293,6 +300,7 @@ def on_pictureroot_btnbrowse_clicked(self, *args): buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL), last_folder=last_folder, target='pictureroot_entry') + self.replace_leading_appdata('pictureroot_entry') def on_pictureroot2_btnbrowse_clicked(self, *args): previously = self.view.widget_get_value('pictureroot2_entry') @@ -303,6 +311,13 @@ def on_pictureroot2_btnbrowse_clicked(self, *args): buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL), last_folder=last_folder, target='pictureroot2_entry') + self.replace_leading_appdata('pictureroot2_entry') + + def replace_leading_appdata(self, entry): + value = self.view.widget_get_value(entry) + if value.startswith(paths.appdata_dir()): + value = os.path.join('.', value[len(paths.appdata_dir()) + 1:]) + self.view.widget_set_value(entry, value) def refresh_view(self): GenericEditorPresenter.refresh_view(self) @@ -345,8 +360,8 @@ def on_dialog_response(self, dialog, response, data=None): if not valid: self.view.run_message_dialog(msg, gtk.MESSAGE_ERROR) if valid: - ## picture root is also made available in global setting - prefs.prefs[prefs.picture_root_pref] = settings['pictures'] + # ghini grabs pictures location from global setting + prefs.prefs[prefs.picture_root_pref] = make_absolute(settings['pictures']) self.save_current_to_prefs() elif response == gtk.RESPONSE_CANCEL or \ response == gtk.RESPONSE_DELETE_EVENT: @@ -486,6 +501,10 @@ def on_name_combo_changed(self, combo, data=None): self.refresh_view() self.prev_connection_name = self.connection_name + self.replace_leading_appdata('file_entry') + self.replace_leading_appdata('pictureroot_entry') + self.replace_leading_appdata('pictureroot2_entry') + def get_passwd(self, title=_("Enter your password"), before_main=False): """ Show a dialog with and entry and return the value entered. @@ -507,7 +526,7 @@ def parameters_to_uri(self, params): import copy subs = copy.copy(params) if params['type'].lower() == "sqlite": - filename = params['file'].replace('\\', '/') + filename = make_absolute(params['file'].replace('\\', '/')) uri = "sqlite:///" + filename return uri subs['type'] = params['type'].lower() @@ -545,7 +564,7 @@ def check_parameters_valid(self, params): msg = None ## first check connection parameters, then pictures path if params['type'] == 'SQLite': - filename = params['file'] + filename = make_absolute(params['file']) if not os.path.exists(filename): path, f = os.path.split(filename) if not os.access(path, os.R_OK): @@ -583,7 +602,7 @@ def check_parameters_valid(self, params): return valid, msg ## now check the params['pictures'] # if it's a file, things are not OK - root = params['pictures'] + root = make_absolute(params['pictures']) thumbs = os.path.join(root, 'thumbs') # root should exist as a directory if os.path.exists(root): @@ -608,10 +627,8 @@ def get_params(self, new=None): if self.dbtype == 'SQLite': if self.use_defaults is True: name = new or self.connection_name - self.filename = os.path.join( - paths.appdata_dir(), name + '.db') - self.pictureroot = os.path.join( - paths.appdata_dir(), name) + self.filename = os.path.join('.', name + '.db') + self.pictureroot = os.path.join('.', name) result = {'file': self.filename, 'default': self.use_defaults, 'pictures': self.pictureroot} diff --git a/bauble/paths.py b/bauble/paths.py index b07fe2157..3aed231f2 100755 --- a/bauble/paths.py +++ b/bauble/paths.py @@ -153,6 +153,8 @@ def is_portable_installation(): ''' + if sys.platform != "win32": + return False if not main_is_frozen(): return False try: From 0946735298acae462d3be16899fa4d6aaad5afa7 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 15:23:08 -0500 Subject: [PATCH 36/42] do not store the leading appdatadir in config - #62 --- bauble/connmgr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bauble/connmgr.py b/bauble/connmgr.py index 05aae7cff..95ac7c0a4 100755 --- a/bauble/connmgr.py +++ b/bauble/connmgr.py @@ -314,9 +314,10 @@ def on_pictureroot2_btnbrowse_clicked(self, *args): self.replace_leading_appdata('pictureroot2_entry') def replace_leading_appdata(self, entry): - value = self.view.widget_get_value(entry) - if value.startswith(paths.appdata_dir()): + value = self.view.widget_get_value(entry).replace('\\', '/') + if value.startswith(paths.appdata_dir().replace('\\', '/')): value = os.path.join('.', value[len(paths.appdata_dir()) + 1:]) + value = os.path.join(*value.split('/')) self.view.widget_set_value(entry, value) def refresh_view(self): From 78220430fba8f716b1491bb96c5c21e379d31b26 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Mon, 4 Jun 2018 16:37:54 -0500 Subject: [PATCH 37/42] reviewing, updating. related to translations. --- doc/building.rst | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/doc/building.rst b/doc/building.rst index 8f5b1aa13..f3e6a7242 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -185,31 +185,35 @@ this require manual steps? The aswer is that the whole interaction is quite complex, and it depends on the component. -When it comes to ``ghini.desktop``, when you do a global installation, you -don't know which language your users will set up their environment, and a -user can change the language configuration any time. So what we do is to -install the software in English together with a translation table from -English to whatever else, in particular Italian or Hungarian. Then the GUI -libraries (Android or GTK) know where to look for the translation strings. -These translation tables are generated during the installation or upgrade -process, based on the strings you see on Weblate. - -Before any of the above gets activated, the path followed by your -translations is as you describe: Weblate pushes the strings to github, -directly into the development line `ghini-1.0-dev`; I see them, if I -understand at least the structure of that language I review them, maybe I -look them up in wikipedia or get them translated back to Italian, Spanish or -English by some automatic translation service; sometimes I need to solve -conflicts arising because of changed context, not too often fortunately; -from time to time I publish the development line `ghini-1.0-dev` to the -production line `ghini-1.0`, and this is the moment when the new +When you install ``ghini.desktop`` or one of the Android apps, the +installation doesn't assume a specific run-time language: a user can change +their language configuration any time. So what we do is to install the +software in English together with a translation table from English to +whatever else. + +At run-time the GUI libraries (Android or GTK) know where to look for the +translation strings. These translation tables are generated during the +installation or upgrade process, based on the strings you see on Weblate. + +The path followed by translations is: You edit strings on Weblate, Weblate +keeps accumulating them until you are done, or you don't interact with +Weblate for a longer while; Weblate pushes the strings to github, directly +into the development line ``ghini-1.0-dev``; I see them and I might blindly +trust or prefer to review them, maybe I look them up in wikipedia or get +them translated back to Italian, Spanish or English by some automatic +translation service; sometimes I need to solve conflicts arising because of +changed context, not too often fortunately. As said, this lands in the +development line ``ghini-1.0-dev``, which I regularly publish to the +production line ``ghini-1.0``, and this is the moment when the new translations finally make it to the distributed software. -users will notice a `new version available` warning and can decide to ignore +Users will notice a *new version available* warning and can decide to ignore it, or to update. -For ``ghini.pocket``, there is no notification to end users, since we're not -yet using the google app store. +For ``ghini.pocket``, it is similar, but the notification is handled by the +Android system. We publish on the Play Store, and depending on your +settings, your phone will update the software automatically, or only notify +you, or do nothing. It depends on how you configured automatic updates. For ``ghini.web``, we haven't yet defined how to distribute it. From 06f61ae2374c666f93af39e676f60a03e3f2e32f Mon Sep 17 00:00:00 2001 From: Jaap Uilhoorn Date: Mon, 4 Jun 2018 15:36:36 +0000 Subject: [PATCH 38/42] Translated using Weblate (Dutch) Currently translated at 59.7% (478 of 800 strings) Translation: Ghini/Desktop 1.0 Translate-URL: https://hosted.weblate.org/projects/ghini/desktop-10/nl/ --- po/nl.po | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/po/nl.po b/po/nl.po index 6a86c8c1b..fef5f7f48 100644 --- a/po/nl.po +++ b/po/nl.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: bauble\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-14 08:29-0500\n" -"PO-Revision-Date: 2017-11-14 13:26+0000\n" -"Last-Translator: Allan Nordhøy \n" +"PO-Revision-Date: 2018-06-05 16:36+0000\n" +"Last-Translator: Jaap Uilhoorn \n" "Language-Team: Dutch \n" "Language: nl\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.18-dev\n" +"X-Generator: Weblate 3.0\n" "X-Launchpad-Export-Date: 2012-09-18 05:13+0000\n" #: bauble/btypes.py:87 @@ -119,7 +119,7 @@ msgstr ":" #: bauble/plugins/plants/infoboxes.glade:334 #: bauble/plugins/plants/infoboxes.glade:670 msgid "# of Accessions:" -msgstr "# van de Acquisities:" +msgstr "# van de Accessies:" #: bauble/plugins/plants/infoboxes.glade:87 msgid "# of Genera:" @@ -142,15 +142,15 @@ msgstr "# van Taxa:" #: bauble/plugins/garden/plant_infobox.glade:147 msgid "Accession Status:" -msgstr "Acquisitie Status:" +msgstr "Accessie Status:" #: bauble/plugins/garden/plant_infobox.glade:133 msgid "Accession Type:" -msgstr "Acquisitie Type:" +msgstr "Accessie Type:" #: bauble/plugins/plants/infoboxes.glade:971 msgid "Accessions:" -msgstr "Acquisities:" +msgstr "Accessies:" #: bauble/plugins/plants/infoboxes.glade:698 msgid "Awards:" @@ -186,11 +186,11 @@ msgstr "Beschrijving:" #: bauble/plugins/plants/infoboxes.glade:788 msgid "Distribution for label:" -msgstr "Distributie voor label:" +msgstr "Verspreidingsgebied voor label:" #: bauble/plugins/plants/infoboxes.glade:754 msgid "Distribution:" -msgstr "Distributie:" +msgstr "Verspreidingsgebied:" #: bauble/plugins/plants/infoboxes.glade:928 msgid "Families:" @@ -464,7 +464,7 @@ msgstr "Accessieeditor" #: bauble/plugins/garden/acc_editor.glade:522 msgid "Accession ID" -msgstr "Acquisitie ID" +msgstr "Accessie ID" #: bauble/plugins/garden/accession.py:370 msgid "Accession not of wild source" @@ -489,7 +489,7 @@ msgstr "Toevoegen" #: bauble/plugins/plants/species_editor.glade:53 msgid "Add Accessions" -msgstr "Voeg Acquisities toe" +msgstr "Voeg Accessies toe" #: bauble/plugins/plants/family_editor.glade:300 msgid "Add Genera" @@ -1708,7 +1708,7 @@ msgstr "JSON" #: bauble/plugins/plants/species_editor.glade:707 msgid "Label distribution" -msgstr "Label distributie" +msgstr "Label verspreidingsgebied" #: bauble/view.py:185 msgid "Last updated:" @@ -3247,7 +3247,7 @@ msgstr "" #: bauble/plugins/plants/species.py:185 #: bauble/plugins/plants/species_editor.py:1089 msgid "Vernacular names" -msgstr "" +msgstr "Volksnamen" #: bauble/bauble.glade:515 msgid "Version" From bd6a9a894b9e7ac1e3fcb9f3358f4dc9d3c8a15b Mon Sep 17 00:00:00 2001 From: mfrasca Date: Tue, 5 Jun 2018 15:05:59 -0500 Subject: [PATCH 39/42] from 3.1 --- bauble/search.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bauble/search.py b/bauble/search.py index 7cbd247da..b27433853 100644 --- a/bauble/search.py +++ b/bauble/search.py @@ -1012,10 +1012,10 @@ def on_select(self, menuitem, prop): submenu = menuitem.get_submenu() if len(submenu.get_children()) == 0: - map(submenu.append, self._get_prop_menuitems(prop.mapper)) + map(submenu.append, self._get_prop_menuitems(prop.mapper, prop)) submenu.show_all() - def _get_prop_menuitems(self, mapper): + def _get_prop_menuitems(self, mapper, container=None): # When looping over iterate_properties leave out properties that # start with underscore since they are considered private. Separate # properties in column_properties and relation_properties @@ -1046,7 +1046,8 @@ def _get_prop_menuitems(self, mapper): item.set_submenu(submenu) item.connect('select', self.on_select, prop) items.append(item) - return items + + return sorted(items, key=lambda x: (x.name != 'id', x.name)) def parse_typed_value(value): From 67a7a137569d0bf7c020d3d5260b8cb77a9ec50e Mon Sep 17 00:00:00 2001 From: mfrasca Date: Tue, 5 Jun 2018 15:12:06 -0500 Subject: [PATCH 40/42] nicer sorting keys: first 'id', then all other '_id', then the rest. --- bauble/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bauble/search.py b/bauble/search.py index b27433853..add7b57e1 100644 --- a/bauble/search.py +++ b/bauble/search.py @@ -1024,7 +1024,7 @@ def _get_prop_menuitems(self, mapper, container=None): filter(lambda x: isinstance(x, ColumnProperty) and not x.key.startswith('_'), mapper.iterate_properties), - key=lambda k: k.key) + key=lambda k: (k.key!='id', not k.key.endswith('_id'), k.key)) relation_properties = sorted( filter(lambda x: isinstance(x, RelationProperty) and not x.key.startswith('_'), @@ -1047,7 +1047,7 @@ def _get_prop_menuitems(self, mapper, container=None): item.connect('select', self.on_select, prop) items.append(item) - return sorted(items, key=lambda x: (x.name != 'id', x.name)) + return items def parse_typed_value(value): From d2e76330ea0b89834b483276db46e3c75c2b5ad8 Mon Sep 17 00:00:00 2001 From: mfrasca Date: Tue, 5 Jun 2018 19:34:40 -0500 Subject: [PATCH 41/42] removing duplicates, travis now complains about them, even if commented. --- po/nl.po | 104 ------------------------------------------------------- 1 file changed, 104 deletions(-) diff --git a/po/nl.po b/po/nl.po index fa41fbb10..e8882669b 100644 --- a/po/nl.po +++ b/po/nl.po @@ -3910,107 +3910,3 @@ msgstr "" #: bauble/plugins/garden/propagation.py:299 msgid "°F" msgstr "" - -#~ msgid "" -#~ "%(num_plants)s plants depend on this accession: %(plant_codes)s\n" -#~ "\n" -#~ "Are you sure you want to remove accession %(acc_code)s?" -#~ msgstr "" -#~ "%(num_plants)s planten hangen van deze accessie af: %(plant_codes)s\n" -#~ "\n" -#~ "Wilt u echt deze accessie verwijderen: %(acc_code)s?" - -#~ msgid "%(widget_name)s not in glade file" -#~ msgstr "%(widget_name)s niet in glade bestand" - -#~ msgid "" -#~ "** Could not open the default log file.\n" -#~ "Press OK key to continue.\n" -#~ "\n" -#~ "%s" -#~ msgstr "" -#~ "** Kan het standaardlogboekbestand niet openen.\n" -#~ "Druk op OK toets om door te gaan.\n" -#~ "\n" -#~ "%s" - -#~ msgid "--" -#~ msgstr "--" - -#~ msgid "# of Plants" -#~ msgstr "# van Planten" - -#~ msgid "Accession Type:" -#~ msgstr "Acquisitie Type:" - -#~ msgid "Plugins" -#~ msgstr "Plugins" - -#~ msgid "Preferences" -#~ msgstr "Voorkeuren" - -#~ msgid "Choose a file..." -#~ msgstr "Kies een bestand..." - -#~ msgid "Choose a property..." -#~ msgstr "Kies een eigenschap..." - -#~ msgid "Choose file(s) to import..." -#~ msgstr "Selecteer bestand(en) om te importeren..." - -#~ msgid "Copyright © Belize Botanic Gardens" -#~ msgstr "Copyright © Belize Botanic Gardens" - -#~ msgid "Error: using sequences hasn't been tested on this database type: %s" -#~ msgstr "" -#~ "Fout: het gebruik van sequenties is niet getest op dit databasetype: %s" - -#~ msgid "Names" -#~ msgstr "Namen" - -#~ msgid "Password: " -#~ msgstr "Wachtwoord:" - -#~ msgid "Plant" -#~ msgstr "Plant" - -#~ msgid "Retrieving %s search results..." -#~ msgstr "Ophalen van %s zoekresultaten..." - -#~ msgid "Search Google" -#~ msgstr "Zoek met Google" - -#~ msgid "Select a file..." -#~ msgstr "Selecteer een bestand..." - -#~ msgid "" -#~ "The genus %(genus)s has %(num_species)s species. Are you sure you " -#~ "want to remove it?" -#~ msgstr "" -#~ "Het geslacht %(genus)s heeft %(num_species)s soorten. Weet u het " -#~ "zeker dat u %(genus)s wilt verwijderen?" - -#~ msgid "The location of the plant in your collection." -#~ msgstr "De locatie van de plant in uw collectie." - -#~ msgid "" -#~ "The plugins contain a dependency loop. This can happend if two plugins " -#~ "directly or indirectly rely on each other" -#~ msgstr "" -#~ "De plugins bevatten een afhankelijkheidslus. Dit kan gebeuren als twee " -#~ "plugins rechtstreeks of indirect een beroep op elkaar doen" - -#~ msgid "" -#~ "The species %(species)s has %(num_accessions)s accessions. Are " -#~ "you sure you want remove it?" -#~ msgstr "" -#~ "Soort %(species)s heeft %(num_accessions)s accessies. Wilt u het " -#~ "echt verwijderen?" - -#~ msgid "User: " -#~ msgstr "Gebruiker: " - -#, fuzzy -#~ msgid "http://bauble.wikidot.com" -#~ msgstr "http://bauble.belizebotanic.org" From 1008af9d531347b11a38143df2ca6f8f9207e406 Mon Sep 17 00:00:00 2001 From: Jaap Uilhoorn Date: Tue, 5 Jun 2018 17:21:44 +0000 Subject: [PATCH 42/42] Translated using Weblate (Dutch) Currently translated at 61.8% (495 of 800 strings) Translation: Ghini/Desktop 1.0 Translate-URL: https://hosted.weblate.org/projects/ghini/desktop-10/nl/ --- po/nl.po | 85 +++++++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/po/nl.po b/po/nl.po index fef5f7f48..43519ca4b 100644 --- a/po/nl.po +++ b/po/nl.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: bauble\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-14 08:29-0500\n" -"PO-Revision-Date: 2018-06-05 16:36+0000\n" +"PO-Revision-Date: 2018-06-06 19:36+0000\n" "Last-Translator: Jaap Uilhoorn \n" "Language-Team: Dutch \n" @@ -174,7 +174,7 @@ msgstr "Behandeling stekken" #: bauble/plugins/garden/acc_infobox.glade:171 msgid "Date accessioned:" -msgstr "Datum van verwerving:" +msgstr "Accessie datum:" #: bauble/plugins/garden/acc_infobox.glade:186 msgid "Date received:" @@ -220,11 +220,11 @@ msgstr "Inclusief data gemarkeerd als privaat" #: bauble/plugins/garden/acc_infobox.glade:369 msgid "Intended Location 2:" -msgstr "Beoogde plaatsing 2:" +msgstr "Beoogde locatie 2:" #: bauble/plugins/garden/acc_infobox.glade:400 msgid "Intended Location:" -msgstr "Beoogde plaatsing:" +msgstr "Beoogde locatie:" #: bauble/plugins/garden/acc_infobox.glade:416 msgid "Living Plants:" @@ -260,7 +260,7 @@ msgstr "Privé:" #: bauble/plugins/garden/acc_infobox.glade:609 msgid "Propagation:" -msgstr "Propagatie:" +msgstr "Voortkweking:" #: bauble/plugins/garden/acc_infobox.glade:140 msgid "Provenance:" @@ -454,13 +454,12 @@ msgid "Accession" msgstr "Accessie" #: bauble/plugins/garden/acc_editor.glade:2889 -#, fuzzy msgid "Accession Code Formats" -msgstr "Accessie codeformaten" +msgstr "Accessie code formats" #: bauble/plugins/garden/acc_editor.glade:13 msgid "Accession Editor" -msgstr "Accessieeditor" +msgstr "Accessie editor" #: bauble/plugins/garden/acc_editor.glade:522 msgid "Accession ID" @@ -506,7 +505,7 @@ msgstr "Voeg planten toe" #: bauble/plugins/plants/species_editor.glade:1116 msgid "Additional info" -msgstr "Extra info" +msgstr "Extra informatie" #: bauble/plugins/garden/institution.glade:408 msgid "Address" @@ -533,18 +532,20 @@ msgid "" "An approximation of the garden size: the diameter of the smallest circle " "completely containing the garden location." msgstr "" +"Een benadering van de omvang van de tuin: de diameter van de kleinste cirkel " +"die de tuin locatie geheel omvat." #: bauble/plugins/garden/location.py:193 msgid "" "Any information that might be relevant to the location such as where it is " "or what's its purpose" msgstr "" -"Elke informatie die relevant kan zijn met betrekking tot de plaats in de " -"tuin, zoals waar het ligt of wat zijn doel is." +"Alle informatie die relevant kan zijn met betrekking tot de standplaats in " +"de tuin, zoals locatie of wat zijn doel is." #: bauble/plugins/tag/__init__.py:104 msgid "Apply active tag" -msgstr "" +msgstr "Actieve tag toepassen" #: bauble/plugins/garden/accession.py:1297 msgid "Are you sure you want to copy this verification to the general taxon?" @@ -563,9 +564,7 @@ msgstr "Weet u zeker dat u uw wijzigingen wilt annuleren?" msgid "" "Are you sure you want to remove\n" "this propagation trial?" -msgstr "" -"Wilt u echt deze \n" -"propagatiepoging verwijderen" +msgstr "Weet U zeker dat U deze voortkweking test wilt verwijderen" #: bauble/connmgr.py:387 msgid "" @@ -665,7 +664,7 @@ msgstr "Kluitplant" #: bauble/plugins/garden/accession.py:431 msgid "Bare root plant" -msgstr "blote wortel plant" +msgstr "Plant met kale wortels" #: bauble/plugins/garden/source.py:128 msgid "Botanic Garden or Arboretum" @@ -818,7 +817,7 @@ msgstr "Verzamelaar" #: bauble/plugins/garden/acc_infobox.glade:760 msgid "Collector:" -msgstr "" +msgstr "Verzamelaar:" #: bauble/plugins/imex/csv_.py:684 bauble/plugins/imex/csv_.py:702 msgid "Comma Separated Value" @@ -826,7 +825,7 @@ msgstr "Kommagescheiden bestand (CSV)" #: bauble/plugins/users/ui.glade:362 msgid "Confirm new password" -msgstr "" +msgstr "Nieuw wachtwoord bevestigen" #: bauble/connmgr.glade:599 msgid "Connection Details" @@ -877,7 +876,7 @@ msgstr "" #: bauble/plugins/tag/__init__.py:135 msgid "Could not create the tags menus" -msgstr "Kan de tags menu niet aanmaken" +msgstr "Kan het tags menu niet aanmaken" #: bauble/plugins/garden/accession.py:196 bauble/plugins/garden/location.py:80 #: bauble/plugins/garden/plant.py:100 bauble/plugins/garden/source.py:778 @@ -984,15 +983,15 @@ msgstr "" #: bauble/plugins/garden/plant.py:607 msgid "Create a new location." -msgstr "Maak een nieuwe locatie." +msgstr "Nieuwe locatie aanmaken." #: bauble/plugins/garden/plant.py:609 msgid "Create a new propagation record for this plant." -msgstr "Maak een nieuw propagatie-record aan voor deze plant." +msgstr "Nieuwe voortkweking record aanmaken voor deze plant." #: bauble/plugins/plants/species_model.py:208 msgid "Critically Endangered (CR)" -msgstr "Critisch bedreigd (CR)" +msgstr "Ernstig bedreigd (CR)" #: bauble/plugins/plants/species_editor.glade:388 msgid "Cultivar Group" @@ -1003,9 +1002,8 @@ msgid "Cultivar group" msgstr "Cultivar Groep" #: bauble/plugins/garden/accession.py:395 -#, fuzzy msgid "Cultivated native" -msgstr "Inheemse gecultiveerd" +msgstr "Inheems gecultiveerd" #: bauble/plugins/garden/plant_editor.glade:765 msgid "Current change" @@ -1023,7 +1021,7 @@ msgstr "" #: bauble/plugins/garden/propagation.py:163 msgid "Cutting" -msgstr "" +msgstr "Stek" #: bauble/plugins/garden/prop_editor.glade:206 msgid "Cutting length" @@ -1068,7 +1066,7 @@ msgstr "Ontvangstdatum" #: bauble/plugins/garden/acc_infobox.glade:791 msgid "Date collected:" -msgstr "" +msgstr "Verzamel datum:" #: bauble/view.py:176 msgid "Date created:" @@ -1099,7 +1097,7 @@ msgstr "Dood" #: bauble/plugins/garden/plant.py:261 msgid "Deleted, yr. dead. unknown" -msgstr "Verwijderd, jaar v. dood niet gekend" +msgstr "Verwijderd, jaar v. afsterven onbekend" #: bauble/plugins/garden/loc_editor.glade:174 #: bauble/plugins/garden/contact.glade:74 bauble/plugins/tag/tag.glade:176 @@ -1113,7 +1111,7 @@ msgstr "Details" #: bauble/plugins/garden/institution.glade:537 msgid "Diameter" -msgstr "" +msgstr "Diameter" #: bauble/plugins/garden/plant.py:268 msgid "Did not germinate" @@ -1427,7 +1425,7 @@ msgstr "Geslacht Venster" #: bauble/plugins/garden/propagation.py:223 msgid "Germination date" -msgstr "" +msgstr "Datum van Kieming" #: bauble/plugins/garden/prop_editor.glade:1008 msgid "Germination media" @@ -1435,7 +1433,7 @@ msgstr "Kiemmedium" #: bauble/plugins/garden/propagation.py:227 msgid "Germination rate" -msgstr "" +msgstr "Kiempercentage" #: bauble/prefs.py:234 msgid "" @@ -1527,13 +1525,12 @@ msgid "Groups" msgstr "Groepen" #: bauble/plugins/plants/species_editor.glade:733 -#, fuzzy msgid "Habit" -msgstr "Gewoonte" +msgstr "Habitus" #: bauble/plugins/garden/acc_infobox.glade:960 msgid "Habitat" -msgstr "" +msgstr "Habitat" #: bauble/plugins/garden/acc_editor.glade:1964 msgid "Habitat description" @@ -1542,7 +1539,7 @@ msgstr "Habitat beschrijving" #: bauble/plugins/garden/acc_editor.glade:2574 #: bauble/plugins/garden/acc_editor.glade:2709 msgid "Herbarium" -msgstr "" +msgstr "Herbarium" #: bauble/plugins/garden/prop_editor.glade:704 msgid "Hormone" @@ -1550,7 +1547,7 @@ msgstr "Hormoon" #: bauble/plugins/garden/propagation.py:186 msgid "Hormone treatment" -msgstr "" +msgstr "Hormoon behandeling" #: bauble/plugins/garden/source.py:132 msgid "Horticultural Association/Garden Club" @@ -1650,7 +1647,7 @@ msgstr "Individueel" #: bauble/plugins/plants/species_editor.glade:555 msgid "Infraspecific parts" -msgstr "" +msgstr "infraspecifieke taxa" #: bauble/plugins/garden/institution.py:242 msgid "Institution" @@ -1680,7 +1677,7 @@ msgstr "Intact" #: bauble/plugins/garden/acc_editor.glade:1014 msgid "Intended Locations" -msgstr "Beoogde plaatsen" +msgstr "Beoogde locaties" #: bauble/plugins/garden/propagation.py:272 msgid "Internodal" @@ -1721,7 +1718,7 @@ msgstr "Breedtegraad" #: bauble/plugins/garden/acc_infobox.glade:849 msgid "Latitude:" -msgstr "" +msgstr "Breedtegraad:" #: bauble/plugins/garden/accession.py:439 msgid "Layer" @@ -1773,19 +1770,19 @@ msgstr "Locatie" #: bauble/plugins/garden/acc_editor.glade:809 msgid "Location 1" -msgstr "Plaats 1" +msgstr "Locatie 1" #: bauble/plugins/garden/acc_editor.glade:919 msgid "Location 2" -msgstr "Plaats 2" +msgstr "Locatie 2" #: bauble/plugins/garden/acc_editor.glade:2197 msgid "Location Details" -msgstr "Plaatsdetails" +msgstr "Locatie details" #: bauble/plugins/garden/acc_infobox.glade:836 msgid "Location:" -msgstr "Plaats:" +msgstr "Locatie:" #: bauble/plugins/garden/institution.glade:506 #: bauble/plugins/garden/acc_editor.glade:2039 @@ -1794,7 +1791,7 @@ msgstr "Lengtegraad" #: bauble/plugins/garden/acc_infobox.glade:864 msgid "Longitude:" -msgstr "Hoogtegraad:" +msgstr "Lengtegraad:" #: bauble/plugins/garden/plant.py:256 msgid "Lost, whereabouts unknown" @@ -2004,7 +2001,7 @@ msgstr "Wachtwoord:" #: bauble/plugins/garden/prop_editor.glade:894 msgid "Percent rooted" -msgstr "Procent geworteld" +msgstr "Percentage geworteld" #: bauble/plugins/users/ui.glade:206 msgid "Permissions"