* src/ArgHandler (handle_args): Natively open XML and GEDCOM
when given a single filename argument. * src/gramps_main.py (read_gedcom,read_xml): Remove ununsed functions. svn: r4029
This commit is contained in:
parent
358f4a592f
commit
21da722351
@ -2,6 +2,10 @@
|
|||||||
* src/ReadGrdb.py: Check for overlapping handles prior to
|
* src/ReadGrdb.py: Check for overlapping handles prior to
|
||||||
modifying data.
|
modifying data.
|
||||||
|
|
||||||
|
* src/ArgHandler (handle_args): Natively open XML and GEDCOM
|
||||||
|
when given a single filename argument.
|
||||||
|
* src/gramps_main.py (read_gedcom,read_xml): Remove ununsed functions.
|
||||||
|
|
||||||
2005-02-12 Don Allingham <dallingham@users.sourceforge.net>
|
2005-02-12 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
* src/plugins/NavWebPage.py: More enhancements
|
* src/plugins/NavWebPage.py: More enhancements
|
||||||
* src/Sort.py: sort places by title
|
* src/Sort.py: sort places by title
|
||||||
|
@ -254,15 +254,22 @@ class ArgHandler:
|
|||||||
success = False
|
success = False
|
||||||
filename = os.path.abspath(os.path.expanduser(self.open_gui))
|
filename = os.path.abspath(os.path.expanduser(self.open_gui))
|
||||||
filetype = GrampsMime.get_type(filename)
|
filetype = GrampsMime.get_type(filename)
|
||||||
if filetype == const.app_gramps:
|
if filetype in (const.app_gramps,const.app_gedcom,
|
||||||
print "Type: GRAMPS database"
|
const.app_gramps_xml):
|
||||||
|
# Say the type outloud
|
||||||
|
if filetype == const.app_gramps:
|
||||||
|
print "Type: GRAMPS database"
|
||||||
|
elif filetype == const.app_gedcom:
|
||||||
|
print "Type: GEDCOM file"
|
||||||
|
elif filetype == const.app_gramps_xml:
|
||||||
|
print "Type: GRAMPS XML database"
|
||||||
|
|
||||||
if self.auto_save_load(filename):
|
if self.auto_save_load(filename):
|
||||||
print "Opened successfully!"
|
print "Opened successfully!"
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
print "Cannot open %s. Exiting..."
|
print "Cannot open %s. Exiting..."
|
||||||
elif filetype in (const.app_gedcom,"x-directory/normal",
|
elif filetype in (const.app_gramps_package,):
|
||||||
const.app_gramps_package):
|
|
||||||
QuestionDialog.OkDialog( _("Opening non-native format"),
|
QuestionDialog.OkDialog( _("Opening non-native format"),
|
||||||
_("New GRAMPS database has to be set up when opening non-native formats. The following dialog will let you select the new database."),
|
_("New GRAMPS database has to be set up when opening non-native formats. The following dialog will let you select the new database."),
|
||||||
self.parent.topWindow)
|
self.parent.topWindow)
|
||||||
@ -273,12 +280,6 @@ class ArgHandler:
|
|||||||
_('GRAMPS cannot open non-native data without setting up new GRAMPS database.'))
|
_('GRAMPS cannot open non-native data without setting up new GRAMPS database.'))
|
||||||
print "Cannot continue without native database. Exiting..."
|
print "Cannot continue without native database. Exiting..."
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
elif filetype == const.app_gedcom:
|
|
||||||
print "Type: GEDCOM"
|
|
||||||
self.parent.read_gedcom(filename)
|
|
||||||
elif filetype == "x-directory/normal":
|
|
||||||
print "Type: GRAMPS XML"
|
|
||||||
self.parent.read_xml(filename)
|
|
||||||
elif filetype == const.app_gramps_package:
|
elif filetype == const.app_gramps_package:
|
||||||
print "Type: GRAMPS package"
|
print "Type: GRAMPS package"
|
||||||
self.parent.read_pkg(filename)
|
self.parent.read_pkg(filename)
|
||||||
|
@ -1027,28 +1027,6 @@ class Gramps:
|
|||||||
if self.active_person:
|
if self.active_person:
|
||||||
Plugins.ReportPlugins(self,self.db,self.active_person)
|
Plugins.ReportPlugins(self,self.db,self.active_person)
|
||||||
|
|
||||||
def read_gedcom(self,filename):
|
|
||||||
import ReadGedcom
|
|
||||||
|
|
||||||
filename = os.path.normpath(os.path.abspath(filename))
|
|
||||||
try:
|
|
||||||
ReadGedcom.importData(self.db,filename,None)
|
|
||||||
self.import_tool_callback()
|
|
||||||
except:
|
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
def read_xml(self,filename):
|
|
||||||
import ReadXML
|
|
||||||
|
|
||||||
filename = os.path.normpath(
|
|
||||||
os.path.abspath(os.path.join(filename,const.xmlFile)))
|
|
||||||
|
|
||||||
try:
|
|
||||||
ReadXML.importData(self.db,filename,None)
|
|
||||||
self.import_tool_callback()
|
|
||||||
except:
|
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
def read_pkg(self,filename):
|
def read_pkg(self,filename):
|
||||||
# Create tempdir, if it does not exist, then check for writability
|
# Create tempdir, if it does not exist, then check for writability
|
||||||
tmpdir_path = os.path.expanduser("~/.gramps/tmp" )
|
tmpdir_path = os.path.expanduser("~/.gramps/tmp" )
|
||||||
|
Loading…
Reference in New Issue
Block a user