def create_image(url, height = None, width = None, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): markup = createSimpleMarkup(url, root, 'Image', ns, OS_PREFIX) if height is not None and isinstance(height, (int, long)): markup.set("height", height) if width is not None and isinstance(width, (int, long)): markup.set("width", width) return markup
def createRigths(rigths, root = None, ns = ATOM_NAMESPACE): ''' Returns an Atom.title instance as ElementTree @param rigths: the rigths's text @param root: the root tag of the document containing this element @param ns: the tag namespace @return: a new ElementTree.Element instance ''' return createSimpleMarkup(str(rigths), root, 'rigths', ns, ATOM_PREFIX)
def createSubTitle(subtitle, root = None, ns = ATOM_NAMESPACE): ''' Returns an Atom.subtitle instance as ElementTree @param title: the title's text @param root: the root tag of the document containing this element @param ns: the tag namespace @return: a new ElementTree.Element instance ''' return createSimpleMarkup(str(subtitle), root, 'subtitle', ns, ATOM_PREFIX)
def createID(iid, root = None, ns = ATOM_NAMESPACE): ''' Returns an Atom.id instance as ElementTree @param iid: a unique identifier, eventually an URI @param root: the root tag of the document containing this element @param ns: the tag namespace @return: a new ElementTree.Element instance ''' return createSimpleMarkup(str(iid), root, 'id', ns, ATOM_PREFIX)
def createPublished(published, root = None, ns = ATOM_NAMESPACE): ''' @param published: is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry @param root: the root tag of the document containing this element @param ns: the tag namespace @return: a new ElementTree.Element instance ''' return createSimpleMarkup(str(published), root, 'published', ns, ATOM_PREFIX)
def createUpdated(updated, root = None, ns = ATOM_NAMESPACE): ''' Returns an Atom.updated instance as ElementTree @param updated: is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. @param root: the root tag of the document containing this element @param ns: the tag namespace @return: a new ElementTree.Element instance ''' return createSimpleMarkup(str(updated), root, 'updated', ns, ATOM_PREFIX)
def create_attribution(attribution, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(attribution, root, 'Attribution', ns, OS_PREFIX)
def create_adult_content(adult_content, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(adult_content, root, 'AdultContent', ns, OS_PREFIX)
def createStartIndex(start_index, root=None, tagName=OS_ROOT_TAG, ns=OS_NAMESPACE): tr = start_index if isinstance(start_index, int): tr = str(start_index) return createSimpleMarkup(tr, root, "startIndex", ns, OS_PREFIX)
def create_contact(contact, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(contact, root, 'Contact', ns, OS_PREFIX)
def create_tags(tags, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(tags, root, 'Tags', ns, OS_PREFIX)
def create_description(description, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(description, root, 'Description', ns, OS_PREFIX)
def create_short_name(short_name, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(short_name, root, 'ShortName', ns, OS_PREFIX)
def create_output_encoding(output_encoding, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(output_encoding, root, 'OutputEncoding', ns, OS_PREFIX)
def create_language(language, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(language, root, 'Language', ns, OS_PREFIX)
def create_long_name(long_name, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(long_name, root, 'LongName', ns, OS_PREFIX)
def createTotalResults(total_results, root=None, tagName=OS_ROOT_TAG, ns=OS_NAMESPACE): tr = total_results if isinstance(total_results, int): tr = str(total_results) return createSimpleMarkup(tr, root, "totalResults", ns, OS_PREFIX)
def create_developer(developer, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(developer, root, 'Developer', ns, OS_PREFIX)
def createItemsPerPage(items_per_page, root=None, tagName=OS_ROOT_TAG, ns=OS_NAMESPACE): tr = items_per_page if isinstance(items_per_page, int): tr = str(items_per_page) return createSimpleMarkup(tr, root, "indexPerPage", ns, OS_PREFIX)
def create_syndacation_right(syndacation_right, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE): return createSimpleMarkup(syndacation_right, root, 'SyndacationRight', ns, OS_PREFIX)