opener improvements

This commit is contained in:
Timur Torubarov 2016-03-29 18:02:58 +03:00
parent bf6753f178
commit 79cb17d4d5
2 changed files with 4 additions and 3 deletions

View File

@ -73,7 +73,7 @@ class Opener(object):
path: str, resource file url or resource file absolute/relative path.
Returns:
object, to call for file open.
file object
"""
self.path = path
opener = None
@ -86,7 +86,6 @@ class Opener(object):
opener = FileOpener(self.path)
return opener
class FileOpener(object):
""" File opener.
"""
@ -367,3 +366,5 @@ class HttpStreamWrapper:
return self.next()
except StopIteration:
return ''
Opener = Opener()

View File

@ -620,7 +620,7 @@ class ConfigManager(object):
""" Read configs set into storage """
self.log.debug("Reading configs: %s", configs)
for config in configs:
filename = Opener().resource_filename(config)
filename = Opener.resource_filename(config)
configs.remove(config)
configs.append(filename)
try: