Skip to content

Commit

Permalink
file is no good name on py27, file->handle
Browse files Browse the repository at this point in the history
Fixing pylint complaints, also minor flake8 formatting corrections.
  • Loading branch information
Kirill888 committed May 31, 2017
1 parent 1f54ee6 commit eeda1f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions datacube/utils/__init__.py
Expand Up @@ -150,7 +150,6 @@ def _parse_time_generic(time):
try:
import ciso8601 # pylint: disable=wrong-import-position


def parse_time(time):
try:
result = ciso8601.parse_datetime(time)
Expand Down Expand Up @@ -263,15 +262,15 @@ def read_documents(*paths):

if suffix in ('.yaml', '.yml'):
try:
with opener(str(path), 'r') as file:
for parsed_doc in yaml.load_all(file, Loader=NoDatesSafeLoader):
with opener(str(path), 'r') as handle:
for parsed_doc in yaml.load_all(handle, Loader=NoDatesSafeLoader):
yield path, parsed_doc
except yaml.YAMLError as e:
raise InvalidDocException('Failed to load %s: %s' % (path, e))
elif suffix == '.json':
try:
with opener(str(path), 'r') as file:
yield path, json.load(file)
with opener(str(path), 'r') as handle:
yield path, json.load(handle)
except ValueError as e:
raise InvalidDocException('Failed to load %s: %s' % (path, e))
elif suffix == '.nc':
Expand Down Expand Up @@ -310,6 +309,7 @@ def read_strings_from_netcdf(path, variable):
for chars in ds[variable]:
yield netcdf_extract_string(chars)


def validate_document(document, schema, schema_folder=None):
try:
# Allow schemas to reference other schemas in the given folder.
Expand Down

0 comments on commit eeda1f6

Please sign in to comment.