mkdir_p replaced with os.makedirs
This commit is contained in:
parent
22b3f8e9b9
commit
91dd975413
3 changed files with 2 additions and 12 deletions
|
@ -14,7 +14,6 @@ from sqlalchemy.ext.declarative import declarative_base
|
|||
from platypush.backend.http.request import HttpRequest
|
||||
from platypush.config import Config
|
||||
from platypush.message.event.http.rss import NewFeedEvent
|
||||
from platypush.utils import mkdir_p
|
||||
|
||||
Base = declarative_base()
|
||||
Session = scoped_session(sessionmaker())
|
||||
|
@ -32,7 +31,7 @@ class GetRssUpdates(HttpRequest):
|
|||
self.mercury_api_key = mercury_api_key # Mercury Reader API used to parse the content of the link
|
||||
|
||||
if dbfile: self.dbfile = dbfile
|
||||
mkdir_p(os.path.dirname(self.dbfile))
|
||||
os.makedirs(os.path.expanduser(os.path.dirname(self.dbfile)), exist_ok=True)
|
||||
|
||||
self.engine = create_engine('sqlite:///{}'.format(self.dbfile))
|
||||
Base.metadata.create_all(self.engine)
|
||||
|
|
|
@ -5,8 +5,6 @@ import socket
|
|||
import time
|
||||
import yaml
|
||||
|
||||
from platypush.utils import mkdir_p
|
||||
|
||||
|
||||
""" Config singleton instance """
|
||||
_default_config_instance = None
|
||||
|
@ -63,7 +61,7 @@ class Config(object):
|
|||
|
||||
if 'workdir' not in self._config:
|
||||
self._config['workdir'] = self._workdir_location
|
||||
mkdir_p(self._config['workdir'])
|
||||
os.makedirs(self._config['workdir'], exist_ok=True)
|
||||
|
||||
if 'logging' not in self._config:
|
||||
self._config['logging'] = logging.INFO
|
||||
|
|
|
@ -64,12 +64,5 @@ def clear_timeout():
|
|||
signal.alarm(0)
|
||||
|
||||
|
||||
def mkdir_p(path):
|
||||
try: os.makedirs(path)
|
||||
except OSError as exc: # Python >2.5
|
||||
if exc.errno == errno.EEXIST and os.path.isdir(path): pass
|
||||
else: raise
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
||||
|
|
Loading…
Reference in a new issue