Skip to content

Commit

Permalink
futuruze ckan codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Dec 23, 2019
1 parent a994181 commit 822dc76
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions ckan/ckan_nose_plugin.py
@@ -1,5 +1,6 @@
# encoding: utf-8

from __future__ import print_function
from nose.plugins import Plugin
from inspect import isclass
import hashlib
Expand Down
1 change: 1 addition & 0 deletions ckan/cli/generate.py
@@ -1,5 +1,6 @@
# encoding: utf-8

from __future__ import print_function
import os
import sys
import click
Expand Down
1 change: 1 addition & 0 deletions ckan/i18n/check_po_files.py
Expand Up @@ -7,6 +7,7 @@
for usage.
'''
from __future__ import print_function
import polib
import re

Expand Down
2 changes: 1 addition & 1 deletion ckan/lib/cli.py
Expand Up @@ -1212,7 +1212,7 @@ def get_info(self):
print(' %s' % i)
if extra:
print(extra)
print
print()

def actions(self, cls):
''' Return readable action function info. '''
Expand Down
1 change: 1 addition & 0 deletions ckan/lib/config_tool.py
@@ -1,5 +1,6 @@
# encoding: utf-8

from __future__ import print_function
import re

INSERT_NEW_SECTIONS_BEFORE_SECTION = 'app:main'
Expand Down
1 change: 1 addition & 0 deletions ckan/lib/jobs.py
Expand Up @@ -17,6 +17,7 @@
.. versionadded:: 2.7
'''
from __future__ import print_function

import logging

Expand Down
3 changes: 2 additions & 1 deletion ckan/lib/search/__init__.py
@@ -1,5 +1,6 @@
# encoding: utf-8

from __future__ import print_function
import logging
import sys
import cgitb
Expand Down Expand Up @@ -230,7 +231,7 @@ def check():
len(pkgs)))
for pkg_id in pkgs_not_indexed:
pkg = model.Session.query(model.Package).get(pkg_id)
print(pkg.revision.timestamp.strftime('%Y-%m-%d'), pkg.name)
print((pkg.revision.timestamp.strftime('%Y-%m-%d'), pkg.name))


def show(package_reference):
Expand Down
2 changes: 1 addition & 1 deletion ckan/lib/uploader.py
Expand Up @@ -144,7 +144,7 @@ def update_data_dict(self, data_dict, url_field, file_field, clear_field):
if not self.storage_path:
return

if isinstance(self.upload_field_storage, (ALLOWED_UPLOAD_TYPES,)):
if isinstance(self.upload_field_storage, ALLOWED_UPLOAD_TYPES):
if self.upload_field_storage.filename:
self.filename = self.upload_field_storage.filename
self.filename = str(datetime.datetime.utcnow()) + self.filename
Expand Down
3 changes: 2 additions & 1 deletion ckan/migration/migrate_package_activity.py
Expand Up @@ -28,6 +28,7 @@
# whereas the main CLI is a list of tools for more frequent use.

from __future__ import print_function
from __future__ import absolute_import
import argparse
import sys
from collections import defaultdict
Expand Down Expand Up @@ -104,7 +105,7 @@ def __enter__(self):
except ImportError:
# convenient to look for it in the current directory if you just
# download these files because you are upgrading an older ckan
import revision_legacy_code
from . import revision_legacy_code
self.existing_function = model_dictize.package_dictize
model_dictize.package_dictize = \
revision_legacy_code.package_dictize_with_revisions
Expand Down
Expand Up @@ -6,6 +6,7 @@
Create Date: 2018-09-04 18:49:17.615242
"""
from __future__ import print_function
from alembic import op
import sqlalchemy as sa
from ckan.migration import skip_based_on_legacy_engine_version
Expand Down
Expand Up @@ -6,6 +6,7 @@
Create Date: 2019-05-09 13:39:17.486611
"""
from __future__ import print_function
import sys

from alembic import op
Expand Down
1 change: 1 addition & 0 deletions ckan/pastertemplates/__init__.py
Expand Up @@ -12,6 +12,7 @@
* http://pythonpaste.org/script/developer.html#templates
"""
from __future__ import print_function
import sys

import jinja2
Expand Down
2 changes: 1 addition & 1 deletion ckan/plugins/toolkit_sphinx_extension.py
Expand Up @@ -170,7 +170,7 @@ def source_read(app, docname, source):
source_ += format_function(name, thing, docstring=custom_docstring)
elif inspect.isclass(thing):
source_ += format_class(name, thing, docstring=custom_docstring)
elif isinstance(thing, types.ObjectType):
elif isinstance(thing, object):
source_ += format_object(name, thing, docstring=custom_docstring)

else:
Expand Down
1 change: 1 addition & 0 deletions ckan/tests/legacy/functional/api/test_user.py
@@ -1,6 +1,7 @@
# encoding: utf-8


from __future__ import print_function
import ckan.logic as logic
from ckan import model
from ckan.lib.create_test_data import CreateTestData
Expand Down
1 change: 1 addition & 0 deletions ckan/tests/legacy/models/test_resource.py
@@ -1,5 +1,6 @@
# encoding: utf-8

from __future__ import print_function
import pytest
import ckan.model as model

Expand Down
1 change: 1 addition & 0 deletions ckan/tests/legacy/test_coding_standards.py
Expand Up @@ -16,6 +16,7 @@
current coding standards. Please add comments by files that fail if there
are legitimate reasons for the failure.
"""
from __future__ import print_function
import inspect
import itertools
import os
Expand Down

0 comments on commit 822dc76

Please sign in to comment.