コード例 #1
0
 def report_csv(self):
     from ckanext.spatial.lib.reports import validation_report
     if len(self.args) != 2:
         print 'Wrong number of arguments'
         sys.exit(1)
     csv_filepath = self.args[1]
     report = validation_report()
     with open(csv_filepath, 'wb') as f:
         f.write(report.get_csv())
コード例 #2
0
 def report_csv(self):
     from ckanext.spatial.lib.reports import validation_report
     if len(self.args) != 2:
         print 'Wrong number of arguments'
         sys.exit(1)
     csv_filepath = self.args[1]
     report = validation_report()
     with open(csv_filepath, 'wb') as f:
         f.write(report.get_csv())
コード例 #3
0
def report(pkg=None):

    if pkg:
        package_ref = six.text_type(pkg)
        pkg = model.Package.get(package_ref)
        if not pkg:
            print('Package ref "%s" not recognised' % package_ref)
            sys.exit(1)

    report = validation_report(package_id=pkg.id)
    for row in report.get_rows_html_formatted():
        print()
        for i, col_name in enumerate(report.column_names):
            print('  %s: %s' % (col_name, row[i]))
コード例 #4
0
def report(pkg=None):
    from ckan import model
    from ckanext.harvest.model import HarvestObject
    from ckanext.spatial.lib.reports import validation_report

    if pkg:
        package_ref = six.text_type(pkg)
        pkg = model.Package.get(package_ref)
        if not pkg:
            print('Package ref "%s" not recognised' % package_ref)
            sys.exit(1)

    report = validation_report(package_id=pkg.id)
    for row in report.get_rows_html_formatted():
        print()
        for i, col_name in enumerate(report.column_names):
            print('  %s: %s' % (col_name, row[i]))
コード例 #5
0
    def report(self):
        from ckan import model
        from ckanext.spatial.lib.reports import validation_report

        if len(self.args) >= 2:
            package_ref = unicode(self.args[1])
            pkg = model.Package.get(package_ref)
            if not pkg:
                print 'Package ref "%s" not recognised' % package_ref
                sys.exit(1)
        else:
            pkg = None

        report = validation_report(package_id=pkg.id)
        for row in report.get_rows_html_formatted():
            print
            for i, col_name in enumerate(report.column_names):
                print '  %s: %s' % (col_name, row[i])
コード例 #6
0
    def report(self):
        from ckan import model
        from ckanext.harvest.model import HarvestObject
        from ckanext.spatial.lib.reports import validation_report

        if len(self.args) >= 2:
            package_ref = unicode(self.args[1])
            pkg = model.Package.get(package_ref)
            if not pkg:
                print 'Package ref "%s" not recognised' % package_ref
                sys.exit(1)
        else:
            pkg = None

        report = validation_report(package_id=pkg.id)
        for row in report.get_rows_html_formatted():
            print
            for i, col_name in enumerate(report.column_names):
                print '  %s: %s' % (col_name, row[i])
コード例 #7
0
def report_csv(csv_filepath):
    from ckanext.spatial.lib.reports import validation_report
    report = validation_report()
    with open(csv_filepath, 'wb') as f:
        f.write(report.get_csv())