Difference between revisions of "Fr:Manuel wiki pour Gramps 3.0 - Les lignes de commande"

From Gramps
Jump to: navigation, search
(Options disponibles)
(Options disponibles)
Line 11: Line 11:
 
== Options disponibles ==
 
== Options disponibles ==
  
Voici la liste des options de lancement de GRAMPS. Si vous voulez connaître plus d'options, voir [[Gramps-command line#Opération|Opération]] et [[Gramps-command line#Exemples| Exemples]].
+
Voici la liste des options de lancement de GRAMPS. Si vous voulez connaître plus d'options, voir Opération et Exemples.
 
=== Options de format ===
 
=== Options de format ===
  

Revision as of 16:48, 31 March 2008

Cette annexe décrit les possibilités offertes par GRAMPS en ligne de commande, depuis un terminal.

Gramps-notes.png
Note

GRAMPS was designed to be an interactive program. Therefore it uses graphical display and cannot run from the true non-graphical console. It would take an enormous amount of effort to enable it to run in a text-only terminal. This is why the set of command line options does not aim to completely get rid of dependency on the graphical display. Rather, it merely makes certain (typical) tasks more convenient. It also allows one to execute these tasks from the scripts. However, the graphical display must be accessible at all times!

Tango-Dialog-information.png
Tip

To summarize, the use of the command line options provides non-interactive behavior, but does not get rid of graphical display dependency. Take it or leave it!


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


Options disponibles

Voici la liste des options de lancement de GRAMPS. Si vous voulez connaître plus d'options, voir Opération et Exemples.

Options de format

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: This format is available for opening, import, and export. When not specified, it can be guessed if the filename ends with .grdb
  • gramps-xml GRAMPS XML database: This format is available for opening, import, and export. When not specified, it can be guessed if the filename ends with .gramps
  • gedcom GEDCOM file: This format is available for opening, import, and export. When not specified, it can be guessed if the filename ends with .ged
  • gramps-pkg GRAMPS package: This format is available for import and export. When not specified, it can be guessed if the filename ends with .gpkg
  • geneweb GeneWeb file: This format is available for import and export. When not specified, it can be guessed if the filename ends with .gw
  • wft Web Family Tree: This format is available for export only. When not specified, it can be guessed if the filename ends with .wft
  • iso CD image: This format is available for export only. It must always be specified explicitly.

Options d'ouverture

Il y a deux manières de donner à GRAMPS le nom du fichier à ouvrir :

  • 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

Si le nom du fichier est donné sans options, GRAMPS ouvrira sa fenêtre principale et commencera une session.

Tango-Dialog-information.png
Tip

If no option is given, just the file name, GRAMPS will ignore the rest of the command line arguments. Use the -O flag to open the file and do something with the data.


The format can be specified with the

-f format

or

--format=format

option, immediately following the filename . If not specified, the guess will be attempted based on the filename. Format possible: 'gedcom','gramps-xml','gramps-pkg', 'grdb','geneweb'.

Tango-Dialog-information.png
Tip

Only grdb, gramps-xml, and gedcom 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.


Tango-Dialog-information.png
Tip

Seulement, un fichier peut être ouvert par GRAMPS. Si vous avez besoin d'ouvrir depuis plusieurs sources, utilisez l'option d'importation
-i
.


Options d'importation

Les dossiers destinés à l'importation peuvent être indiqués avec

-i ''nom du fichier''

ou

--import=''nom du fichier''

Le format peut être indiqué avec l'option

-f format

ou

--format=format

juste aprèsnom de fichier. Pour le format gramps-xml,le nom du fichier est réellement le nom du répertoire sous lequel la base de données de gramps réside. Pour grdb, gedcom, gramps-pkg, et geneweb, le nom du fichier est le nom du fichier correspondant.

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
Tip

Plus d'un fichier peut être exporté dans une commande. Si c'est le cas, GRAMPS essayera d'écrire plusieurs fichiers en utilisant les données de la base de données disponible à l'heure actuelle.


Quand plus d'un dossier d'entrée est donné, chacun doit être par précédé de

-i

Les dossiers sont importés dans l'ordre indiqué, c.-à-d..

 -i ''fichier1'' -i ''fichier2''

and

 -i ''fichier2'' -i ''fichier1''

pourraient produire différentes versions dans la base de données résultant.

Options d'exportation

Les dossiers destinés à l'exportation peuvent être indiqués avec

-o ''nom du fichier''

ou

--output=''nom du fichier''

Le format peut être indiqué avec l'option

-f

juste après le nom du fichier. Pour gramps-xml et les formats iso, nom du fichier est réellement le nom du répertoire la base de données de gramps. Pour grdb, gedcom, wft, geneweb, et gramps-pkg,le nom du fichier est le nom du dossier résultant.

-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.


