summaryrefslogtreecommitdiffstats
path: root/pyload/config/Parser.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-12 02:00:28 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-12 03:22:29 +0200
commit0349b81a10d2937897f30031c4dedb49aa132d8c (patch)
tree3db2827cd64888cc013e064d4e201b8a6ddbc7a9 /pyload/config/Parser.py
parentMerge pull request #12 from GammaC0de/GammaC0de-fix-api (diff)
downloadpyload-0349b81a10d2937897f30031c4dedb49aa132d8c.tar.xz
'from os' -> 'import os' and so on...
Diffstat (limited to 'pyload/config/Parser.py')
-rw-r--r--pyload/config/Parser.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pyload/config/Parser.py b/pyload/config/Parser.py
index d74238007..6cd998024 100644
--- a/pyload/config/Parser.py
+++ b/pyload/config/Parser.py
@@ -2,10 +2,10 @@
from __future__ import with_statement
+import os
import shutil
import traceback
-from os.path import exists, join
from time import sleep
from pyload.utils import chmod, encode, decode
@@ -49,10 +49,10 @@ class ConfigParser(object):
def checkVersion(self, n=0):
"""determines if config need to be copied"""
try:
- if not exists("pyload.conf"):
- shutil.copy(join(pypath, "pyload", "config", "default.conf"), "pyload.conf")
+ if not os.path.exists("pyload.conf"):
+ shutil.copy(os.path.join(pypath, "pyload", "config", "default.conf"), "pyload.conf")
- if not exists("plugin.conf"):
+ if not os.path.exists("plugin.conf"):
with open("plugin.conf", "wb") as f:
f.write("version: " + str(CONF_VERSION))
@@ -61,7 +61,7 @@ class ConfigParser(object):
v = v[v.find(":") + 1:].strip()
if not v or int(v) < CONF_VERSION:
- shutil.copy(join(pypath, "pyload", "config", "default.conf"), "pyload.conf")
+ shutil.copy(os.path.join(pypath, "pyload", "config", "default.conf"), "pyload.conf")
print "Old version of config was replaced"
with open("plugin.conf", "rb") as f:
@@ -82,7 +82,7 @@ class ConfigParser(object):
def readConfig(self):
"""reads the config file"""
- self.config = self.parseConfig(join(pypath, "pyload", "config", "default.conf"))
+ self.config = self.parseConfig(os.path.join(pypath, "pyload", "config", "default.conf"))
self.plugin = self.parseConfig("plugin.conf")
try:
@@ -206,7 +206,7 @@ class ConfigParser(object):
def saveConfig(self, config, filename):
"""saves config to filename"""
with open(filename, "wb") as f:
- chmod(filename, 0600)
+ os.chmod(filename, 0600)
f.write("version: %i \n" % CONF_VERSION)
for section in config.iterkeys():
f.write('\n%s - "%s":\n' % (section, config[section]['desc']))