Re: does Dia have a Python script interface?
- From: Carlo Calderoni <calderoni carlo gmail com>
- To: discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: does Dia have a Python script interface?
- Date: Wed, 16 Jun 2010 13:42:52 +0200
Hi,
if you just need to export a diagram to PNG or JPG file, you can do it from shell (or by system or similar in python) with this command line:
dia -e my_diagram.jpg -t jpg my_diagram.dia
This doesn't start dia in interactive mode, "-e" option let you set destination file name, "-t" option let you chose the exported file format. With a "-L" option you can chose which layers to show. From command line try a "dia --help" to have a look at more options.
Dia has a python plugin too; launch Dia and in diagram menu "Dialogs" you can find a python console (for sure in dia v 0.97).
You can write python scripts and put them in "~/.dia/python" directory. You can call them via dia python console or map them in dia menu entries.
- download and save it in "~/.dia/python/dumpObj.py"
- launch Dia and open python console
- in console import the file with "import dumpObj"
- in console do "dumpObj.dumpObj(dia)" to examine the main dia class or its methods and subclasses
I hope to be useful
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]