De:Gramps 3.0 Wiki Handbuch - Kommandozeilen Referenz

From Gramps
Revision as of 16:42, 17 October 2008 by Romjerome (talk | contribs) (Action options)
Jump to: navigation, search

Dieser Anhang liefert eine Referent über die Möglichkeiten, wenn Sie GRAMPS aus dem Terminal starten.

Gramps-notes.png
Note

GRAMPS wurde als ein interaktives Programm entworfen. Deshalb benutzt es eine grafische Ansicht und kann nicht von eine echten nicht-grafischen Konsole gestartet werden. Es würde einen enormen Aufwand darstellen eine Ausführung in einem Nur-Text Terminal zu ermöglichen. Aus diesem Grund zielen die möglichen Befehlszeilenparameter nicht darauf ab, komplett auf die grafisch Anzeige zu verzichten. Eher machen sie einige typische Aufgaben angenehmer. Sie erlauben Ihnen auch diese Aufgaben aus Skripten heraus auszuführen. Jedenfalls muss die grafische Anzeige immer verfügbar sein!

Tango-Dialog-information.png
Tip

Zusammengefasst bietet die Benutzung der Befehlszeilenparameter nicht-interaktives Verhalten, aber beseitigt nicht die Abhängigkeit von der grafischen Anzeige. Mach, was du willst!



Gnome-important.png Special copyright notice: All edits to this page need to be under two different copyright licenses:

