Use a python 3.5 compat method to scan dirs
This commit is contained in:
parent
76ff47bae2
commit
bab834814e
1 changed files with 8 additions and 8 deletions
|
@ -1484,14 +1484,14 @@ def get_available_emoticon_themes():
|
||||||
emoticons_themes.append('font')
|
emoticons_themes.append('font')
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
with os.scandir(configpaths.get('EMOTICONS')) as scan:
|
dir_iterator = os.scandir(configpaths.get('EMOTICONS'))
|
||||||
for entry in scan:
|
for folder in dir_iterator:
|
||||||
if not entry.is_dir():
|
if not folder.is_dir():
|
||||||
continue
|
continue
|
||||||
with os.scandir(entry.path) as scan_theme:
|
file_iterator = os.scandir(folder.path)
|
||||||
for theme in scan_theme:
|
for theme in file_iterator:
|
||||||
if theme.is_file():
|
if theme.is_file():
|
||||||
files.append(theme.name)
|
files.append(theme.name)
|
||||||
|
|
||||||
if os.path.isdir(configpaths.get('MY_EMOTS')):
|
if os.path.isdir(configpaths.get('MY_EMOTS')):
|
||||||
files += os.listdir(configpaths.get('MY_EMOTS'))
|
files += os.listdir(configpaths.get('MY_EMOTS'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue