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:
@@ -1,11 +1,11 @@
|
||||
import os
|
||||
list_of_files = os.listdir('.')
|
||||
from libs.utils.common import *
|
||||
|
||||
arry = []
|
||||
|
||||
for file in list_of_files:
|
||||
filename_and_ext = os.path.splitext(file)
|
||||
if filename_and_ext[1] == ".py":
|
||||
arry.append(filename_and_ext[0])
|
||||
# Get the application's path (wherever weirdAAL.py is located will be the dirpath )
|
||||
dirpath = os.getcwd()
|
||||
# The actual location of this file on the filesystem is the "foldername"
|
||||
foldername = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
__all__ = arry
|
||||
all_files = list_all_files(foldername)
|
||||
__all__ = all_files
|
||||
|
||||
Reference in New Issue
Block a user