These licenses allow the Gramps project to maximally use this wiki manual as free content in future Gramps versions. If you do not agree with this dual license, then do not edit this page. You may only link to other pages within the wiki which fall only under the GFDL license via external links (using the syntax: [https://www.gramps-project.org/...]), not via internal links.
Also, only use the known Typographical conventions


Zurück [[De:Gramps_{{{3}}}_Wiki_Handbuch| Index]] Nächste



Available options

Dieser Abschnitt bietet eine Liste aller in GRAMPS verfügbaren Befehlszeilen Parameter. Wenn Sie mehr wissen wollen als nur eine Liste von Parametern, schauen Sie in die nächsten Abaschnitte: Operation and Examples.

Format options

The format of any file destined for opening, importing, or exporting can be specified with the

-f format

option. The acceptable format values are listed below.

  • grdb GRAMPS database: GRAMPS Datenbank. Dieses Format ist für Öffnen, den Import und den Export verfügbar. Falls nicht angegeben wird es gesetzt, wenn der Dateiname mit .grdb endet.
  • gramps-xml GRAMPS XML database: GRAMPS XML Datenbank. Dieses Format ist für Öffnen, den Import und den Export verfügbar. Falls nicht angegeben wird es gesetzt, wenn der Dateiname mit .gramp endet.
  • gedcom GEDCOM file: GEDCOM-Datei. Dieses Format ist für den Import und den Export verfügbar. Falls nicht angegeben wird es gesetzt, wenn der Dateiname mit .ged endet.
  • gramps-pkg GRAMPS package: GRAMPS-Paket. Dieses Format ist für den Import und Export verfügbar. Falls nicht angegeben wird es gesetzt, wenn der Dateiname mit .gpkg endet.
  • geneweb GeneWeb file: GeneWeb Datei. Dieses Format ist für den Import und Export verfügbar. Falls nicht angegeben wird es gesetzt, wenn der Dateiname mit .gw endet.
  • wft Web Family Tree: Web Family Tree. Dieses Format ist nur für den Export verfügbar. Falls nichts angegeben wird es gesetzt, wenn der Dateiname mit .wft endet.
  • iso CD image: CD-Image. Dieses Format ist nur für den Export verfügbar. Es muss immer ausdrücklich angegeben werden.

Opening options

Es gibt zwei Möglichkeiten GRAMPS den Namen der zu öffnenden Datei mitzuteilen:

  • supply bare file name
  • use this option :
    -O filename
    or
    --open=filename 

-O, Open of a family tree. This can be done also by just typing the name (name or database dir)

Examples:

python gramps.py 'Family Tree 1'
python gramps.py /home/cristina/.gramps/grampsdb/47320f3d
python gramps.py -O 'Family Tree 1'
python gramps.py -O /home/cristina/.gramps/grampsdb/47320f3d


Tango-Dialog-information.png
Beispiel Ratschlag

Wenn der Dateiname ohne Option angegeben wird, versucht GRAMPS die Datei zu öffnen und anschliessend eine interaktive Arbeitssitzung gestartet.


Das Format kann festgelegt werden mit dem

-f format

oder

--format=format

parameter, direkt gefolgt vom Dateinamen. Wenn nicht angegeben, wird versucht es aus dem Dateinamen zu ermitteln.

Tango-Dialog-information.png
Beispiel Ratschlag

Nur grdb, gramps-xml, und gedcom Formate können direkt geöffnet werden. Für andere Formate benötigen Sie die Importoption, welche die leere Datenbank einrichtet und dann die Daten in sie importiert.


Tango-Dialog-information.png
Beispiel Ratschlag

Es kann nur eine Datei geöffnet werden. Wenn Sie Daten aus verschiedenen Quellen kombinieren müssen, benötigen Sie die Importoption.


Import options

Die für den Import vorgesehenen Dateien können mit dem

-i filename

oder

--import=Dateiname

Parameter angegeben werden. Das Format kann mit dem -f oder --format=Format Parameter bestimmt werden, der sofort auf dem Dateiname folgt. Falls es nicht angegeben wird, wird versucht das Format aus dem Dateiname zu ermitteln.

Example:

  python gramps.py -i 'Family Tree 1' -i 'Family Tree 2'
  python gramps.py -i test.grdb -i data.gramps
Tango-Dialog-information.png
Beispiel Ratschlag

More than one file can be imported in one command. If this is the case, GRAMPS will incorporate the data from the next file into the database available at the moment.


Falls mehr als eine Eingabedatei angegeben wird, muss jeder einem -i folgen. Die Dateien werden in der angegebenen Reihenfolge importiert, z.B. -i Datei1 -i Datei2 und -i Datei2 -i Datei1 es könnte verschiedene GRAMPS-ID's in der resultierenden Datenbank entstehen..

Export options

Die für den Export vorgesehenen Dateien können mit dem Parameter

-o Dateiname

oder

--output=Dateinamean

gegeben werden. Das Format kann mit dem -f Parameter bestimmt werden, der sofort auf dem Dateinamen folgt. Falls er nicht angegeben wird, wird versucht das Format aus dem Dateinamen zu ermitteln. Für iso-Formate, ist der Dateiname der Name des Verzeichnisses, in das die GRAMPS-Datenbank geschrieben wird. Für grdb, gramps-xml, gedcom, wft und gramps-pkg ist der Dateiname der Name der resultierenden Datei.

-o, output a family tree in required format. It is not possible to export to a family tree.

Example:

 python gramps.py -i 'Family Tree 1' -i test.grdb -f grdb -o mergdeDB.gramps

Note that above does not change 'Family Tree 1' as everything happens via a temporary database, whereas:

 python gramps.py -O 'Family Tree 1' -i test.grdb -f grdb -o mergdeDB.gramps

will import test.grdb into Family Tree 1, and then export to a file !

Tango-Dialog-information.png
Exporting more files

More than one file can be exported in one command. If this is the case, GRAMPS will attempt to write several files using the data from the database available at the moment.


Wenn mehr als eine Ausgabedatei angeben wird, muss jede auf einem -o-Parameter folgen. Diese Dateien werden nacheinander geschrieben, in der angegebenen Reihenfolge.

Action options

The action to perform on the imported data can be specified with the

-a action

or

--action=action

option. This is done after all imports are successfully completed.

Zur Zeit verfügbare Aktionen sind:

  • summary: Diese Aktion ist die selbe wie BerichteAnsichtenDatenbankübersicht Reports ->View ->Summary
  • check: Diese Aktion ist die selbe wie WerkzeugeReparieren der DatenbankDatenbank prüfen und reparieren. Tools ->Database Processing ->Check and Repair .
  • tool: This action allow to run a tool from a command line.
  • report: Diese Aktion erlaubt das erstellen von Berichten über die Kommandozeile. Da Berichte eine Reihe eigener Optionen haben, sollten dieser Aktion die Berichtsoptionenzeichenkette folgen. Die Zeichenkette wird mit der
    -p Optionszeichenkette
    oder
    --options=Optionszeichenkette
    Option übergeben.
Tango-Dialog-information.png
Report option string

Die Berichtsoption sollte folgende Bedingungen erfüllen: Sie darf keine Leerzeichenenthalten. Wenn eine Option Leerzeichen enthält, sollte sie in Anführungszeichen eingeschlossen werden. Eine Option besteht aus dem Optionsnamen und dem Wert. In einer Option müssen der Optionsname und Optionswert durch ein Gleichheitszeichen getrennt werden. Verschiedene Paare müssen durch Komma getrennt werden. Die meiten Bericht Optionen sind speziell für jeden Bericht. Allerdings gibt es einige allgemeine Optionen.


Most of the report options are specific for every report. However, there some common options.

  • name=report_name: Diese benötigte Option bestimmt welcher Bericht erzeugt wird. Wenn der übergebene Bericht_Name nicht mit einem verfügbaren Bericht übereinstimmt, wird eine Fehlermeldung gefollgt von einer Liste verfügbarer Berichte ausgegeben.
  • show=all: Dies erstellt eine Liste der Namen aller verfügbaren Optionen für den angegebenen Bericht.
  • show=option_name: Dies zeigt die Beschreibung der funktionalität die durch Option_Name bereit gestellt wird, genauso wie die akzeptierten Arten und Werte für diese Option.

Benutzen Sie die obigen Optionen um alles über einen angegebenen Bericht herauszufinden.

Tango-Dialog-information.png
Tip

Wenn ein Parameter nicht angegeben wird, wird der zuletzt verwendete Wert benutzt. Wenn dieser Bericht vorher nie erstellt wurde, wird wenn möglich der Wert des zuletzt erstellten Berichts benutzt. Sonnst wird der Standardwert verwendet.


Wenn mehr als eine Ausgabeaktion angegeben wird, muss jede auf einem -a Parameter folgen. Die Aktionen werden nacheinander in der entsprechenden Reihenfolge durchgeführt.

List option

-l, print a list of known family trees

Operation

If the first argument on the command line does not start with dash (i.e. no flag), GRAMPS will attempt to open the file with the name given by the first argument and start interactive session, ignoring the rest of the command line arguments.

If the

-O

flag is given, then GRAMPS will try opening the supplied file name and then work with that data, as instructed by the further command line parameters.

Gramps-notes.png
Note

Only one file can be opened in a single invocation of GRAMPS. If you need to get data from multiple sources, use the importing options by using
-i
flag.

With or without the

-O

flag, there could be multiple imports, exports, and actions specified further on the command line by using

-i

,

-o

, and

-a

flags. The order of

-i

,

-o

, or

-a

options with respect to each does not matter. The actual execution order always is: all imports (if any) -> all exports (if any) -> all actions (if any).

'

Gramps-notes.png
Note

But opening must always be first!

If no

-O

or

-i

option is given, GRAMPS will launch its main window and start the usual interactive session with the empty database, since there is no data to process, anyway. If no

-o

or

-a

options are given, GRAMPS will launch its main window and start the usual interactive session with the database resulted from opening and all imports (if any). This database resides in the import_db.grdb file under the ~/.gramps/import/ directory.

Any errors encountered during import, export, or action, will be either dumped to stdout (if these are exceptions handled by GRAMPS) or to stderr (if these are not handled). Use usual shell redirections of stdout and stderr to save messages and errors in files.

Examples

  • To import four databases (whose formats can be determined from their names) and then check the resulting database for errors, one may type:
gramps -i file1.ged -i file2.gpkg -i ~/db3.gramps -i file4.wft -a check
  • To explicitly specify the formats in the above example, append filenames with appropriate -f options:
gramps -i file1.ged -f gedcom -i file2.gpkg -f gramps-pkg -i ~/db3.gramps -f gramps-xml -i file4.wft -f wft -a check
  • To record the database resulting from all imports, supply -o flag (use -f if the filename does not allow GRAMPS to guess the format):
gramps -i file1.ged -i file2.gpkg -o ~/new-package -f gramps-pkg
  • To save any error messages of the above example into files outfile and errfile, run:
gramps -i file1.ged -i file2.dpkg -o ~/new-package -f gramps-pkg >outfile 2>errfile 
  • To import three databases and start interactive GRAMPS session with the result:
gramps -i file1.ged -i file2.gpkg -i ~/db3.gramps 
  • To open a database and, based on that data, generate timeline report in PDF format putting the output into the my_timeline.pdf file:
gramps -O file.grdb -a report -p name=timeline,off=pdf,of=my_timeline.pdf 
Tango-Dialog-information.png
Timeline report options

Use the name=timeline,show=all to find out about all available options for the timeline report. To find out details of a particular option, use show=option_name , e.g. name=timeline,show=off string. To learn about available report names, use name=show string.


  • To convert a grdb on the fly to a .gramps xml file:
gramps -O myoriginal.grdb -o output.gramps -f gramps-xml
  • Finally, to start normal interactive session type:
gramps 

Environment variables

GRAMPS can take advantage of these environment variables (but do not change them if you do not know what are you doing):

  • GRAMPSHOME - if set, override default path to profile allowing user to use ex. network drive to store data and all settings.
  • LANG - is used by GRAMPS to determine which language file should be loaded.


Zurück [[De:Gramps_{{{3}}}_Wiki_Handbuch| Index]] Nächste