-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathUtils.py
More file actions
33 lines (23 loc) · 846 Bytes
/
Utils.py
File metadata and controls
33 lines (23 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from llmware.library import Library
from llmware.retrieval import Query
ACCOUNT_NAME = 'lecture_tool'
"""
Creates a list of all libraries created with the application based on the
ACCOUNT_NAME.
"""
def get_stored_libraries():
all_library_cards = Library().get_all_library_cards(account_name=ACCOUNT_NAME)
library_list = []
for card in all_library_cards:
library_list.append(card['library_name'])
return library_list
"""
Creates a list of unique filenames in a specified library.
"""
def get_stored_files(library_name):
library = Library().load_library(library_name, account_name=ACCOUNT_NAME)
file_list = []
for library_info in Query(library).get_whole_library():
if library_info['file_source'] not in file_list:
file_list.append(library_info['file_source'])
return file_list