Quand plus d'un fichier est donné, chacun doit être par précédé par

-o

Les dossiers sont écrits dans l'ordre indiqué.

Options d'action

L'action à exécuter sur les données importées peut être indiquée avec

-a action

ou

--action=action

Ceci est fait après que toutes les importations soient accomplies avec succès.

Les actions actuellement disponibles sont :

  • summary : cette action est identique à Rapports ->Vue ->Sommaire
  • check : cette action est identique à Outils ->Traitement de la Base de données ->contrôle et réparation.
  • tool : cette annexe décrit les possibilités offertes par GRAMPS en ligne de commande, depuis un terminal.
  • rapport : cette action laisse produire des rapports à partir de la ligne de commande. Car les rapports ont généralement beaucoup d'options propres, cette action devrait être suivie de la chaîne d'option du rapport. La chaîne est donnée en utilisant
    -p option_string
    ou
    --options=option_string
    .
Tango-Dialog-information.png
Report option string

The report option string should satisfy the following conditions:It must not contain any spaces. If some arguments need to include spaces, the string should be enclosed with quotation marks. Option string must list pairs of option names and values. Within a pair, option name and value must be separated by the equal sign. Different pairs must be separated by commas.


La plupart des options de rapport sont spécifiques pour chaque rapport. Cependant, il y a quelques options communes.

  • Cette option obligatoire détermine quel rapport sera produit. Si le report_name ne correspond à aucun rapport disponible, le message d'erreur sera affiché à la suite de la liste de rapports disponibles.
  • show=all: This will produce the list of names for all options available for a given report.
  • show=option_name: This will print the description of the functionality supplied by the option_name, as well as what are the acceptable types and values for this option.

Employez les options ci-dessus pour découvrir tout au sujet d'un rapport présenté.

Tango-Dialog-information.png
Tip

If an option is not supplied, the last used value will be used. If this report has never been generated before, then the value from last generated report will be used when applicable. Otherwise, the default value will be used.


Quand plus d'une action à produire est donnée, chacunes doivent être par précédé

-a

. Les actions sont effectuées dans l'ordre indiqué.

Liste des options

-l

, rapporte une liste des arbres familiaux

Opération

Si le premier argument sur la ligne de commande ne commence pas par le tiret, GRAMPS essayera d'ouvrir le dossier avec le nom donné par le premier argument et de commencer la session interactive, ignorant le reste des arguments de ligne de commande.

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. L'ordre des options

-i

,

-o

, ou

-a

entre elles n'a pas de signification. L'ordre réel d'exécution est toujours : les lectures (s'il y en a) puis les écritures (s'il y en a) et enfin les actions (s'il y en a).

'

Gramps-notes.png
Note

Mais ouvrir doit toujours être en premier !

Si aucune option

-O

ou

-i

n'est donnée, gramps ouvrira sa fenêtre principale et commencera une session interactive avec un ensemble vide de données puisqu'il n'y a pas de données à traiter. Si aucune option

-o

ou

-a

n'est donnée, gramps ouvrira sa fenêtre principale et commencera une session interactive avec les données lues. import_db.grdb se situera dans le répertoire ~/.gramps/import/.

Les erreurs trouvées pendant les phases de lecture, d'écriture et d'action sont rapportées soit sur la sortie standard quand elles sont gérées par gramps, soit sur la sortie d'erreur dans le cas contraire. Utilisez les redirections du shell pour les conserver dans des fichiers.

Exemples

  • Lecture de quatre bases de données dont les formats peuvent être devinés d'après les noms, puis vérification des données :
gramps -i file1.ged -i file2.gpkg -i ~/db3.gramps -i file4.wft -a check
  • Si vous voulez préciser les formats de fichiers dans l'exemple ci-dessus, complétez les noms de fichiers par les options
    -f
    appropriées :
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
  • Pour enregistrer le résultat des lectures, donnez l'option
    -o
    (utiliser
    -f
    si le nom de fichier ne permet pas à gramps de deviner le format) :
gramps -i file1.ged -i file2.gpkg -o ~/new-package -f gramps-pkg
  • Pour sauver les erreurs de l'exemple précédent dans les fichiers outfile et errfile, lancez :
gramps -i file1.ged -i file2.dpkg -o ~/new-package -f gramps-pkg >outfile 2>errfile 
  • Pour lire trois ensembles de données puis lancer une session interactive de gramps sur le tout:
gramps -i file1.ged -i file2.gpkg -i ~/db3.gramps 
  • Pour ouvrir une base de données, produisant un rapport temporel dans le format pdf et l'enregistrant sous le fichier
    my_timeline.pdf
     :
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
  • Enfin, pour lancer une session interactive normale, entrez :
gramps 

Variables d'environnement

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.
Previous [[Gramps {{{3}}} Wiki Manual| Index]] Next