looks legit to me (trying to make sure we can load all files in the modules directory as well as libs but do it in a somewhat abstracted way. Although, the method to do the abstraction then requires duplicate code so I am sort of annoyed that I used dup code to avoid making dup code... whatever... get over it you neurotic ginger.)
This commit is contained in:
12
libs/utils/common.py
Normal file
12
libs/utils/common.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import os
|
||||
|
||||
def list_all_files(directory):
|
||||
list_of_files = os.listdir(directory)
|
||||
|
||||
array = []
|
||||
|
||||
for file in list_of_files:
|
||||
filename_and_ext = os.path.splitext(file)
|
||||
if filename_and_ext[1] == ".py":
|
||||
array.append(filename_and_ext[0])
|
||||
return array
|
||||
Reference in New Issue
Block a user