Browse Source

doing the thing

info@shuvit.org 2 years ago
parent
commit
97c4137006
3 changed files with 13 additions and 10 deletions
  1. 1
    0
      .gitignore
  2. 1
    2
      lib/sLoadSound.py
  3. 11
    8
      lib/utils.py

+ 1
- 0
.gitignore View File

@@ -43,6 +43,7 @@ Thumbs.db
43 43
 *.WAV
44 44
 *.MP3
45 45
 *.sng
46
+*.sco
46 47
 *__pycache__/
47 48
 lib/__pycache__/
48 49
 lib/*.pyc

+ 1
- 2
lib/sLoadSound.py View File

@@ -106,8 +106,7 @@ class LoadSound(State):
106 106
 					self.FSM.ToTransition('toMain')
107 107
 
108 108
 	def get_file_list(self, o):
109
-		dirs = os.listdir(o.load_sound_dir)
110
-		dirs.sort()
109
+		dirs = u.get_files(o.load_sound_dir, '.wav')
111 110
 		return dirs
112 111
 
113 112
 	def draw_main(self, o):

+ 11
- 8
lib/utils.py View File

@@ -182,18 +182,21 @@ def get_files(path, ext):
182 182
 
183 183
 	for file in files:
184 184
 	    if file.lower().endswith(ext):
185
-	    	print(file, ' does end with ext')
186 185
 	    	if os.path.isdir(path + file):
187
-	        	#out.append(file)
188 186
 	        	pass
189 187
 	    	else:
190
-	    		#pass
191 188
 	        	out.append(file)
192
-	    else:
193
-	    	print(file, ' does not end with ext')
194
-	    	#pass
195
-
196
-	return out
189
+	    else:	 
190
+	    	pass
191
+	
192
+	out2 = []
193
+	for f in out:
194
+		if f[0] == '.':
195
+			pass
196
+		else:
197
+			out2.append(f)
198
+
199
+	return out2
197 200
 
198 201
 def scroll_ud(o, self):
199 202
 	since_up = 0		

Loading…
Cancel
Save