コード例 #1
0
    def __init__(self):

        schema_url = CONFIG.get('URLs', 'schema')
        groups_url = CONFIG.get('URLs', 'groups')

        self.schema = json.loads(urllib2.urlopen(schema_url).read())
        self.govdata_groups = json.loads(urllib2.urlopen(groups_url).read())
コード例 #2
0
    def write_report(self, rendered_template):
        target_dir = CONFIG.get('validators', 'report_dir')
        target_dir = os.path.abspath(target_dir)
        output = os.path.join(target_dir, 'linkchecker.html')

        fd = open(output, 'w')
        fd.write(rendered_template.encode('UTF-8'))
        fd.close()
コード例 #3
0
def copy_report_asset_files():
    target_dir = CONFIG.get('validators', 'report_dir')
    target_dir = os.path.join(target_dir, 'assets')
    target_dir = os.path.abspath(target_dir)

    vendor_dir = os.path.dirname(__file__)
    vendor_dir = os.path.join(vendor_dir, '../../', 'lib/assets')
    vendor_dir = os.path.abspath(vendor_dir)

    distutils.dir_util.copy_tree(vendor_dir, target_dir, update=1)
コード例 #4
0
    def write_validation_result(self, rendered_template, template_file):
        target_file = template_file.rstrip(".jinja2")

        target_dir = CONFIG.get('validators', 'report_dir')
        target_dir = os.path.join(target_dir, target_file)
        target_dir = os.path.abspath(target_dir)

        fd = open(target_dir, 'w')
        fd.write(rendered_template.encode('UTF-8'))
        fd.close()