mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 00:43:37 +00:00
Change use scantree for helpers get_size.
This commit is contained in:
parent
3f4409cf3c
commit
914606449b
1 changed files with 1 additions and 6 deletions
|
@ -1334,12 +1334,7 @@ def human(size):
|
|||
def get_size(start_path='.'):
|
||||
if ek.ek(os.path.isfile, start_path):
|
||||
return ek.ek(os.path.getsize, start_path)
|
||||
total_size = 0
|
||||
for dirpath, dirnames, filenames in ek.ek(os.walk, start_path):
|
||||
for f in filenames:
|
||||
fp = ek.ek(os.path.join, dirpath, f)
|
||||
total_size += ek.ek(os.path.getsize, fp)
|
||||
return total_size
|
||||
return sum(map((lambda x: x.stat(follow_symlinks=False).st_size), scantree(start_path)))
|
||||
|
||||
|
||||
def remove_article(text=''):
|
||||
|
|
Loading…
Reference in a new issue