pyassetmlcreator
index
/home/stas/Projects/pyassetml/pyassetml-0.22/pyassetmlcreator.py

     Copyright (C) 2003 Stas Z. <stasz@linux.isbeter.nl>
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 Module pyassetml-creator.py - Create assetml files.

 
Modules
       
getopt
gettext
glob
locale
os
pprint
pyassetml
string
sys

 
Classes
       
Creator
exceptions.Exception
PyassetmlError
Options

 
class Creator
    Class to generate assetml files from a directory contents.
This class constructor takes a directory path and tries to
create a assetml file out of it.It also tries to generate a
description file if it doesn't exists.
The raw assetml stays part of the instance, and you call methods
form this instance to do things with the assetml source.
See the methods docstrings for more information
 
  Methods defined here:
__init__(self, dirpath, options)
dirpath = directory path with assetml contents.
options = class instance Options
generate_assetml(self)
self.xml_data is a dictionary where the keys are the names of the
attributes and data from the asset xml. The keys of the dictionary
are: dataset, rootdir, locale, mimetype, descr, credits, category.
The key "file" is updated dynamicly during generation.
It defaults to a empty dictionary and returns None
generate_pofile(self, assetmlpath=None)
Generate a po file from the assetml descriptions.
Or any other assetml file.
Return None on succes, error messages on faillure.

 
class Options
    Used to store default options.
These options are can be set by commendline options.
 
  Data and other attributes defined here:
category = ''
credits = ''
dataset = ''
deb = ''
locale = 'en'
mimetype = ''
output = 'assetml.raw'
rc = ''
rootdir = '../'
rpm = ''
update = None

 
class PyassetmlError(exceptions.Exception)
     Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
Functions
       
main(args)
set_locale()
usage()

 
Data
        PO_HEADER = '\n# This is a \'po\' file to be used by pyassetml-c...DING\\n"\n"Generated-By: pyassetml-creator.py \\n"\n\n'