diff --git a/src/Makefile.am b/src/Makefile.am index 49db9bae4..91c4615cc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,6 @@ gdirdir=$(prefix)/share/gramps gdir_PYTHON = \ const.py\ - constfunc.py\ gramps.py\ ImgManip.py\ LdsUtils.py \ diff --git a/src/TransUtils.py b/src/TransUtils.py index 4f79db8f2..3c9455c49 100644 --- a/src/TransUtils.py +++ b/src/TransUtils.py @@ -41,7 +41,7 @@ import locale # #------------------------------------------------------------------------- import const -from constfunc import mac +from gen.constfunc import mac #------------------------------------------------------------------------- # # Public Constants diff --git a/src/Utils.py b/src/Utils.py index b89c88900..475181e5b 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -53,7 +53,7 @@ from gen.locale import codeset import gen.datehandler from const import TEMP_DIR, USER_HOME, GRAMPS_UUID, IMAGE_DIR -import constfunc +from gen.constfunc import mac, win from gen.ggettext import sgettext as _ #------------------------------------------------------------------------- @@ -134,7 +134,7 @@ def fix_encoding(value, errors='strict'): return unicode(value) except: try: - if constfunc.mac(): + if mac(): codeset = locale.getlocale()[1] else: codeset = locale.getpreferredencoding() @@ -279,7 +279,7 @@ def encodingdefs(): """ pass -if constfunc.win(): +if win(): # python encoding is ascii, but C functions need to receive the # windows codeset, so convert over to it conv_utf8_tosrtkey = lambda x: locale.strxfrm(x.decode("utf-8").encode( @@ -379,7 +379,7 @@ def get_unicode_path_from_file_chooser(path): if not (isinstance(path, str)): return path - if constfunc.win(): + if win(): # in windows filechooser returns officially utf-8, not filesystemencoding try: return unicode(path) @@ -406,7 +406,7 @@ def get_unicode_path_from_env_var(path): if not (isinstance(path, str)): return path - if constfunc.win(): + if win(): # In Windows path/filename returned from a environment variable is in filesystemencoding try: new_path = unicode(path, sys.getfilesystemencoding()) @@ -475,7 +475,7 @@ def search_for(name): name = name.split('"')[1] else: name = name.split()[0] - if constfunc.win(): + if win(): for i in os.environ['PATH'].split(';'): fname = os.path.join(i, name) if os.access(fname, os.X_OK) and not os.path.isdir(fname): diff --git a/src/cli/clidbman.py b/src/cli/clidbman.py index e112cbed0..53df3be34 100644 --- a/src/cli/clidbman.py +++ b/src/cli/clidbman.py @@ -55,7 +55,7 @@ LOG = logging.getLogger(".clidbman") import gen.db from gen.plug import BasePluginManager from gen.config import config -import constfunc +from gen.constfunc import win #------------------------------------------------------------------------- # # constants @@ -436,7 +436,7 @@ def time_val(dirpath): if os.path.isfile(meta): tval = os.stat(meta)[9] # This gives creation date in Windows, but correct date in Linux - if constfunc.win(): + if win(): # Try to use last modified date instead in Windows # and check that it is later than the creation date. tval_mod = os.stat(meta)[8] diff --git a/src/gen/Makefile.am b/src/gen/Makefile.am index 5cd586135..b9d35f552 100644 --- a/src/gen/Makefile.am +++ b/src/gen/Makefile.am @@ -23,6 +23,7 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen pkgpython_PYTHON = \ __init__.py \ config.py \ + constfunc.py \ dbstate.py \ errors.py \ ggettext.py \ diff --git a/src/constfunc.py b/src/gen/constfunc.py similarity index 100% rename from src/constfunc.py rename to src/gen/constfunc.py diff --git a/src/gen/datehandler/_datehandler.py b/src/gen/datehandler/_datehandler.py index c3a95a24c..6f49ee93a 100644 --- a/src/gen/datehandler/_datehandler.py +++ b/src/gen/datehandler/_datehandler.py @@ -47,14 +47,14 @@ log = logging.getLogger(".gen.datehandler") #------------------------------------------------------------------------- from _dateparser import DateParser from _datedisplay import DateDisplay, DateDisplayEn -import constfunc +from gen.constfunc import win #------------------------------------------------------------------------- # # Constants # #------------------------------------------------------------------------- -if not constfunc.win(): +if not win(): LANG = locale.getlocale(locale.LC_TIME)[0] else: LANG = locale.getdefaultlocale(locale.LC_TIME)[0] diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 5b7af2791..b40fcc34c 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -64,7 +64,7 @@ from gen.db.dbconst import * from gen.utils.callback import Callback from gen.updatecallback import UpdateCallback from gen.errors import DbError -import constfunc +from gen.constfunc import win _LOG = logging.getLogger(DBLOGNAME) LOG = logging.getLogger(".citation") @@ -2004,7 +2004,7 @@ def write_lock_file(name): if not os.path.isdir(name): os.mkdir(name) f = open(os.path.join(name, DBLOCKFN), "w") - if constfunc.win(): + if win(): user = os.environ['USERNAME'] try: host = os.environ['USERDOMAIN'] diff --git a/src/gen/locale/_grampslocale.py b/src/gen/locale/_grampslocale.py index 46e71a4db..fd54ed718 100644 --- a/src/gen/locale/_grampslocale.py +++ b/src/gen/locale/_grampslocale.py @@ -21,7 +21,7 @@ # $Id$ import locale -import constfunc +from gen.constfunc import mac, win """ Some OS environments do not support the locale.nl_langinfo() method @@ -132,7 +132,7 @@ try: except: import time - if constfunc.win() or constfunc.mac(): + if win() or mac(): codeset = locale.getlocale()[1] else: codeset = locale.getpreferredencoding() diff --git a/src/gen/plug/docgen/graphdoc.py b/src/gen/plug/docgen/graphdoc.py index 8bdb718a5..8fcb78641 100644 --- a/src/gen/plug/docgen/graphdoc.py +++ b/src/gen/plug/docgen/graphdoc.py @@ -47,7 +47,7 @@ import Utils from gen.plug.docgen import BaseDoc from gen.plug.menu import NumberOption, TextOption, EnumeratedListOption, \ BooleanOption -import constfunc +from gen.constfunc import win #------------------------------------------------------------------------- # @@ -87,7 +87,7 @@ _RATIO = [ { 'name' : _("Minimal size"), 'value': "compress" }, _NOTELOC = [ { 'name' : _("Top"), 'value' : "t" }, { 'name' : _("Bottom"), 'value' : "b" }] -if constfunc.win(): +if win(): _DOT_FOUND = Utils.search_for("dot.exe") if Utils.search_for("gswin32c.exe") == 1: diff --git a/src/gramps.py b/src/gramps.py index 8e6dc392f..42c68992e 100644 --- a/src/gramps.py +++ b/src/gramps.py @@ -49,7 +49,7 @@ from subprocess import Popen, PIPE #------------------------------------------------------------------------- from gen.mime import mime_type_is_defined import TransUtils -import constfunc +from gen.constfunc import win #------------------------------------------------------------------------- # # Load internationalization setup @@ -88,7 +88,7 @@ if hasattr(os, "uname"): else: operating_system = sys.platform -if constfunc.win(): # Windows +if win(): # Windows TransUtils.setup_windows_gettext() elif operating_system == 'FreeBSD': try: @@ -289,7 +289,7 @@ def show_settings(): dotversion_str = 'Graphviz not in system PATH' try: - if constfunc.win(): + if win(): gsversion_str = Popen(['gswin32c', '--version'], stdout=PIPE).communicate(input=None)[0] else: gsversion_str = Popen(['gs', '--version'], stdout=PIPE).communicate(input=None)[0] diff --git a/src/gui/clipboard.py b/src/gui/clipboard.py index 013948295..6e3683584 100644 --- a/src/gui/clipboard.py +++ b/src/gui/clipboard.py @@ -52,7 +52,7 @@ from gui.display import display_help from gui.managedwindow import ManagedWindow from gen.ggettext import sgettext as _ from TransUtils import trans_objclass -from constfunc import mac +from gen.constfunc import mac from gui.glade import Glade from gui.ddtargets import DdTargets from gui.makefilter import make_filter diff --git a/src/gui/dbman.py b/src/gui/dbman.py index a4cf9aaee..ac7d05708 100644 --- a/src/gui/dbman.py +++ b/src/gui/dbman.py @@ -47,8 +47,8 @@ from gui.user import User import logging LOG = logging.getLogger(".DbManager") -import constfunc -if constfunc.win(): +from gen.constfunc import win +if win(): _RCS_FOUND = os.system("rcs -V >nul 2>nul") == 0 if _RCS_FOUND and "TZ" not in os.environ: # RCS requires the "TZ" variable be set. diff --git a/src/gui/display.py b/src/gui/display.py index e99490285..ceee52a57 100644 --- a/src/gui/display.py +++ b/src/gui/display.py @@ -21,7 +21,7 @@ # $Id$ import const -import constfunc +from gen.constfunc import is_quartz from gen.config import config import locale import os @@ -93,7 +93,7 @@ def run_file(file): Open a file or url with the default application. This should work on GNOME, KDE, XFCE, ... as we use a freedesktop application """ - if constfunc.is_quartz(): + if is_quartz(): prog = find_binary('open') else: prog = find_binary('xdg-open') diff --git a/src/gui/editors/displaytabs/gallerytab.py b/src/gui/editors/displaytabs/gallerytab.py index de91407aa..f32958ff9 100644 --- a/src/gui/editors/displaytabs/gallerytab.py +++ b/src/gui/editors/displaytabs/gallerytab.py @@ -58,7 +58,7 @@ from gen.errors import WindowActiveError import gen.mime from gui.ddtargets import DdTargets from buttontab import ButtonTab -import constfunc +from gen.constfunc import win import const #------------------------------------------------------------------------- # @@ -487,7 +487,7 @@ class GalleryTab(ButtonTab, DbGUIElement): self.handle_extra_type(mytype, obj) except pickle.UnpicklingError: #modern file managers provide URI_LIST. For Windows split sel_data.data - if constfunc.win(): + if win(): files = sel_data.data.split('\n') else: files = sel_data.get_uris() diff --git a/src/gui/grampsgui.py b/src/gui/grampsgui.py index 1414f8a0d..271c2d07f 100644 --- a/src/gui/grampsgui.py +++ b/src/gui/grampsgui.py @@ -58,7 +58,7 @@ import gobject #------------------------------------------------------------------------- from gen.config import config import const -import constfunc +from gen.constfunc import has_display, win import Utils #------------------------------------------------------------------------- @@ -75,7 +75,7 @@ def register_stock_icons (): from gui.pluginmanager import base_reg_stock_icons #iconpath to the base image. The front of the list has highest priority - if constfunc.win(): + if win(): iconpaths = [ (os.path.join(const.IMAGE_DIR, '48x48'), '.png'), (const.IMAGE_DIR, '.png'), @@ -288,7 +288,7 @@ def __startgramps(errors, argparser): try: quit_now = False exit_code = 0 - if constfunc.has_display(): + if has_display(): Gramps(argparser) else: print("Gramps terminated because of no DISPLAY") diff --git a/src/gui/pluginmanager.py b/src/gui/pluginmanager.py index d0cebfec2..8ddff1354 100644 --- a/src/gui/pluginmanager.py +++ b/src/gui/pluginmanager.py @@ -44,7 +44,7 @@ import gtk #------------------------------------------------------------------------- import gen.utils from gen.plug import BasePluginManager, PluginRegister -from constfunc import win +from gen.constfunc import win from gen.config import config import const diff --git a/src/gui/utils.py b/src/gui/utils.py index 9ae6e3462..2ee02a5e3 100644 --- a/src/gui/utils.py +++ b/src/gui/utils.py @@ -32,7 +32,6 @@ Utility functions that depend on GUI components or for GUI components import os import sys from gen.ggettext import gettext as _ -import constfunc # gtk is not included here, because this file is currently imported # by code that needs to run without the DISPLAY variable (eg, in # the cli only). @@ -49,7 +48,7 @@ import constfunc # #------------------------------------------------------------------------- import gen.lib -import constfunc +from gen.constfunc import has_display, is_quartz, mac, win #------------------------------------------------------------------------- # @@ -143,7 +142,7 @@ class ProgressMeter(object): else: self.__cancel_callback = self.handle_cancel - if constfunc.has_display(): + if has_display(): self.__dialog = gtk.Dialog() else: self.__dialog = CLIDialog() @@ -334,13 +333,13 @@ def open_file_with_default_application( file_path ): ErrorDialog(_("Error Opening File"), _("File does not exist")) return - if constfunc.win(): + if win(): try: os.startfile(norm_path) except WindowsError, msg: ErrorDialog(_("Error Opening File"), str(msg)) else: - if constfunc.mac(): + if mac(): utility = '/usr/bin/open' else: utility = 'xdg-open' @@ -375,7 +374,7 @@ def is_right_click(event): import gtk if event.type == gtk.gdk.BUTTON_PRESS: - if constfunc.is_quartz(): + if is_quartz(): if (event.button == 3 or (event.button == 1 and event.state & gtk.gdk.CONTROL_MASK)): return True diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 677627c5f..a075d2a94 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -79,7 +79,7 @@ from gui.pluginmanager import GuiPluginManager from gen.relationship import get_relationship_calculator from gui.displaystate import DisplayState, RecentDocsMenu import const -import constfunc +from gen.constfunc import is_quartz from gen.config import config from gen.errors import WindowActiveError from gui.dialog import (ErrorDialog, WarningDialog, QuestionDialog2, @@ -103,7 +103,7 @@ from gen.utils.configmanager import safe_eval # Constants # #------------------------------------------------------------------------- -if constfunc.is_quartz(): +if is_quartz(): try: import gtk_osxapplication as QuartzApp _GTKOSXAPPLICATION = True diff --git a/src/gui/views/navigationview.py b/src/gui/views/navigationview.py index 37eaba4ea..66051319f 100644 --- a/src/gui/views/navigationview.py +++ b/src/gui/views/navigationview.py @@ -49,7 +49,7 @@ import gtk from gui.views.pageview import PageView from gen.ggettext import sgettext as _ from Utils import navigation_label -from constfunc import mod_key +from gen.constfunc import mod_key DISABLED = -1 MRU_SIZE = 10 diff --git a/src/gui/widgets/expandcollapsearrow.py b/src/gui/widgets/expandcollapsearrow.py index 5cc7e3897..ca20923b3 100644 --- a/src/gui/widgets/expandcollapsearrow.py +++ b/src/gui/widgets/expandcollapsearrow.py @@ -38,14 +38,14 @@ _LOG = logging.getLogger(".widgets.expandcollapsearrow") # #------------------------------------------------------------------------- import gtk -import constfunc +from gen.constfunc import has_display #------------------------------------------------------------------------- # # Constants # #------------------------------------------------------------------------- -if constfunc.has_display(): +if has_display(): HAND_CURSOR = gtk.gdk.Cursor(gtk.gdk.HAND2) #------------------------------------------------------------------------- diff --git a/src/gui/widgets/labels.py b/src/gui/widgets/labels.py index 6eaf18edd..b1c9ade58 100644 --- a/src/gui/widgets/labels.py +++ b/src/gui/widgets/labels.py @@ -47,14 +47,14 @@ import pango # Gramps modules # #------------------------------------------------------------------------- -import constfunc +from gen.constfunc import has_display, win #------------------------------------------------------------------------- # # Constants # #------------------------------------------------------------------------- -if constfunc.has_display(): +if has_display(): HAND_CURSOR = gtk.gdk.Cursor(gtk.gdk.HAND2) #------------------------------------------------------------------------- @@ -208,7 +208,7 @@ class GenderLabel(gtk.Label): def __init__(self, text): gtk.Label.__init__(self, text) self.set_alignment(0, 0.5) - if constfunc.win(): + if win(): pangoFont = pango.FontDescription('Arial') self.modify_font(pangoFont) self.show() diff --git a/src/gui/widgets/styledtexteditor.py b/src/gui/widgets/styledtexteditor.py index eec5a4f0e..3f97ecb2e 100644 --- a/src/gui/widgets/styledtexteditor.py +++ b/src/gui/widgets/styledtexteditor.py @@ -60,7 +60,7 @@ from gui.widgets.springseparator import SpringSeparatorAction from gui.spell import Spell from gui.display import display_url from gen.config import config -from constfunc import has_display +from gen.constfunc import has_display #------------------------------------------------------------------------- # diff --git a/src/guiQML/grampsqml.py b/src/guiQML/grampsqml.py index 0f47ad67f..91b7f93a1 100644 --- a/src/guiQML/grampsqml.py +++ b/src/guiQML/grampsqml.py @@ -43,7 +43,7 @@ LOG = logging.getLogger(".grampsqml") # GRAMPS modules # #------------------------------------------------------------------------- -import constfunc +from gen.constfunc import has_display from gen.config import config #------------------------------------------------------------------------- @@ -136,7 +136,7 @@ def startqml(errors, argparser): quit_now = False openGL = True exit_code = 0 - if constfunc.has_display(): + if has_display(): GrampsQML(argparser) else: print("Gramps terminated because of no DISPLAY") diff --git a/src/plugins/export/ExportPkg.py b/src/plugins/export/ExportPkg.py index f4fc505e1..6a56b0c74 100644 --- a/src/plugins/export/ExportPkg.py +++ b/src/plugins/export/ExportPkg.py @@ -62,7 +62,7 @@ import gtk from gui.plug.export import WriterOptionBox from ExportXml import XmlWriter import Utils -import constfunc +from gen.constfunc import win #------------------------------------------------------------------------- # @@ -217,7 +217,7 @@ class PackageWriter(object): tarinfo = tarfile.TarInfo('data.gramps') tarinfo.size = len(g.getvalue()) tarinfo.mtime = time.time() - if not constfunc.win(): + if not win(): tarinfo.uid = os.getuid() tarinfo.gid = os.getgid() g.seek(0) diff --git a/src/plugins/export/ExportXml.py b/src/plugins/export/ExportXml.py index a5afd5b71..561a7907f 100644 --- a/src/plugins/export/ExportXml.py +++ b/src/plugins/export/ExportXml.py @@ -61,7 +61,7 @@ import gen.lib from gen.updatecallback import UpdateCallback from gen.db.exceptions import DbWriteFailure import const -import constfunc +from gen.constfunc import win from gui.plug.export import WriterOptionBox import libgrampsxml @@ -1198,7 +1198,7 @@ class GrampsXmlWriter(UpdateCallback): elif self.strip_photos == 2 and (len(path)>0 and os.path.isabs(path)): drive, path = os.path.splitdrive(path) path = path[1:] - if constfunc.win(): + if win(): # Always export path with \ replaced with /. Otherwise import # from Windows to Linux of gpkg's path to images does not work. path = path.replace('\\','/') diff --git a/src/plugins/lib/maps/geography.py b/src/plugins/lib/maps/geography.py index 8f8af181e..5bd9e351e 100644 --- a/src/plugins/lib/maps/geography.py +++ b/src/plugins/lib/maps/geography.py @@ -52,7 +52,6 @@ from gui.views.navigationview import NavigationView from libformatting import FormattingHelper from gen.errors import WindowActiveError import const -import constfunc from gui.managedwindow import ManagedWindow from gen.config import config from gui.editors import EditPlace, EditEvent, EditFamily, EditPerson diff --git a/src/plugins/view/htmlrenderer.py b/src/plugins/view/htmlrenderer.py index d643515ec..679ed55de 100644 --- a/src/plugins/view/htmlrenderer.py +++ b/src/plugins/view/htmlrenderer.py @@ -60,7 +60,7 @@ import gtk from gui.views.navigationview import NavigationView from gui.views.bookmarks import PersonBookmarks import Utils -import constfunc +from gen.constfunc import lin, mac, win from gen.config import config from const import TEMP_DIR @@ -71,11 +71,11 @@ from const import TEMP_DIR #------------------------------------------------------------------------- def get_identity(): - if constfunc.lin(): + if lin(): platform = "X11" - elif constfunc.win(): + elif win(): platform = "Windows" - elif constfunc.mac(): + elif mac(): platform = "Macintosh" else: platform = "Unknown" diff --git a/src/plugins/view/mediaview.py b/src/plugins/view/mediaview.py index 30cc357b1..29dde2ecc 100644 --- a/src/plugins/view/mediaview.py +++ b/src/plugins/view/mediaview.py @@ -53,7 +53,7 @@ from gui.utils import open_file_with_default_application from gui.views.listview import ListView from gui.views.treemodels import MediaModel import const -import constfunc +from gen.constfunc import win from gen.config import config import Utils from gui.views.bookmarks import MediaBookmarks @@ -174,7 +174,7 @@ class MediaView(ListView): if not sel_data: return #modern file managers provide URI_LIST. For Windows split sel_data.data - if constfunc.win(): + if win(): files = sel_data.data.split('\n') else: files = sel_data.get_uris() diff --git a/src/plugins/view/pedigreeview.py b/src/plugins/view/pedigreeview.py index b22d54ced..3234eeeb2 100644 --- a/src/plugins/view/pedigreeview.py +++ b/src/plugins/view/pedigreeview.py @@ -62,7 +62,7 @@ import cPickle as pickle from gen.config import config from gui.views.bookmarks import PersonBookmarks import const -import constfunc +from gen.constfunc import is_quartz, win from gui.dialog import RunDatabaseRepair, ErrorDialog import gui.utils @@ -71,7 +71,7 @@ import gui.utils # Constants # #------------------------------------------------------------------------- -if constfunc.is_quartz(): +if is_quartz(): CAIRO_AVAILABLE = False else: try: @@ -176,7 +176,7 @@ class PersonBoxWidgetCairo(_PersonWidgetBase): self.maxlines = maxlines self.hightlight = False self.connect("expose_event", self.expose) - if not constfunc.win(): + if not win(): self.connect("realize", self.realize) self.text = "" if self.person: @@ -257,7 +257,7 @@ class PersonBoxWidgetCairo(_PersonWidgetBase): witout text. """ # pylint: disable-msg=E1101 - if constfunc.win(): + if win(): self.context = self.window.cairo_create() self.textlayout = self.context.create_layout() self.textlayout.set_font_description(self.get_style().font_desc) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 2ce88eeca..f0b40bd7a 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -89,7 +89,7 @@ from gen.plug.report import utils as ReportUtils from gen.plug.report import MenuReportOptions import Utils -import constfunc +from gen.constfunc import win from gui.thumbnails import get_thumbnail_path, run_thumbnailer import ImgManip import gen.mime @@ -5767,7 +5767,7 @@ class IndividualPage(BasePage): newpath = copy_thumbnail(self.report, photo_handle, photo, region) # TODO. Check if build_url_fname can be used. newpath = "/".join(['..']*3 + [newpath]) - if constfunc.win(): + if win(): newpath = newpath.replace('\\',"/") thumbnailUrl = newpath #snapshot += self.media_link(photo_handle, newpath, '', uplink = True) @@ -5775,7 +5775,7 @@ class IndividualPage(BasePage): else: (photoUrl, thumbnailUrl) = self.report.prepare_copy_media(photo) thumbnailUrl = "/".join(['..']*3 + [thumbnailUrl]) - if constfunc.win(): + if win(): thumbnailUrl = thumbnailUrl.replace('\\',"/") url = self.report.build_url_fname_html(person.handle, "ppl", True) boxbg += self.person_link(url, person, name_style = True, thumbnailUrl = thumbnailUrl) @@ -7509,7 +7509,7 @@ class NavWebReport(Report): if up: subdirs = ['..']*3 + subdirs nname = "/".join(subdirs + [fname]) - if constfunc.win(): + if win(): nname = nname.replace('\\',"/") return nname @@ -7577,7 +7577,7 @@ class NavWebReport(Report): if not fname: return "" - if constfunc.win(): + if win(): fname = fname.replace('\\',"/") subdirs = self.build_subdirs(subdir, fname, up) return "/".join(subdirs + [fname]) @@ -7622,7 +7622,7 @@ class NavWebReport(Report): tarinfo = tarfile.TarInfo(self.cur_fname) tarinfo.size = len(string_io.getvalue()) tarinfo.mtime = time.time() - if not constfunc.win(): + if not win(): tarinfo.uid = os.getuid() tarinfo.gid = os.getgid() string_io.seek(0) diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index 5f0f8f148..795b6fc5a 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -51,7 +51,7 @@ log = logging.getLogger(".WebPage") #------------------------------------------------------------------------ import gen.lib import const -import constfunc +from gen.constfunc import win from gen.plug.report import Report from gen.plug.report import utils as ReportUtils from gen.plug.report import MenuReportOptions @@ -1006,7 +1006,7 @@ class WebCalReport(Report): Imagine we run gramps on Windows (heaven forbits), we don't want to see backslashes in the URL. """ - if (constfunc.win()): + if win(): fname = fname.replace('\\',"/") subdirs = self.build_subdirs(subdir, fname) return (prefix or '') + "/".join(subdirs + [fname])