Split Utils in a non GUI and GUI part
move GrampsCfg utils to Utils improve import strategy svn: r12680
This commit is contained in:
@@ -45,8 +45,8 @@ from gen.plug.menu import BooleanOption, StringOption, NumberOption, \
|
||||
EnumeratedListOption, FilterOption, PersonOption
|
||||
import GrampsLocale
|
||||
import gen.lib
|
||||
from Utils import probably_alive, ProgressMeter
|
||||
|
||||
from Utils import probably_alive
|
||||
from gui.utils import ProgressMeter
|
||||
|
||||
import libholiday
|
||||
from libholiday import g2iso
|
||||
|
||||
@@ -51,7 +51,7 @@ from gen.plug.menu import BooleanOption, NumberOption, EnumeratedListOption, \
|
||||
FilterOption, PersonOption
|
||||
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_DRAW
|
||||
import DateHandler
|
||||
from Utils import ProgressMeter
|
||||
from gui.utils import ProgressMeter
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -46,7 +46,8 @@ from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
import Sort
|
||||
from QuestionDialog import ErrorDialog
|
||||
from BasicUtils import name_displayer
|
||||
from Utils import probably_alive, ProgressMeter
|
||||
from Utils import probably_alive
|
||||
from gui.utils import ProgressMeter
|
||||
import gen.lib
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
@@ -35,7 +35,7 @@ import re
|
||||
import gen.lib
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
import DateHandler
|
||||
from Utils import ProgressMeter
|
||||
from gui.utils import ProgressMeter
|
||||
import ExportOptions
|
||||
|
||||
def makeDB(db):
|
||||
|
||||
@@ -48,6 +48,7 @@ log = logging.getLogger(".FamilyLines")
|
||||
#------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import ThumbNails
|
||||
from DateHandler import displayer as _dd
|
||||
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_GRAPHVIZ
|
||||
@@ -394,7 +395,7 @@ class FamilyLinesReport(Report):
|
||||
from the database is going to be output into the report
|
||||
"""
|
||||
|
||||
self.progress = Utils.ProgressMeter(_('Generating Family Lines'),
|
||||
self.progress = ProgressMeter(_('Generating Family Lines'),
|
||||
_('Starting'))
|
||||
|
||||
# starting with the people of interest, we then add parents:
|
||||
|
||||
@@ -54,7 +54,7 @@ from QuestionDialog import ErrorDialog
|
||||
from DateHandler import parser as _dp
|
||||
from gen.plug import PluginManager, ImportPlugin
|
||||
from Utils import gender as gender_map
|
||||
from Utils import ProgressMeter
|
||||
from gui.utils import ProgressMeter
|
||||
from Utils import create_id
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -48,6 +48,7 @@ log = logging.getLogger('.ImportProGen')
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import gen.lib
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ImportPlugin
|
||||
@@ -488,7 +489,7 @@ class ProgenParser(object):
|
||||
self.skeys = {} # Caching source handles
|
||||
|
||||
def parse_progen_file(self):
|
||||
self.progress = Utils.ProgressMeter(_("Import from Pro-Gen"), '')
|
||||
self.progress = ProgressMeter(_("Import from Pro-Gen"), '')
|
||||
|
||||
self.def_ = PG30_Def(self.fname)
|
||||
#print self.def_.diag()
|
||||
|
||||
@@ -45,7 +45,8 @@ from gen.plug.menu import BooleanOption, StringOption, NumberOption, \
|
||||
EnumeratedListOption, FilterOption, PersonOption
|
||||
import GrampsLocale
|
||||
from gen.lib import NameType, EventType, Name, Date, Person
|
||||
from Utils import probably_alive, ProgressMeter
|
||||
from Utils import probably_alive
|
||||
from gui.utils import ProgressMeter
|
||||
|
||||
import libholiday
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
||||
@@ -81,7 +81,7 @@ class ChangeNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
if self.fail:
|
||||
return
|
||||
|
||||
self.progress = Utils.ProgressMeter(_('Checking Family Names'),'')
|
||||
self.progress = ProgressMeter(_('Checking Family Names'),'')
|
||||
self.progress.set_pass(_('Searching family names'),
|
||||
len(self.db.get_surname_list()))
|
||||
self.name_list = []
|
||||
|
||||
@@ -36,7 +36,7 @@ from gettext import ngettext
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import locale
|
||||
import ManagedWindow
|
||||
import AutoComp
|
||||
@@ -113,7 +113,7 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
self.trans = self.db.transaction_begin("",batch=True)
|
||||
self.db.disable_signals()
|
||||
if not cli:
|
||||
progress = Utils.ProgressMeter(_('Analyzing Events'),'')
|
||||
progress = ProgressMeter(_('Analyzing Events'),'')
|
||||
progress.set_pass('',self.db.get_number_of_events())
|
||||
|
||||
for event_handle in self.db.get_event_handles():
|
||||
|
||||
@@ -58,6 +58,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
#import const
|
||||
import ManagedWindow
|
||||
|
||||
@@ -243,7 +244,7 @@ class CheckIntegrity(object):
|
||||
'repos' : [],
|
||||
'notes' : [],
|
||||
}
|
||||
self.progress = Utils.ProgressMeter(_('Checking Database'),'')
|
||||
self.progress = ProgressMeter(_('Checking Database'),'')
|
||||
|
||||
def family_errors(self):
|
||||
return len(self.broken_parent_links) + \
|
||||
|
||||
@@ -45,7 +45,7 @@ from gettext import gettext as _
|
||||
import gen.lib
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
from QuestionDialog import QuestionDialog
|
||||
from DateHandler import parser as _dp
|
||||
from DateHandler import displayer as _dd
|
||||
@@ -68,7 +68,7 @@ class DateParserDisplayTest(Tool.Tool):
|
||||
|
||||
|
||||
def run_tool(self):
|
||||
self.progress = Utils.ProgressMeter(_('Running Date Test'),'')
|
||||
self.progress = ProgressMeter(_('Running Date Test'),'')
|
||||
self.progress.set_pass(_('Generating dates'),
|
||||
4)
|
||||
dates = []
|
||||
|
||||
@@ -45,6 +45,7 @@ import gtk
|
||||
from Filters import GenericFilter, build_filter_model, Rules
|
||||
import Sort
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
from docgen import ODSTab
|
||||
import const
|
||||
import Errors
|
||||
@@ -171,7 +172,7 @@ class EventComparison(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
def on_apply_clicked(self, obj):
|
||||
cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||
|
||||
progress_bar = Utils.ProgressMeter(_('Comparing events'),'')
|
||||
progress_bar = ProgressMeter(_('Comparing events'),'')
|
||||
progress_bar.set_pass(_('Selecting people'),1)
|
||||
|
||||
plist = cfilter.apply(self.db,
|
||||
@@ -288,7 +289,7 @@ class DisplayChart(ManagedWindow.ManagedWindow):
|
||||
self.progress_bar.close()
|
||||
|
||||
def build_row_data(self):
|
||||
self.progress_bar = Utils.ProgressMeter(_('Comparing Events'),'')
|
||||
self.progress_bar = ProgressMeter(_('Comparing Events'),'')
|
||||
self.progress_bar.set_pass(_('Building data'),len(self.my_list))
|
||||
for individual_id in self.my_list:
|
||||
individual = self.db.get_person_from_handle(individual_id)
|
||||
|
||||
@@ -50,7 +50,7 @@ import GrampsDisplay
|
||||
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
from glade import Glade
|
||||
|
||||
CITY_STATE_ZIP = re.compile("((\w|\s)+)\s*,\s*((\w|\s)+)\s*(,\s*((\d|-)+))", re.UNICODE)
|
||||
@@ -428,7 +428,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
Performs the actual extraction of information
|
||||
"""
|
||||
|
||||
self.progress = Utils.ProgressMeter(_('Checking Place Titles'), '')
|
||||
self.progress = ProgressMeter(_('Checking Place Titles'), '')
|
||||
self.progress.set_pass(_('Looking for place fields'),
|
||||
len(self.db.get_place_handles()))
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import gen.lib
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import soundex
|
||||
from BasicUtils import name_displayer
|
||||
from QuestionDialog import OkDialog
|
||||
@@ -180,7 +180,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
pass
|
||||
|
||||
def find_potentials(self,thresh):
|
||||
self.progress = Utils.ProgressMeter(_('Find Duplicates'),
|
||||
self.progress = ProgressMeter(_('Find Duplicates'),
|
||||
_('Looking for duplicate people'))
|
||||
|
||||
index = 0
|
||||
|
||||
@@ -43,7 +43,7 @@ from ReportBase import ReportUtils
|
||||
from PluginUtils import Tool
|
||||
from Editors import EditPerson, EditFamily
|
||||
import ManagedWindow
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import GrampsDisplay
|
||||
from TransUtils import sgettext as _
|
||||
from glade import Glade
|
||||
@@ -96,7 +96,7 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
|
||||
|
||||
# start the progress indicator
|
||||
self.progress = Utils.ProgressMeter(self.title,_('Starting'))
|
||||
self.progress = ProgressMeter(self.title,_('Starting'))
|
||||
|
||||
# setup the columns
|
||||
self.model = gtk.TreeStore(
|
||||
@@ -226,7 +226,7 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
||||
|
||||
# if more than 1 person is selected, use a progress indicator
|
||||
if rows > 1:
|
||||
progress = Utils.ProgressMeter(self.title,_('Starting'))
|
||||
progress = ProgressMeter(self.title,_('Starting'))
|
||||
progress.set_pass(_('Setting marker for %d people') % rows, rows)
|
||||
|
||||
# start the db transaction
|
||||
|
||||
@@ -37,7 +37,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Config
|
||||
import GrampsCfg
|
||||
from Utils import get_researcher
|
||||
import GrampsDisplay
|
||||
from widgets import MonitoredEntry
|
||||
import ManagedWindow
|
||||
@@ -159,7 +159,7 @@ class OwnerEditor(Tool.Tool, ManagedWindow.ManagedWindow):
|
||||
def on_menu_activate(self, menuitem):
|
||||
"""Copies the owner information from/to the preferences"""
|
||||
if menuitem.name == 'copy_from_preferences_to_db':
|
||||
self.owner.set_from(GrampsCfg.get_researcher())
|
||||
self.owner.set_from(get_researcher())
|
||||
for entry in self.entries:
|
||||
entry.update()
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
from QuestionDialog import OkDialog
|
||||
@@ -117,7 +117,7 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
|
||||
self.prefix1_list = []
|
||||
self.prefix2_list = []
|
||||
|
||||
self.progress = Utils.ProgressMeter(
|
||||
self.progress = ProgressMeter(
|
||||
_('Extracting Information from Names'), '')
|
||||
self.progress.set_pass(_('Analyzing names'),
|
||||
self.db.get_number_of_people())
|
||||
|
||||
@@ -39,7 +39,7 @@ from gettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import gen.lib
|
||||
from PluginUtils import Tool
|
||||
from gen.plug import PluginManager
|
||||
@@ -60,7 +60,7 @@ class ReorderIds(Tool.BatchTool):
|
||||
db = dbstate.db
|
||||
self.uistate = uistate
|
||||
if uistate:
|
||||
self.progress = Utils.ProgressMeter(_('Reordering GRAMPS IDs'),'')
|
||||
self.progress = ProgressMeter(_('Reordering GRAMPS IDs'),'')
|
||||
else:
|
||||
print "Reordering GRAMPS IDs..."
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ log = logging.getLogger(".WebPage")
|
||||
from gen.lib import UrlType, EventType, Person, date, Date, ChildRefType, \
|
||||
FamilyRelType, NameType, Name
|
||||
import const
|
||||
from GrampsCfg import get_researcher
|
||||
import Sort
|
||||
from gen.plug import PluginManager
|
||||
from gen.plug.menu import PersonOption, NumberOption, StringOption, \
|
||||
@@ -88,6 +87,7 @@ from gen.plug.menu import PersonOption, NumberOption, StringOption, \
|
||||
from ReportBase import (Report, ReportUtils, MenuReportOptions, CATEGORY_WEB,
|
||||
Bibliography, CSS_FILES )
|
||||
import Utils
|
||||
from gui.utils import ProgressMeter
|
||||
import ThumbNails
|
||||
import ImgManip
|
||||
import Mime
|
||||
@@ -198,7 +198,7 @@ class BasePage(object):
|
||||
|
||||
self.page_title = ""
|
||||
|
||||
self.author = get_researcher().get_name()
|
||||
self.author = Utils.get_researcher().get_name()
|
||||
if self.author:
|
||||
self.author = self.author.replace(',,,', '')
|
||||
self.up = False
|
||||
@@ -2326,7 +2326,7 @@ class ContactPage(BasePage):
|
||||
if contactimg:
|
||||
summaryarea += contactimg
|
||||
|
||||
r = get_researcher()
|
||||
r = Utils.get_researcher()
|
||||
|
||||
with Html('div', id='researcher') as researcher:
|
||||
summaryarea += researcher
|
||||
@@ -3682,7 +3682,7 @@ class NavWebReport(Report):
|
||||
value)
|
||||
return
|
||||
|
||||
self.progress = Utils.ProgressMeter(_("Narrated Web Site Report"), '')
|
||||
self.progress = ProgressMeter(_("Narrated Web Site Report"), '')
|
||||
|
||||
# Build the person list
|
||||
ind_list = self.build_person_list()
|
||||
|
||||
@@ -54,7 +54,6 @@ log = logging.getLogger(".WebPage")
|
||||
#------------------------------------------------------------------------
|
||||
from gen.lib import date, Date, Name, Person, NameType, EventType
|
||||
import const
|
||||
from GrampsCfg import get_researcher
|
||||
from gen.plug import PluginManager
|
||||
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_WEB, \
|
||||
CSS_FILES
|
||||
@@ -63,7 +62,8 @@ from gen.plug.menu import BooleanOption, NumberOption, StringOption, \
|
||||
DestinationOption
|
||||
import GrampsLocale
|
||||
from QuestionDialog import WarningDialog
|
||||
from Utils import probably_alive, ProgressMeter, xml_lang
|
||||
from Utils import probably_alive, xml_lang, get_researcher
|
||||
from gui.utils import ProgressMeter
|
||||
from DateHandler import displayer as _dd
|
||||
|
||||
from BasicUtils import name_displayer as _nd
|
||||
|
||||
Reference in New Issue
Block a user