Commit 4e9e7ab9 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 1.10

parents
Jeremy Sanders <jeremy@jeremysanders.net>
http://www.jeremysanders.net/
James Graham <jg307@cam.ac.uk>
This diff is collapsed.
This diff is collapsed.
Just some notes on the interface design...
------------------------------------------
AddGraph('function', 'x**2', name='fn')
AddGraph('xy', 'x', 'y', name='data')
(alias AG)
AddContainer('grid', columns=3)
(alias AC)
List() - list graphs in current container
(alias L)
Save('filename.rap')
Load('filename.rap')
WriteFile('eps', 'filename.eps')
(alias WF)
Change('fn')
(alias C)
GraphUp()
(alias U)
ReadFile('descriptor', 'filename.dat')
(alias RF)
SetData('x', numarray, symerr=var1, negerr=var2, poserr=var2)
Attribute('AxisLabel.text', 'axis')
(alias A)
AttributeAxis('x', 'AxisLabel.text', 'axis')
(alias AA)
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##############################################################################
# $Id: document_api.py 1197 2010-03-17 20:04:57Z jeremysanders $
"""
Document veusz widget types and settings
Creates an xml file designed to be processed into a web page using xsl
"""
import re
import veusz.widgets as widgets
import veusz.document as document
import veusz.setting as setting
#import cElementTree as ET
#import elementtree.ElementTree as ET
import xml.etree.ElementTree as ET
def processSetting(parent, setn):
"""Convert setting to xml element."""
setnxml = ET.SubElement(parent, "setting")
ET.SubElement(setnxml, "apiname").text = setn.name
ET.SubElement(setnxml, "displayname").text = setn.usertext
ET.SubElement(setnxml, "description").text = setn.descr
ET.SubElement(setnxml, "formatting").text = str(setn.formatting)
typename = str(type(setn))
typename = re.match(r"^<class '(.*)'>$",
typename).group(1)
typename = typename.split('.')[-1]
ET.SubElement(setnxml, "type").text = typename
# show list of possible choices if there is one
if isinstance(setn, setting.Choice):
for choice in setn.vallist:
ET.SubElement(setnxml, "choice").text = choice
if not isinstance(setn.default, setting.Reference):
ET.SubElement(setnxml, "default").text = setn.toText()
else:
ET.SubElement(setnxml, "default").text = "to reference"
def processSettings(parent, setns):
"""Convert setting to xml element."""
setnsxml = ET.SubElement(parent, "settings")
ET.SubElement(setnsxml, "apiname").text = setns.name
ET.SubElement(setnsxml, "displayname").text = setns.usertext
ET.SubElement(setnsxml, "description").text = setns.descr
for s in setns.getSettingList():
processSetting(setnsxml, s)
def processWidgetType(root, name):
"""Produce documentation for a widget type."""
widgetxml = ET.SubElement(root, "widget")
klass = document.thefactory.getWidgetClass(name)
print klass
ET.SubElement(widgetxml, "apiname").text = name
try:
ET.SubElement(widgetxml, "description").text = klass.description
except AttributeError:
pass
for parent in [k for k in klass.allowedparenttypes if k is not None]:
ET.SubElement(widgetxml, "allowedparent").text = parent.typename
ET.SubElement(widgetxml, "usercreation").text = str(klass.allowusercreation)
thesettings = setting.Settings('')
klass.addSettings(thesettings)
#for s in thesettings.getSettingList():
processSettings(widgetxml, thesettings)
for s in thesettings.getSettingsList():
processSettings(widgetxml, s)
def indent(elem, level=0):
"""Indent output, from elementtree manual."""
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
indent(elem, level+1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i
def addXSL(filename):
f = open(filename)
l = f.readlines()
f.close()
l.insert(1, '<?xml-stylesheet type="text/xsl" href="widget_doc.xsl"?>\n')
f = open(filename, 'w')
f.writelines(l)
f.close()
def main():
widgettypes = document.thefactory.listWidgets()
root = ET.Element("widgets")
for wt in widgettypes:
processWidgetType(root, wt)
tree = ET.ElementTree(root)
indent(root)
tree.write('widget_doc.xml', encoding="utf8")
addXSL('widget_doc.xml')
if __name__ == '__main__':
main()
#!/usr/bin/env bash
# Copyright (C) 2009 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##############################################################################
# generate the output manual files from the input docbook file
# DO NOT EDIT THE OUTPUT FILES!
infile=manual.xml
docbook2pdf $infile
docbook2html -u $infile
docbook2txt $infile
release=$(cat ../VERSION)
pod2man --release=${release} --center="Veusz" veusz.pod > veusz.1
pod2man --release=${release} --center="Veusz" veusz_listen.pod > veusz_listen.1
###################################################################
# $Id: generate_manual.sh 1465 2010-12-01 17:20:48Z jeremysanders $
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "VEUSZ 1"
.TH VEUSZ 1 "2010-12-12" "1.10" "Veusz"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Veusz \- a scientific plotting and graphing application.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
veusz [\fIoptions\fR] [\fIdocument.vsz\fR]...
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBVeusz\fR is a scientific plotting and graphing package. It is designed
to create publication-ready output in a variety of different output
formats. Graphs are built-up combining plotting widgets. Veusz has a
\&\s-1GUI\s0 user interface (started with the \f(CW\*(C`veusz\*(C'\fR command), a Python
module interface and a scripting interface.
.PP
If started without command line arguments, \fBVeusz\fR will open up with
a new empty document. The program will otherwise open the listed
documents.
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-\-unsafe\-mode\fR" 8
.IX Item "--unsafe-mode"
Do not check opened scripts for the presence of unsafe Python
commands. This allows you to create or open complete Python scripts
with Veusz commands if they come from a trusted source.
.IP "\fB\-\-listen\fR" 8
.IX Item "--listen"
Read Veusz commands from stdin, executing them, then writing the
results to stdout. This option is intended to replace the veusz_listen
standalone program.
.Sp
In this mode Veusz does not read any input documents, but will use the
first argument to the program as the window title, if given.
.IP "\fB\-\-quiet\fR" 8
.IX Item "--quiet"
If in listening mode, do not open a window before running commands,
but execute them quietly.
.IP "\fB\-\-export\fR=\fI\s-1FILE\s0\fR" 8
.IX Item "--export=FILE"
Export the next Veusz document file on the command line to the
graphics file \fI\s-1FILE\s0\fR. Supported file types include \s-1EPS\s0, \s-1PDF\s0, \s-1SVG\s0,
\&\s-1PNG\s0, \s-1BMP\s0 and \s-1JPG\s0. The extension of the output file is used to
determine the output file format. There should be as many export
options specified as input Veusz documents on the command line.
.IP "\fB\-\-help\fR" 8
.IX Item "--help"
Displays the options to the program and exits.
.IP "\fB\-\-version\fR" 8
.IX Item "--version"
Displays information about the currently installed version and exits.
.SH "BUGS"
.IX Header "BUGS"
Please report bugs at https://gna.org/bugs/?group=veusz
.SH "AUTHORS"
.IX Header "AUTHORS"
\&\fBVeusz\fR was written by Jeremy Sanders <jeremy@jeremysanders.net>.
.PP
This manual page was written by Jeremy Sanders <jeremy@jeremysanders.net>.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 2003\-2010 Jeremy Sanders <jeremy@jeremysanders.net>.
.PP
This program is free software; you can redistribute it and/or modify it
under the terms of the \s-1GNU\s0 General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
.PP
On Debian GNU/Linux systems, the complete text of the \s-1GNU\s0 General
Public License can be found in `/usr/share/common\-licenses/GPL'.
=head1 NAME
Veusz - a scientific plotting and graphing application.
=head1 SYNOPSIS
veusz [I<options>] [F<document.vsz>]...
=head1 DESCRIPTION
B<Veusz> is a scientific plotting and graphing package. It is designed
to create publication-ready output in a variety of different output
formats. Graphs are built-up combining plotting widgets. Veusz has a
GUI user interface (started with the C<veusz> command), a Python
module interface and a scripting interface.
If started without command line arguments, B<Veusz> will open up with
a new empty document. The program will otherwise open the listed
documents.
=head1 OPTIONS
=over 8
=item B<--unsafe-mode>
Do not check opened scripts for the presence of unsafe Python
commands. This allows you to create or open complete Python scripts
with Veusz commands if they come from a trusted source.
=item B<--listen>
Read Veusz commands from stdin, executing them, then writing the
results to stdout. This option is intended to replace the veusz_listen
standalone program.
In this mode Veusz does not read any input documents, but will use the
first argument to the program as the window title, if given.
=item B<--quiet>
If in listening mode, do not open a window before running commands,
but execute them quietly.
=item B<--export>=I<FILE>
Export the next Veusz document file on the command line to the
graphics file I<FILE>. Supported file types include EPS, PDF, SVG,
PNG, BMP and JPG. The extension of the output file is used to
determine the output file format. There should be as many export
options specified as input Veusz documents on the command line.
=item B<--help>
Displays the options to the program and exits.
=item B<--version>
Displays information about the currently installed version and exits.
=back
=head1 BUGS
Please report bugs at https://gna.org/bugs/?group=veusz
=head1 AUTHORS
B<Veusz> was written by Jeremy Sanders <jeremy@jeremysanders.net>.
This manual page was written by Jeremy Sanders <jeremy@jeremysanders.net>.
=head1 COPYRIGHT
Copyright (C) 2003-2010 Jeremy Sanders <jeremy@jeremysanders.net>.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
=cut
This diff is collapsed.
=head1 NAME
veusz_listen - command-line interface to the B<Veusz> plotting application.
=head1 SYNOPSIS
veusz_listen [F<WindowTitle>]...
=head1 DESCRIPTION
B<Veusz> is a scientific plotting and graphing
package. B<veusz_listen> provides a command line interface to its
scripting interface.
B<veusz_listen> opens a new window (with an optional window title)
and listens to stdin. It executes Veusz scripting commands, writing
any output to stdout.
B<veusz_listen> is now deprecated. Please use B<veusz --listen>
instead.
=head1 SEE ALSO
veusz(1)
=head1 BUGS
Please report bugs at https://gna.org/bugs/?group=veusz
=head1 AUTHORS
B<Veusz> was written by Jeremy Sanders <jeremy@jeremysanders.net>.
This manual page was written by Jeremy Sanders <jeremy@jeremysanders.net>.
=head1 COPYRIGHT
Copyright (C) 2003-2010 Jeremy Sanders <jeremy@jeremysanders.net>.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
=cut
This diff is collapsed.
This diff is collapsed.
include VERSION AUTHORS ChangeLog COPYING INSTALL README
include MANIFEST.in setup.py setup.cfg
include scripts/veusz scripts/veusz_listen
recursive-include tests *.py *.sh *.vsz
recursive-include Documents *.xml *.sh *.png *.txt *.pdf *.html *.xsl *.py *.pod *.1
recursive-include windows *.png *.ico *.svg README
recursive-include dialogs *.ui
recursive-include examples *.vsz *.py *.csv *.dat
recursive-include widgets *.dat
recursive-include helpers *.c *.cpp *.h README LICENSE_*
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.