コード例 #1
0
        tbl = StockTemplate.addTable(captions, images, weights, returns)
        logging.debug(tbl)
        ret.append(tbl)
        ret.append(PageBreak())

    logging.debug(ret)
    doc.multiBuild(ret)


if __name__ == '__main__':

    import logging
    import sys
    from libUtils import ENVIRONMENT

    env = ENVIRONMENT.instance()
    log_filename = '{pwd_parent}/log/{name}.log'.format(**vars(env))
    log_msg = '%(module)s.%(funcName)s(%(lineno)s) %(levelname)s - %(message)s'
    #logging.basicConfig(stream=sys.stdout, format=log_msg, level=logging.INFO)
    logging.basicConfig(filename=log_filename,
                        filemode='w',
                        format=log_msg,
                        level=logging.DEBUG)

    ini_list = env.list_filenames('local/*.ini')

    input_file = env.list_filenames('local/report_generator.ini')
    output_file = "{pwd_parent}/local/image.pdf".format(**vars(env))

    main()
コード例 #2
0
class TemplateTest(unittest.TestCase):
    def test_01_default(self):
        target = 'test'
        test = globals().get(target, globals())
        logging.info(test)

    def test_02_local(self):
        target = 'test_files'
        test = globals().get(target, globals())
        logging.info(test)

    def test_03_higher(self):
        target = 'file_list'
        test = globals().get(target, globals())
        logging.info(test)


if __name__ == '__main__':

    import sys
    import logging

    test = TEST.instance()
    file_list = test.list_filenames(extension='local/*.ini')
    test_files = test.list_filenames('testConfig/*.ini')
    #log_filename = '{pwd_parent}/log/{name}.log'.format(**vars(test))
    log_msg = '%(module)s.%(funcName)s(%(lineno)s) %(levelname)s - %(message)s'
    #logging.basicConfig(filename=log_filename, filemode='w', format=log_msg, level=logging.INFO)
    logging.basicConfig(stream=sys.stdout, format=log_msg, level=logging.DEBUG)
    unittest.main()