Remove scandir lib, use os.walk
This commit is contained in:
@@ -16,7 +16,6 @@ from couchpotato.core.plugins.base import Plugin
|
||||
from couchpotato.environment import Env
|
||||
from dateutil.parser import parse
|
||||
from git.repository import LocalRepository
|
||||
from scandir import scandir
|
||||
import version
|
||||
from six.moves import filter
|
||||
|
||||
@@ -182,7 +181,7 @@ class BaseUpdater(Plugin):
|
||||
|
||||
def deletePyc(self, only_excess = True, show_logs = True):
|
||||
|
||||
for root, dirs, files in scandir.walk(Env.get('app_dir')):
|
||||
for root, dirs, files in os.walk(Env.get('app_dir')):
|
||||
|
||||
pyc_files = filter(lambda filename: filename.endswith('.pyc'), files)
|
||||
py_files = set(filter(lambda filename: filename.endswith('.py'), files))
|
||||
@@ -329,11 +328,11 @@ class SourceUpdater(BaseUpdater):
|
||||
# Get list of files we want to overwrite
|
||||
self.deletePyc()
|
||||
existing_files = []
|
||||
for root, subfiles, filenames in scandir.walk(app_dir):
|
||||
for root, subfiles, filenames in os.walk(app_dir):
|
||||
for filename in filenames:
|
||||
existing_files.append(os.path.join(root, filename))
|
||||
|
||||
for root, subfiles, filenames in scandir.walk(path):
|
||||
for root, subfiles, filenames in os.walk(path):
|
||||
for filename in filenames:
|
||||
fromfile = os.path.join(root, filename)
|
||||
tofile = os.path.join(app_dir, fromfile.replace(path + os.path.sep, ''))
|
||||
|
||||
Reference in New Issue
Block a user