Spaces:
Runtime error
Runtime error
v0.8.2
Browse files- src/baseInfra/dropbox_handler.py +1 -0
- src/main.py +4 -1
src/baseInfra/dropbox_handler.py
CHANGED
@@ -115,6 +115,7 @@ async def backupFolder(localFolder):
|
|
115 |
print("backup folder called for ",localFolder)
|
116 |
if not localFolder.startswith(os.environ['DROP_DIR2']):
|
117 |
localFolder=os.environ['DROP_DIR2']+localFolder
|
|
|
118 |
filenames=[]
|
119 |
for (root,dirs,files) in os.walk(localFolder, topdown=True):
|
120 |
print(root)
|
|
|
115 |
print("backup folder called for ",localFolder)
|
116 |
if not localFolder.startswith(os.environ['DROP_DIR2']):
|
117 |
localFolder=os.environ['DROP_DIR2']+localFolder
|
118 |
+
print("Local folder is ",localFolder)
|
119 |
filenames=[]
|
120 |
for (root,dirs,files) in os.walk(localFolder, topdown=True):
|
121 |
print(root)
|
src/main.py
CHANGED
@@ -74,13 +74,16 @@ async def reset_db():
|
|
74 |
def walk(path: PathRequest):
|
75 |
print("Received walk request")
|
76 |
dirs=[]
|
|
|
77 |
try:
|
78 |
for root, items, files in os.walk(path.dir,topdown=True):
|
79 |
for item in items:
|
80 |
dirs.append(item)
|
|
|
|
|
81 |
except Exception:
|
82 |
print("got exception",Exception)
|
83 |
-
response= JSONResponse(content= {"dirs":dirs})
|
84 |
return response
|
85 |
|
86 |
print(__name__)
|
|
|
74 |
def walk(path: PathRequest):
|
75 |
print("Received walk request")
|
76 |
dirs=[]
|
77 |
+
fileList=[]
|
78 |
try:
|
79 |
for root, items, files in os.walk(path.dir,topdown=True):
|
80 |
for item in items:
|
81 |
dirs.append(item)
|
82 |
+
for filea in files:
|
83 |
+
fileList.append(filea)
|
84 |
except Exception:
|
85 |
print("got exception",Exception)
|
86 |
+
response= JSONResponse(content= {"dirs":dirs,"files":fileList})
|
87 |
return response
|
88 |
|
89 |
print(__name__)
|