Page MenuHomec4science

websubmit-icon-creator.webdoc
No OneTemporary

File Metadata

Created
Tue, Nov 12, 11:53

websubmit-icon-creator.webdoc

## -*- mode: html; coding: utf-8; -*-
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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.
##
## CDS Invenio 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 CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
<!-- WebDoc-Page-Title: Icon creation tools -->
<!-- WebDoc-Page-Navtrail: <a class="navtrail" href="<CFG_SITE_URL>/help/hacking">Hacking CDS Invenio</a> &gt; <a class="navtrail" href="websubmit-internals">WebSubmit Internals</a> -->
<p>The WebSubmit Icon Creator library (<tt>websubmit_icon_creator.py</tt>) handles icon creation based on existing fulltext files.</p>
<h2>Python API</h2>
<protect><pre>
def create_icon(options):
"""The driver for the icon creation process. This is effectively the
function that is responsible for coordinating the icon creation.
It is the API for the creation of an icon.
@param options: (dictionary) - a dictionary of options that are required
by the function in order to carry out the icon-creation process.
The dictionary must have the following structure:
+ input-file: (string) - the path to the input file (i.e. that
which is to be stamped;
+ icon-name: (string) - the name of the icon that is to be created
by the program. This is optional - if not provided,
a default name will be applied to the icon file instead;
+ multipage-icon: (boolean) - used only when the original file
is a PDF or PS file. If False, the created icon will feature ONLY
the first page of the PDF. If True, ALL pages of the PDF will
be included in the created icon. Note: If the icon type is not
gif, this flag will be forced as False.
+ multipage-icon-delay: (integer) - used only when the original
file is a PDF or PS AND use-first-page-only is False AND
the icon type is gif.
This allows the user to specify the delay between "pages"
of a multi-page (animated) icon.
+ icon-scale: ('geometry') - the scaling information to be used for the
creation of the new icon. Type 'geometry' as defined in ImageMagick.
(eg. 320 or 320x240 or 100> or 5%)
+ icon-file-format: (string) - the file format of the icon that is
to be created. Legal values are:
* pdf
* gif
* jpg
* jpeg
* ps
* png
* bmp
+ verbosity: (integer) - the verbosity level under which the program
is to run;
So, an example of the returned dictionary could be something like:
{ 'input-file' : "demo-picture-file.jpg",
'icon-name' : "icon-demo-picture-file",
'icon-file-format' : "gif",
'multipage-icon' : True,
'multipage-icon-delay' : 100,
'icon-scale' : 180,
'verbosity' : 0,
}
@return: (tuple) - consisting of two strings:
1. the path to the working directory in which all files related to
icon creation are stored;
2. The name of the "icon" file;
@Exceptions raised: (InvenioWebSubmitIconCreatorError)
be raised or propagated by this function when the icon creation process
fails for one reason or another.
"""
</pre></protect>
<p>See <a href="http://cdsware.cern.ch/invenio/code-browser/invenio.websubmit_icon_creator-module.html">websubmit_icon_creator API</a> for a complete API description.</p>

Event Timeline