diff --git a/bauble/utils/web.py b/bauble/utils/web.py index dd580d005..cb4354026 100644 --- a/bauble/utils/web.py +++ b/bauble/utils/web.py @@ -31,12 +31,13 @@ -def _open_link(func, data=None): +def _open_link(data=None): + """Open a web link""" # windows generates odd characters in the uri unless its in ascii import sys if sys.platform == 'win32': - udata=data.decode("utf-8") - asciidata=udata.encode("ascii","ignore") + udata = data.decode("utf-8") + asciidata = udata.encode("ascii", "ignore") desktop.open(asciidata) else: desktop.open(data) diff --git a/scripts/Add_to_PATH.vbs b/scripts/add_to_path.vbs similarity index 100% rename from scripts/Add_to_PATH.vbs rename to scripts/add_to_path.vbs diff --git a/scripts/build-multiuser.nsi b/scripts/build-multiuser.nsi index 641f9e693..3a74b16dc 100755 --- a/scripts/build-multiuser.nsi +++ b/scripts/build-multiuser.nsi @@ -56,14 +56,14 @@ ; Global Name "ghini.desktop" !define VERSION "1.0.75" ; :bump -!define src_dir "..\dist" +!define SRC_DIR "..\dist" !define PRODUCT_NAME "ghini.desktop" Outfile "${PRODUCT_NAME}-${VERSION}-setup.exe" !define PROGEXE "ghini.exe" !define COMPANY_NAME "" -!define license_file "LICENSE" -!define readme "README.rst" -!define startmenu "$SMPROGRAMS\${PRODUCT_NAME}" +!define LICENSE_FILE "LICENSE" +!define README "README.rst" +!define START_MENU "$SMPROGRAMS\${PRODUCT_NAME}" !define UNINSTALL_FILENAME "uninstall.exe" ; FOP @@ -113,11 +113,11 @@ CRCCheck on ; Modern User Interface v2 Settings !define MUI_ABORTWARNING !define MUI_UNABORTWARNING -!define MUI_ICON "${src_dir}\bauble\images\icon.ico" -!define MUI_UNICON "${src_dir}\bauble\images\icon.ico" +!define MUI_ICON "${SRC_DIR}\bauble\images\icon.ico" +!define MUI_UNICON "${SRC_DIR}\bauble\images\icon.ico" !define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_BITMAP "${src_dir}\bauble\images\ghini_logo.bmp" -!define MUI_HEADERIMAGE_UNBITMAP "${src_dir}\bauble\images\ghini_logo.bmp" +!define MUI_HEADERIMAGE_BITMAP "${SRC_DIR}\bauble\images\ghini_logo.bmp" +!define MUI_HEADERIMAGE_UNBITMAP "${SRC_DIR}\bauble\images\ghini_logo.bmp" !define MUI_HEADERIMAGE_RIGHT !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Or, select the optional components you wish to install: \ @@ -149,7 +149,7 @@ CRCCheck on ; PAGES ; Installer -!insertmacro MUI_PAGE_LICENSE "${src_dir}\${license_file}" +!insertmacro MUI_PAGE_LICENSE "${SRC_DIR}\${LICENSE_FILE}" !insertmacro MULTIUSER_PAGE_INSTALLMODE ; this will show the 2 install options, unless it's an elevated inner process ; (in that case we know we should install for all users) @@ -169,7 +169,6 @@ CRCCheck on ; LANGUAGES ; MUIv2 macros (must be after scripts and pages) -; TODO add more languages? !insertmacro MUI_LANGUAGE English @@ -196,7 +195,7 @@ Section "!Ghini.desktop" SecMain SetOverwrite on ; package all files, recursively, preserving attributes ; assume files are in the correct places - File /a /r "${src_dir}\*.*" + File /a /r "${SRC_DIR}\*.*" ; Create uninstaller WriteUninstaller "$INSTDIR\${UNINSTALL_FILENAME}" @@ -204,8 +203,8 @@ Section "!Ghini.desktop" SecMain ; add registry keys !insertmacro MULTIUSER_RegistryAddInstallInfo ; create shortcuts - CreateDirectory "${startmenu}" - CreateShortcut "${startmenu}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PROGEXE}" \ + CreateDirectory "${START_MENU}" + CreateShortcut "${START_MENU}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PROGEXE}" \ "" "$INSTDIR\${PROGEXE}" "" SW_SHOWNORMAL \ "" "Ghini biodiversity collection manager" ; desktop shortcut @@ -375,7 +374,7 @@ Section /o "MS Visual C runtime DLL (1.73MB Download)" SecMSC Goto DoneMSVC ; Install MS Visual C Runtime - ; TODO there seems to be a bug in the installer that leaves junk files in the root directory of the largest drive + ; there seems to be a bug in the installer that leaves junk files in the root directory of the largest drive. InstalMSVC: ; run installer silently (no user input, no cancel button) ExecWait '"$PLUGINSDIR\${MSVC_FILE}" /qb!' @@ -405,7 +404,6 @@ SectionGroupEnd ; UNINSTALLER SECTIONS ; ; All section names prefixed by "Un" will be in the uninstaller -; TODO include a FOP uninstaller ; Settings UninstallText "This will uninstall ${PRODUCT_NAME}." @@ -415,11 +413,11 @@ UninstallText "This will uninstall ${PRODUCT_NAME}." Section "Uninstall" SecUnMain ; Remove registry keys !insertmacro MULTIUSER_RegistryRemoveInstallInfo - Delete "${startmenu}\*.*" + Delete "${START_MENU}\*.*" Delete "$DESKTOP\${PRODUCT_NAME}.lnk" SetOutPath $TEMP RMDir /r "$INSTDIR" - RMDir /r "${startmenu}" + RMDir /r "${START_MENU}" SectionEnd @@ -479,8 +477,8 @@ Function AddFOPtoPATH ; copy the script to a temp dir SetOutPath "$PLUGINSDIR\" SetOverwrite on - File /a "Add_to_PATH.vbs" - ExecWait '"$SYSDIR\wscript.exe" //E:vbscript "$PLUGINSDIR\Add_to_PATH.vbs" /path:"$R0\fop-${FOP_VERSION}\" /env:"$R1"' + File /a "add_to_path.vbs" + ExecWait '"$SYSDIR\wscript.exe" //E:vbscript "$PLUGINSDIR\add_to_path.vbs" /path:"$R0\fop-${FOP_VERSION}\" /env:"$R1"' DetailPrint "Apache FOP added to $R1 PATH as: $R0\fop-${FOP_VERSION}\" SetRebootFlag True DetailPrint "Reboot flag = True" diff --git a/scripts/bump_version.py b/scripts/bump_version.py index e29acaf22..0b8405933 100755 --- a/scripts/bump_version.py +++ b/scripts/bump_version.py @@ -137,7 +137,8 @@ def bump_nsi_file(filename, varname='version'): bump_py_file(os.path.join(root_of_clone(), 'doc/conf.py'), 'release') bump_desktop_file(os.path.join(root_of_clone(), 'data/ghini.desktop')) bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build.nsi')) -bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build-multiuser.nsi'), 'VERSION') +bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build-multiuser.nsi'), + 'VERSION') rx = "(^VERSION=\").*?\..*?\..*?(\".*?%s.*?$)" % bump_tag bump_file(os.path.join(root_of_clone(), 'packages/builddeb.sh'), rx) diff --git a/setup.py b/setup.py index 2f22c1dcb..81914ad93 100755 --- a/setup.py +++ b/setup.py @@ -58,11 +58,12 @@ exclude=['test', 'bauble.*.test', 'ghini.*.test']) plugins_pkgs = ['bauble.plugins.%s' % p for p in plugins] all_packages = setuptools.find_packages(exclude=['test', 'bauble.*.test', - 'ghini.*.test']) + 'ghini.*.test']) package_data = {'': ['README.rst', 'CHANGES', 'LICENSE'], - 'bauble': ['*.ui', '*.glade', 'images/*.png', 'pixmaps/*.png', - 'images/*.svg', 'images/*.gif', 'images/*.ico', 'images/*.bmp']} + 'bauble': ['*.ui', '*.glade', 'images/*.png', 'pixmaps/*.png', + 'images/*.svg', 'images/*.gif', 'images/*.ico', + 'images/*.bmp']} # ceate a list of the data patterns to look for in the packages data_patterns = ['default/*.txt', '*.ui', '*.glade', '*.xsl', '*.xsd', @@ -85,8 +86,9 @@ sqlalchemy_includes = ['sqlalchemy.dialects.sqlite', 'sqlalchemy.dialects.postgresql'] py2exe_includes = ['sqlite3', 'lxml', 'gdata', 'fibra', 'psycopg2', - 'encodings', 'mako', 'mako.cache', 'pygments.styles.default', - 'pyparsing'] + gtk_pkgs + plugins_pkgs + sqlalchemy_includes + 'encodings', 'mako', 'mako.cache', + 'pygments.styles.default', 'pyparsing'] + py2exe_includes += gtk_pkgs + plugins_pkgs + sqlalchemy_includes py2exe_setup_args = { 'windows': [{'script': 'scripts/ghini', 'icon_resources': [(1, "bauble/images/icon.ico")]}]} @@ -105,7 +107,7 @@ "libgtk-win32-2.0-0.dll", "libpango-1.0-0.dll", "libpangowin32-1.0-0.dll", "libxml2-2.dll", # windows dlls - "DNSAPI.DLL","MSIMG32.DLL", "Secur32.dll", "SHFOLDER.dll", + "DNSAPI.DLL", "MSIMG32.DLL", "Secur32.dll", "SHFOLDER.dll", "CRYPT32.dll", "MPR.dll" ] } @@ -176,8 +178,8 @@ def run(self): file_util.copy_file(gtheme, dest) # copy LICENSE to dist\share\LICENSE.ghini (for help>about) - file_util.copy_file("LICENSE", - os.path.join(self.dist_dir, 'share', 'LICENSE.ghini')) + file_util.copy_file("LICENSE", os.path.join(self.dist_dir, 'share', + 'LICENSE.ghini')) class nsis_cmd(Command): # 1. copy the gtk dist to the dist directory @@ -423,7 +425,7 @@ def run(self): scripts = ["scripts/ghini"] if sys.platform == 'win32': scripts = ["scripts/ghini", "scripts/ghini.bat", "scripts/ghini.vbs", - "scripts/ghini-update.bat"] + "scripts/ghini-update.bat"] # TODO: images in bauble/images should really be in data and copied as # package_data or data_files