Philipp Hörist pushed to branch master at gajim / gajim

Commits:
bab83481 by Philipp Hörist at 2018-08-18T12:06:54Z
Use a python 3.5 compat method to scan dirs

- - - - -


1 changed file:

- gajim/common/helpers.py


Changes:

=====================================
gajim/common/helpers.py
=====================================
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -1484,14 +1484,14 @@ def get_available_emoticon_themes():
         emoticons_themes.append('font')
 
     files = []
-    with os.scandir(configpaths.get('EMOTICONS')) as scan:
-        for entry in scan:
-            if not entry.is_dir():
-                continue
-            with os.scandir(entry.path) as scan_theme:
-                for theme in scan_theme:
-                    if theme.is_file():
-                        files.append(theme.name)
+    dir_iterator = os.scandir(configpaths.get('EMOTICONS'))
+    for folder in dir_iterator:
+        if not folder.is_dir():
+            continue
+        file_iterator = os.scandir(folder.path)
+        for theme in file_iterator:
+            if theme.is_file():
+                files.append(theme.name)
 
     if os.path.isdir(configpaths.get('MY_EMOTS')):
         files += os.listdir(configpaths.get('MY_EMOTS'))



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/bab834814e1612dd7e3e53270fbffae3a2c2da62

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/bab834814e1612dd7e3e53270fbffae3a2c2da62
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to