Exemple #1
0
def get_parser(template_name):
    """
    Get the correct parser based on the file extension
    """

    parser = XmlParser()
    # set the barcode file
    parser.barcode_library = find('common/pdf_img/barcode.ps')
    return parser
Exemple #2
0
def get_parser(template_name):
    """
    Get the correct parser based on the file extension
    """
    import os

    if template_name[-4:] == '.xml':
        parser = XmlParser()
        # set the barcode file
        parser.barcode_library = find('common/pdf_img/barcode.ps')
        return parser
    else:
        return Parser()