Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 0b70b3f7a40297f597eb93f203e141a1c5da180a 0 parents
@ogonbat authored
6 .gitignore
@@ -0,0 +1,6 @@
+.project
+.pydevproject
+MANIFEST
+MANIFEST.in
+dist/*
+
165 COPYING.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
34 setup.py
@@ -0,0 +1,34 @@
+from distutils.core import setup
+
+setup(
+ name = "sipxmldevices",
+ packages = ["sipxmldevices"],
+ version = "0.0.1",
+ description = "python module for fast and easy XML creation for SIP Devices",
+ author = "Andrea Mucci",
+ author_email = "cingusoft@gmail.com",
+ url = "https://github.com/ogonbat/sipxmldevices",
+ keywords = ["aastra", "sip", "xml", "cisco", "snom"],
+ classifiers = [
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
+ "Operating System :: OS Independent",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ long_description = """\
+Python Module For Fast and easy XML creation for SIP Devices
+-------------------------------------
+Now we support only Aastra SIP Devices
+Work with
+ - All Aastra SIP Phones of 67xxi serie ( 6730i, 6731i, 6735i, 6737i, 6753i, 6755i, 6757i, 6739i )
+Support
+ - All XML Root commands ( latest firmware release 3.2.2 )
+ - Support ISO-8859-1 and UTF-8
+
+This version requires Python 2 or later;
+"""
+)
0  sipxmldevices/__init__.py
No changes.
0  sipxmldevices/aastra/__init__.py
No changes.
332 sipxmldevices/aastra/api.py
@@ -0,0 +1,332 @@
+'''
+Created on 01/03/2012
+
+@author: cingusoft
+'''
+from sipxmldevices.aastra.items import ExecuteItem, MessageItem, inputItem,\
+ LineItem, URIItem, MenuItem, IconItem, SoftKeyItem, ConfigurationItem
+class AastraIPPhoneBase():
+
+ root_name = None
+ _content = ''
+ _list_root_options = []
+ _softkeys = ""
+ _iconlist = ""
+
+ def setDefaultIndex(self,val):
+ self._list_root_options.append(' defaultIndex="%s"' % (val))
+
+ def setDestroyOnExit(self,val):
+ self._list_root_options.append(' destroyOnExit="%s"'%(val))
+
+ def setStyle(self,val):
+ self._list_root_options.append(' style="%s"' % (val))
+
+ def setBeep(self,val):
+ self._list_root_options.append(' Beep="%s"' % (val))
+
+ def setTimeout(self,val):
+ self._list_root_options.append(' Timeout="%s"' % (val))
+
+ def setLockIn(self,val):
+ self._list_root_options.append(' LockIn="%s"' % (val))
+
+ def setAllowAnswer(self,val):
+ self._list_root_options.append(' allowAnswer="%s"' % (val))
+
+ def setAllowDrop(self,val):
+ self._list_root_options.append(' allowDrop="%s"' % (val))
+
+ def setAllowXfer(self,val):
+ self._list_root_options.append(' allowXfer="%s"' % (val))
+
+ def setAllowConf(self,val):
+ self._list_root_options.append(' allowConf="%s"' % (val))
+
+ def setAllowDTMF(self,val):
+ self._list_root_options.append(' allowDTMF="%s"' % (val))
+
+ def setCancelAction(self,val):
+ self._list_root_options.append(' cancelAction="%s"' % (val))
+
+ def setDoneAction(self,val):
+ self._list_root_options.append(' doneAction="%s"' % (val))
+
+ def setWrapList(self,val):
+ self._list_root_options.append(' wrapList="%s"' % (val))
+
+ def setScrollConstrain(self,val):
+ self._list_root_options.append(' scrollConstrain="%s"' % (val))
+
+ def setUnitScroll(self,val):
+ self._list_root_options.append(' unitScroll="%s"' % (val))
+
+ def setScrollUp(self,val):
+ self._list_root_options.append(' scrollUp="%s"' % (val))
+
+ def setScrollDown(self,val):
+ self._list_root_options.append(' scrollDown="%s"' % (val))
+
+ def setScrollLeft(self,val):
+ self._list_root_options.append(' scrollLeft="%s"' % (val))
+
+ def setScrollRight(self,val):
+ self._list_root_options.append(' scrollRight="%s"' % (val))
+
+ def setNumberLaunch(self,val):
+ self._list_root_options.append(' numberLaunch="%s"' % (val))
+
+ def content(self):
+ return self._content
+
+ def addSoftKeysItems(self,softkey_item):
+ if isinstance(softkey_item, SoftKeyItem):
+ for i in softkey_item.getItem():
+ self._softkeys += i
+ else:
+ raise TypeError, "SoftKey Item not a SoftKey() class Instance"
+ def addIconListItems(self,icon):
+ if isinstance(icon, IconItem):
+ self._iconlist = '<IconList>'
+ for i in icon.getItem():
+ self._iconlist += i
+ self._iconlist += '</IconList>'
+ else:
+ raise TypeError, "Icon not a IconList() class Instance"
+
+ def getXMLRender(self):
+ xmlRoot = '<%s' % (self.root_name)
+ for option in self._list_root_options:
+ xmlRoot += option
+ xmlRoot += '>'
+ xmlRoot += self.getContent()
+ xmlRoot += '</%s>' % (self.root_name)
+ xmlRoot += self._softkeys
+ xmlRoot += self._iconlist
+ del self._list_root_options[:]
+ return xmlRoot
+
+ def getContent(self):
+ return self._content
+
+class AastraIPPhoneTextMenu(AastraIPPhoneBase):
+ _title = ""
+ _menuItem = ""
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneTextMenu"
+
+ def addTitle(self,text,wrap="no"):
+ self._title = '<Title wrap="%s">%s</Title>' % (wrap,text)
+
+ def addMenuItems(self,item):
+ if isinstance(item, MenuItem):
+ for i in item.getItem():
+ self._menuItem += i
+ else:
+ raise TypeError, "Item not a MenuItem() class Instance"
+ def getContent(self):
+ self._content = self._title
+ self._content += self._menuItem
+ return self._content
+
+class AastraIPPhoneImageScreen(AastraIPPhoneBase):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneImageScreen"
+
+ def setImageAction(self,val):
+ self._list_root_options.append(' imageAction="%s"' % (val))
+
+ def setMode(self,val):
+ self._list_root_options.append(' mode="%s"' % (val))
+
+ def addImageItem(self,content,height,width,verticalAlign='middle',horizontalAlign='middle'):
+ self._content += '<Image'
+ self._content += ' verticalAlign="%s" horizontalAlign="%s" height="%s" width="%s">'
+ self._content += content
+ self._content += '</Image>'
+
+class AastraIPPhoneImageMenu(AastraIPPhoneImageScreen):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneImageMenu"
+
+ def addURLListItem(self,URIlist):
+ if isinstance(URIlist, URIItem):
+ self._content += '<URIList%s'%(URIlist.getBase())
+ self._content += '>'
+ for i in URIlist.getItem():
+ self._content += i
+ self._content += '</URIList>'
+ else:
+ raise TypeError, "URI List not a URIList() class Instance"
+
+class AastraIPPhoneTextScreen(AastraIPPhoneBase):
+ _title = ""
+ _text = ""
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneTextScreen"
+
+ def addTitle(self,text,wrap="no"):
+ self._title += '<Title wrap="%s">%s</Title>' % (wrap,text)
+
+ def addText(self,text):
+ self._text += '<Text>%s</Text>' % (text)
+
+ def getContent(self):
+ self._content = self._title
+ self._content += self._text
+ return self._content
+
+
+class AastraIPPhoneFormattedScreen(AastraIPPhoneBase):
+ _header = ""
+ _scroll = ""
+ _footer = ""
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneFormattedScreen"
+
+ def addHeaderLineItems(self,line):
+ if isinstance(line,LineItem):
+ for i in line.getItem():
+ self._header += i
+ else:
+ raise TypeError, "line not a Line() class Instance"
+
+ def addFooterLineItems(self,line):
+ if isinstance(line,LineItem):
+ for i in line.getItem():
+ self._footer += i
+ else:
+ raise TypeError, "line not a Line() class Instance"
+
+ def addScrollLineItems(self,line,height=None):
+ if isinstance(line,LineItem):
+ self._scroll += '<Scroll'
+ if height != None:
+ self._scroll += ' Height="%s"'%(height)
+ self._scroll += '>'
+ for i in line.getItem():
+ self._scroll += i
+ self._scroll += '</Scroll>'
+ else:
+ raise TypeError, "line not a Line() class Instance"
+
+ def getContent(self):
+ self._content = self._header
+ self._content += self._scroll
+ self._content += self._footer
+ return self._content
+
+class AastraIPPhoneInputScreen(AastraIPPhoneBase):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneInputScreen"
+
+ def setLanguage(self,val="English"):
+ if val != "English":
+ self._list_root_options.append(' inputLanguage="%s"' % (val))
+
+ def setType(self,val="string", is_password=False):
+ if val != "string":
+ self._list_root_options.append(' type="%s"' % (val))
+ if is_password != False:
+ self._list_root_options.append(' password="yes"')
+
+ def addInputItem(self,prompt,URL,parameter,default,title=None,title_wrap="no"):
+ if title != None:
+ self._content += '<Title'
+ if title_wrap != "no":
+ self._content += ' wrao="%s"'%(title_wrap)
+ self._content += '>%s</Title>'%(title)
+ self._content += '<Prompt>%s</Prompt>'%(prompt)
+ self._content += '<URL>%s</URL>'%(URL)
+ self._content += '<Parameter>%s</Parameter>'%(parameter)
+ self._content += '<Default>%s</Default>'%(default)
+
+class AastraIPPhoneMultiInputScreen(AastraIPPhoneBase):
+
+ def __init__(self,prompt,URL,parameter,default,title=None):
+ self.root_name = "AastraIPPhoneInputScreen"
+ if title != None:
+ self._content += '<Title>%s</Title>'%(title)
+ self._content += '<Prompt>%s</Prompt>'%(prompt)
+ self._content += '<URL>%s</URL>'%(URL)
+ self._content += '<Parameter>%s</Parameter>'%(parameter)
+ self._content += '<Default>%s</Default>'%(default)
+
+ def setDisplayMode(self,val="normal"):
+ if val != "normal":
+ self._list_root_options.append(' displayMode="condensed"')
+
+ def setEditable(self,val="yes"):
+ if val != "yes":
+ self._list_root_options.append(' editable="no"')
+
+ def setType(self,val="string", is_password=False):
+ if val != "string":
+ self._list_root_options.append(' type="%s"' % (val))
+ if is_password != False:
+ self._list_root_options.append(' password="yes"')
+
+ def addInputItems(self,item):
+ if isinstance(item, inputItem):
+ for i in inputItem.getItem():
+ self._content += i
+
+class AastraIPPhoneStatus(AastraIPPhoneBase):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneStatus"
+
+ def setTriggerDestroyOnExit(self,val="no"):
+ if val != "no":
+ self._list_root_options.append(' triggerDestroyOnExit="yes"')
+
+ def addMessageItems(self,messageItem,Session=None):
+ if Session != None:
+ self._content = '<Session>%s</Session>'%(Session)
+ if isinstance(messageItem,MessageItem):
+ for i in messageItem.getItem():
+ self._content += i
+ else:
+ raise TypeError, "Item Message Variable not a MessageItem() class Instance"
+
+class AastraIPPhoneExecute(AastraIPPhoneBase):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneExecute"
+
+ def setTriggerDestroyOnExit(self,val="no"):
+ if val != "no":
+ self._list_root_options.append(' triggerDestroyOnExit="yes"')
+
+ def addExecuteItems(self,item):
+ if isinstance(item, ExecuteItem):
+ for i in item.getItem():
+ self._content += i
+ else:
+ raise TypeError, "Item Execute Variable not a ExecuteItem() class Instance"
+
+class AastraIPPhoneConfiguration(AastraIPPhoneBase):
+
+ def __init__(self):
+ self.root_name = "AastraIPPhoneConfiguration"
+
+ def setTriggerDestroyOnExit(self,val="no"):
+ if val != "no":
+ self._list_root_options.append(' triggerDestroyOnExit="yes"')
+
+ def setType(self,val="remote"):
+ if val != "remote":
+ self._list_root_options.append(' setType="%s"' % (val))
+
+ def addConfigurationItems(self,item):
+ if isinstance(item, ConfigurationItem):
+ for i in item.getItem():
+ self._content += i
+ else:
+ raise TypeError, "Item Configuration Variable not a ConfigurationItem() class Instance"
220 sipxmldevices/aastra/items.py
@@ -0,0 +1,220 @@
+'''
+Created on 05/03/2012
+
+@author: cingusoft
+'''
+class ConfigurationItem():
+ _configuration_list = []
+
+ def addItem(self,paramenter,value,setType="remote"):
+ content = ""
+ content += '<ConfigurationItem'
+ if setType != "remote":
+ content += ' setType="%s"'%(setType)
+ content += '<Parameter>%s</Parameter>'%(paramenter)
+ content += '<Value>%s</Value>'%(value)
+ content += '</ConfigurationItem>'
+ self._configuration_list.append(content)
+ def getItem(self):
+ for i in self._configuration_list:
+ yield i
+ del self._configuration_list[:]
+
+class ExecuteItem():
+ _execute_list = []
+
+ def addItem(self,URI=None,interruptCall=None):
+ content = ""
+ content += '<ExecuteItem'
+ if URI != None:
+ content += ' URI="%s"'%(URI)
+ if interruptCall != None:
+ content += ' interruptCall="%s"'%(interruptCall)
+ content += ' />'
+ self._execute_list.append(content)
+
+ def getItem(self):
+ for i in self._execute_list:
+ yield i
+ del self._execute_list[:]
+
+class MessageItem():
+
+ _message_list = []
+
+ def addItem(self,text,index,typeAlert=None,Timeout="45",URI=None):
+ content = ""
+ content += '<Message'
+ content += ' Index="%s"'%(index)
+ if typeAlert != None:
+ content += ' Type="%s"'%(typeAlert)
+ if Timeout != "45":
+ content += ' Timeout="%s"'%(Timeout)
+ if URI != None:
+ content += ' URI="%s"'%(URI)
+ content += '>%s</Message>'%(text)
+ self._message_list.append(content)
+
+ def getItem(self):
+ for i in self._message_list:
+ yield i
+ del self._message_list[:]
+
+class inputItem():
+ _input_list = []
+
+ def addItem(self,prompt=None,parameter=None,default=None,selection=None,typeMode="string",is_password="no",editable="yes",softkey=None):
+ content = ""
+ content += '<InputField'
+ if typeMode != "string":
+ content += ' type="%s"'%(typeMode)
+ else:
+ if is_password != "no":
+ content += ' password="yes"'
+ if editable != "yes":
+ content += ' editable="no"'
+ content += '>'
+ if prompt != None:
+ content += '<Prompt>%s</Prompt>'%(prompt)
+ if parameter != None:
+ content += '<Parameter>%s</Parameter>'%(parameter)
+ if default != None:
+ content += '<Default>%s</Default>'%(default)
+ if selection != None:
+ content += '<Selection>%s</Selection>'%(selection)
+ if softkey != None:
+ if isinstance(softkey,SoftKeyItem):
+ for i in softkey.getItem():
+ content += i
+ else:
+ raise TypeError, "SoftKey Item not a SoftKey() class Instance"
+ content += '</InputField> '
+ self._input_list.append(content)
+
+ def getItem(self):
+ for i in self._input_list:
+ yield i
+ del self._input_list[:]
+
+class SoftKeyItem():
+ _softkey_list = []
+
+ def addItem(self,label,URI,index,icon_index=None):
+ self._content = '<SoftKey'
+ if index != None:
+ self._content += ' index="%s"'%(index)
+ if icon_index != None:
+ self._content += ' icon="%s"'%(icon_index)
+ self._content += '>'
+ self._content += '<Label>%s</Label>'%(label)
+ self._content += '<URI>%s</URI>'%(URI)
+ self._content += '</SoftKey>'
+ self._softkey_list.append(self._content)
+
+ def getItem(self):
+ for i in self._softkey_list:
+ yield i
+ del self._softkey_list[:]
+
+class MenuItem():
+
+ _items_list = []
+
+ def addItem(self,Prompt,URI,base=None,icon=None,Dial=None,Selection=None):
+ item = _MenuItem(Prompt,URI,Dial,Selection)
+ content = ''
+ content += '<MenuItem'
+ if base != None:
+ content += ' base="%s"' % ( base )
+ if icon != None:
+ content += ' icon="%s"' % ( icon )
+ content += '>%s</MenuItem>'%(item.getContent())
+ self._items_list.append(content)
+
+ def getItem(self):
+ for item in self._items_list:
+ yield item
+ del self._items_list[:]
+
+class _MenuItem():
+
+ def __init__(self,Prompt,URI,Dial=None,Selection=None):
+ self._content = '<Prompt>%s</Prompt>' % (Prompt)
+ self._content += '<URI>%s</URI>' % (URI)
+ if Dial != None:
+ if type(Dial) is dict and all(k in Dial for k in ("line","content")):
+ self._content += '<Dial line="%s">%s</Dial>' % (Dial['line'],Dial['content'])
+ else:
+ self._content += '<Dial>%s</Dial>' % (Dial)
+ if Selection != None:
+ self._content += '<Selection>%s</Selection>' % ( Selection)
+
+ def getContent(self):
+ return self._content
+
+class IconItem():
+
+ _icons_list = []
+
+ def addItem(self,iconName,index=None):
+ self._content = '<Icon'
+ if index != None:
+ self._content += ' index="%s"'%(index)
+ self._content += '>%s</Icon>'%(iconName)
+ self._icons_list.append(self._content)
+
+ def getItem(self):
+ for i in self._icons_list:
+ yield i
+ del self._icons_list[:]
+
+class URIItem():
+ _items_list = []
+ _base = ''
+ def __init__(self,base=None):
+ self._base = base
+
+ def addItem(self,Prompt,key,base=None):
+ content = '<URI key="%s">%s</URI>' % (Prompt,key)
+ self._items_list.append(content)
+
+ def getBase(self):
+ if self._base != None:
+ return ' base="%s"'%(self._base)
+ else:
+ return ''
+
+ def getItem(self):
+ for item in self._items_list:
+ yield item
+ del self._items_list[:]
+
+class _UrlItem():
+
+ def __init__(self,Prompt,key):
+ self._content = '<URI key="%s">%s</URI>' % (Prompt,key)
+
+ def getContent(self):
+ return self._content
+
+class LineItem():
+
+ _line_list = []
+
+ def addItem(self,text,Size="normal",Align="left",Color="white"):
+ self._content = '<Line'
+ if Size != "normal":
+ self._content += ' Size="%s"'%(Size)
+ if Align != "left":
+ self._content += ' Align="%s"'%(Align)
+ if Color != "white":
+ self._content += ' Color="%s"'%(Color)
+ self._content += '>'
+ self._content += '%s'%(text)
+ self._content += '</Line>'
+ self._line_list.append(self._content)
+
+ def getItem(self):
+ for i in self._line_list:
+ yield i
+ del self._line_list[:]
Please sign in to comment.
Something went wrong with that request. Please try again.