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())
Exemple #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())
Exemple #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]))
Exemple #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]))
    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])
Exemple #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])
Exemple #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())