Example #1
0
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
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)    
Example #5
0
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)    
Example #6
0
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)    
Example #7
0
def create_attribution(attribution, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(attribution, root, 'Attribution', ns, OS_PREFIX)    
Example #8
0
def create_adult_content(adult_content, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(adult_content, root, 'AdultContent', ns, OS_PREFIX)
Example #9
0
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)
Example #10
0
def create_contact(contact, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(contact, root, 'Contact', ns, OS_PREFIX)
Example #11
0
def create_tags(tags, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(tags, root, 'Tags', ns, OS_PREFIX)    
Example #12
0
def create_description(description, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(description, root, 'Description', ns, OS_PREFIX)
Example #13
0
def create_short_name(short_name, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(short_name, root, 'ShortName', ns, OS_PREFIX)
Example #14
0
def create_output_encoding(output_encoding, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(output_encoding, root, 'OutputEncoding', ns, OS_PREFIX)
Example #15
0
def create_language(language, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(language, root, 'Language', ns, OS_PREFIX)    
Example #16
0
def create_long_name(long_name, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(long_name, root, 'LongName', ns, OS_PREFIX)    
Example #17
0
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)
Example #18
0
def create_developer(developer, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(developer, root, 'Developer', ns, OS_PREFIX)
Example #19
0
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)
Example #20
0
def create_syndacation_right(syndacation_right, root = None, tagName = OS_ROOT_TAG, ns = OS_NAMESPACE):
    return createSimpleMarkup(syndacation_right, root, 'SyndacationRight', ns, OS_PREFIX)