From 02f7142364494c085d6eebfff62f47fdf650df9b Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 4 Aug 2005 23:54:18 +0000 Subject: [PATCH] * src/ArgHandler.py (parse_args): Use mime type to identify gramps XML data. * doc/gramps.1.in: Update man page. * doc/gramps-manual/C/cmdline.xml: Update manual. * src/PeopleModel.py: provide a work around for the python 2.3 bug unicode sorting problem with locale.strcoll. For a nul termination during sorting, strip it off after sorting. Only used for python2.3, since this bug was fixed in python 2.4. svn: r5019 --- gramps2/ChangeLog | 14 ++++-- gramps2/doc/gramps-manual/C/cmdline.xml | 44 +++++++----------- gramps2/doc/gramps.1.in | 28 ++++-------- gramps2/src/ArgHandler.py | 61 +++++++++++++++---------- 4 files changed, 72 insertions(+), 75 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b10be04a5..06fdeb1bd 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -13,12 +13,16 @@ * src/po/template.po: Update for upcoming 2.0.6. * src/Report.py (parse_report_options_frame): Fallback to trivial filter on filter failure. - + * src/ArgHandler.py (parse_args): Use mime type to identify gramps + XML data. + * doc/gramps.1.in: Update man page. + * doc/gramps-manual/C/cmdline.xml: Update manual. + 2005-08-04 Don Allingham - * src/PeopleModel.py: provide a work around for the python 2.3 bug unicode - sorting problem with locale.strcoll. For a nul termination during sorting, - strip it off after sorting. Only used for python2.3, since this bug was - fixed in python 2.4. + * src/PeopleModel.py: provide a work around for the python 2.3 bug + unicode sorting problem with locale.strcoll. For a nul termination + during sorting, strip it off after sorting. Only used for + python2.3, since this bug was fixed in python 2.4. 2005-08-03 Don Allingham * src/NavWebPage.py: use new ProgressMeter, add ability to diff --git a/gramps2/doc/gramps-manual/C/cmdline.xml b/gramps2/doc/gramps-manual/C/cmdline.xml index 23a5d3779..29992cc73 100644 --- a/gramps2/doc/gramps-manual/C/cmdline.xml +++ b/gramps2/doc/gramps-manual/C/cmdline.xml @@ -70,7 +70,7 @@ gramps-xml &app; XML database. This format is available for opening, import, and export. When not specified, it can be - guessed if the filename represents a directory. + guessed if the filename ends with .gramps gedcom @@ -82,13 +82,13 @@ gramps-pkg &app; package. This format is available for import and export. When not specified, it can be - guessed if the filename ends with .tgz + guessed if the filename ends with .gpkg geneweb GeneWen file This format is available for import and export. When not specified, it can be - guessed if the filename ends with gw + guessed if the filename ends with .gw wft @@ -134,12 +134,7 @@ --format=format option, immediately following the filename. If not specified, the guess will be attempted based on - the filename. For gramps-xml - format, the filename is actually the - name of directory under which the gramps database resides. For - grdb and gedcom, - the filename is the name of the - corresponding file. + the filename. Only grdb, gramps-xml, @@ -163,12 +158,7 @@ --format=format option, immediately following the filename. If not specified, the guess will be attempted based on - the filename. For gramps-xml - format, the filename is actually the - name of directory under which the gramps database resides. For - grdb, gedcom, gramps-pkg, and geneweb, - the filename is the name of the - corresponding file. + the filename. More than one file can be imported in one command. @@ -195,10 +185,10 @@ option. The format can be specified with the -f option immediately following the filename. If not specified, the guess will be attempted based on - the filename. For gramps-xml - and iso formats, the filename + the filename. For iso format, + the filename is actually the name of directory the gramps database will be written - into. For grdb, gedcom, wft, geneweb, + into. For grdb, gramps-xml, gedcom, wft, geneweb, and gramps-pkg, the filename is the name of the resulting file. @@ -411,8 +401,8 @@ gramps -ifile1.ged - -i file2.tgz - -i ~/db3 + -i file2.gpkg + -i ~/db3.gramps -i file4.wft -a check @@ -424,10 +414,10 @@ gramps -i file1.ged -f gedcom - -i file2.tgz + -i file2.gpkg -f gramps-pkg - -i ~/db3 - -f gramps + -i ~/db3.gramps + -f gramps-xml -i file4.wft -f wft -a check @@ -441,7 +431,7 @@ gramps -i file1.ged - -i file2.tgz + -i file2.gpkg -o ~/new-package -f gramps-pkg @@ -454,7 +444,7 @@ gramps -i file1.ged - -i file2.tgz + -i file2.dpkg -o ~/new-package -f gramps-pkg >outfile @@ -468,8 +458,8 @@ gramps -i file1.ged - -i file2.tgz - -i ~/db3 + -i file2.gpkg + -i ~/db3.gramps diff --git a/gramps2/doc/gramps.1.in b/gramps2/doc/gramps.1.in index 29f06467a..0fdbd7835 100644 --- a/gramps2/doc/gramps.1.in +++ b/gramps2/doc/gramps.1.in @@ -1,4 +1,4 @@ -.TH gramps 1 "@VERSION@" "May 2005" "@VERSION@" +.TH gramps 1 "@VERSION@" "August 2005" "@VERSION@" .SH NAME gramps \- Genealogical Research and Analysis Management Programming System. @@ -59,8 +59,8 @@ the format of that file is guessed according to its extension. Formats available for opening are \fBgrdb\fR (guessed if \fIFILE\fR ends with -\fB.grdb\fR), \fBgramps\-xml\fR (guessed if \fIFILE\fR is a -directory), and \fBgedcom\fR (guessed if \fIFILE\fR ends with \fB.ged\fR). +\fB.grdb\fR), \fBgramps\-xml\fR (guessed if \fIFILE\fR ends with +\fB.gramps\fR), and \fBgedcom\fR (guessed if \fIFILE\fR ends with \fB.ged\fR). .br Formats @@ -80,10 +80,6 @@ Open \fIFILE\fR. Only \fBgrdb\fR, \fBgramps\-xml\fR, and \fBgedcom\fR formats can be opened directly. For other formats, you will need to use the import option which will set up the empty database and then import data into it. -For \fBgramps\-xml\fR format, the \fIFILE\fR -is actually the name of directory under which the gramps database resides. -For \fBgrdb\fR and \fBgedcom\fR, the \fIFILE\fR is the name of -the corresponding file. .br Only a single file can be opened. If you need to combine data from several @@ -91,11 +87,7 @@ sources, you will need to use the import option. .TP .BI \-i,\-\^\-import= " FILE" -Import data from \fIFILE\fR. For \fBgramps\-xml\fR format, the \fIFILE\fR -is actually the name of directory under which the gramps database resides. -For \fBgrdb\fR, \fBgedcom\fR, \fBgramps\-pkg\fR, and \fBgeneweb\fR, -the \fIFILE\fR is -the name of the corresponding file. +Import data from \fIFILE\fR. .br When more than one input file is given, each has to be preceded by \fB\-i\fR @@ -106,9 +98,9 @@ gramps IDs in the resulting database. .TP .BI \-o,\-\^\-output= " FILE" -Export data into \fIFILE\fR. For \fBgramps\-xml\fR and \fBiso\fR formats, the -\fIFILE\fR is actually the name of directory the gramps database will be -written into. For \fBgrdb\fR, \fBgedcom\fR, \fBwft\fR, \fBgramps\-pkg\fR, +Export data into \fIFILE\fR. For \fBiso\fR format, the \fIFILE\fR is actually +the name of directory the gramps database will be written into. +For \fBgrdb\fR, \fBgramps\-xml\fR, \fBgedcom\fR, \fBwft\fR, \fBgramps\-pkg\fR, and \fBgeneweb\fR, the \fIFILE\fR is the name of the resulting file. .br @@ -205,16 +197,16 @@ of \fIstdout\fR and \fIstderr\fR to save messages and errors in files. .SH EXAMPLES .TP To import four databases (whose formats can be determined from their names) and then check the resulting database for errors, one may type: -\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-i\fR \fI~/db3\fR \fB\-i\fR \fIfile4.wft\fR \fB\-a\fR \fIcheck\fR +\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-i\fR \fI~/db3.gramps\fR \fB\-i\fR \fIfile4.wft\fR \fB\-a\fR \fIcheck\fR .TP To explicitly specify the formats in the above example, append filenames with appropriate \fB\-f\fR options: -\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-f\fR \fIgedcom\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-f\fR \fIgramps-pkg\fR \fB\-i\fR \fI~/db3\fR \fB\-f\fR \fIgramps\fR \fB\-i\fR \fIfile4.wft\fR \fB\-f\fR \fIwft\fR \fB\-a\fR \fIcheck\fR +\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-f\fR \fIgedcom\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-f\fR \fIgramps-pkg\fR \fB\-i\fR \fI~/db3.gramps\fR \fB\-f\fR \fIgramps-xml\fR \fB\-i\fR \fIfile4.wft\fR \fB\-f\fR \fIwft\fR \fB\-a\fR \fIcheck\fR .TP To record the database resulting from all imports, supply \fB\-o\fR flag (use \fB\-f\fR if the filename does not allow gramps to guess the format): \fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-o\fR \fI~/new-package\fR \fB\-f\fR \fIgramps-pkg\fR .TP To import three databases and start interactive gramps session with the result: -\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-i\fR \fI~/db3\fR +\fBgramps\fR \fB\-i\fR \fIfile1.ged\fR \fB\-i\fR \fIfile2.tgz\fR \fB\-i\fR \fI~/db3.gramps\fR .TP Finally, to start normal interactive session type: \fBgramps\fR diff --git a/gramps2/src/ArgHandler.py b/gramps2/src/ArgHandler.py index 8cade7600..a69c3068c 100644 --- a/gramps2/src/ArgHandler.py +++ b/gramps2/src/ArgHandler.py @@ -127,7 +127,8 @@ class ArgHandler: o,v = options[opt_ix] if o in ( '-O', '--open'): fname = v - ftype = GrampsMime.get_type(os.path.abspath(os.path.expanduser(fname))) + ftype = GrampsMime.get_type( + os.path.abspath(os.path.expanduser(fname))) if opt_ix