From d0dc7fe05f10a30d40d5b3c9be102a2e31fada9a Mon Sep 17 00:00:00 2001 From: benne238 Date: Tue, 5 Jan 2021 16:52:51 -0500 Subject: [PATCH 1/6] Implementation of alphabetical sorting for the getQueueCounts function --- api/ECNQueue.py | 10 +++++++++- api/webqueueapi.egg-info/PKG-INFO | 10 ++++++++++ api/webqueueapi.egg-info/SOURCES.txt | 6 ++++++ api/webqueueapi.egg-info/dependency_links.txt | 1 + api/webqueueapi.egg-info/top_level.txt | 2 ++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 api/webqueueapi.egg-info/PKG-INFO create mode 100644 api/webqueueapi.egg-info/SOURCES.txt create mode 100644 api/webqueueapi.egg-info/dependency_links.txt create mode 100644 api/webqueueapi.egg-info/top_level.txt diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 2cfcf98..48fab26 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -1331,7 +1331,11 @@ def getQueueCounts() -> list: possibleItems = os.listdir(queueDirectory + "/" + queue) validItems = [isValidItemName for file in possibleItems] queueInfo.append( {"name": queue, "number_of_items": len(validItems)} ) - return queueInfo + + # Sorts queueinfo alphabetically using the lambda function + sortedQueueInfo = sorted(queueInfo, key = lambda queueInfoList: queueInfoList['name']) + + return sortedQueueInfo def loadQueues() -> list: @@ -1346,3 +1350,7 @@ def loadQueues() -> list: queues.append(Queue(queue)) return queues + +if __name__ == "__main__": + getQueueCounts() + print() \ No newline at end of file diff --git a/api/webqueueapi.egg-info/PKG-INFO b/api/webqueueapi.egg-info/PKG-INFO new file mode 100644 index 0000000..d92f4ac --- /dev/null +++ b/api/webqueueapi.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: webqueueapi +Version: 1.0 +Summary: UNKNOWN +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN diff --git a/api/webqueueapi.egg-info/SOURCES.txt b/api/webqueueapi.egg-info/SOURCES.txt new file mode 100644 index 0000000..2f0f7ee --- /dev/null +++ b/api/webqueueapi.egg-info/SOURCES.txt @@ -0,0 +1,6 @@ +api.py +setup.py +webqueueapi.egg-info/PKG-INFO +webqueueapi.egg-info/SOURCES.txt +webqueueapi.egg-info/dependency_links.txt +webqueueapi.egg-info/top_level.txt \ No newline at end of file diff --git a/api/webqueueapi.egg-info/dependency_links.txt b/api/webqueueapi.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/api/webqueueapi.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/api/webqueueapi.egg-info/top_level.txt b/api/webqueueapi.egg-info/top_level.txt new file mode 100644 index 0000000..7cc9ebf --- /dev/null +++ b/api/webqueueapi.egg-info/top_level.txt @@ -0,0 +1,2 @@ +ECNqueue +api From 2a50f127098739e26cdde05304251731f53de4b1 Mon Sep 17 00:00:00 2001 From: benne238 Date: Tue, 5 Jan 2021 16:56:21 -0500 Subject: [PATCH 2/6] removal of debugging tools --- api/ECNQueue.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 48fab26..c304c86 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -1349,8 +1349,4 @@ def loadQueues() -> list: for queue in getValidQueues(): queues.append(Queue(queue)) - return queues - -if __name__ == "__main__": - getQueueCounts() - print() \ No newline at end of file + return queues \ No newline at end of file From 7ec22d687b6f06390069ee71b38051cbe9159825 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Wed, 27 Jan 2021 14:33:03 -0500 Subject: [PATCH 3/6] Update venv-manager to allow 60 second for requirement installation (cherry picked from commit 49106215a8a85a19acc4b3fc4fa11d264c22b1c5) --- utils/venv-manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/venv-manager.py b/utils/venv-manager.py index 72ecd3b..3bb15ce 100644 --- a/utils/venv-manager.py +++ b/utils/venv-manager.py @@ -79,7 +79,7 @@ def get_args() -> argparse.Namespace: return parser.parse_args() -def run_logged_subprocess(command: Union[str, list], timeout: int = 10, shell: bool = True) -> tuple: +def run_logged_subprocess(command: Union[str, list], timeout: int = 60, shell: bool = True) -> tuple: """Executes a shell command using subprocess with logging. stderr is redirected to stdout and stdout is pipped to logger. @@ -96,7 +96,7 @@ def run_logged_subprocess(command: Union[str, list], timeout: int = 10, shell: b Args: command (Union): The command to run. If shell=False, pass a list with the first item being the command and the subsequent items being arguments. If shell=True, pass a string as you would type it into a shell. - timeout (int): The number of seconds to wait for a program before killing it + timeout (int): The number of seconds to wait for a program before killing it. Defaults to 60. Returns: tuple: With the first value being the return code and second being the combined stdout+stderr From 8201b54195069cb92d1519eb484eff4f4665a5b3 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Wed, 27 Jan 2021 14:36:34 -0500 Subject: [PATCH 4/6] Remove egg-info files for Python module installation and add to gitignore --- .gitignore | 3 ++- api/webqueueapi.egg-info/PKG-INFO | 10 ---------- api/webqueueapi.egg-info/SOURCES.txt | 6 ------ api/webqueueapi.egg-info/dependency_links.txt | 1 - api/webqueueapi.egg-info/top_level.txt | 2 -- 5 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 api/webqueueapi.egg-info/PKG-INFO delete mode 100644 api/webqueueapi.egg-info/SOURCES.txt delete mode 100644 api/webqueueapi.egg-info/dependency_links.txt delete mode 100644 api/webqueueapi.egg-info/top_level.txt diff --git a/.gitignore b/.gitignore index e238c91..d8b16ea 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ yarn-error.log* /api/venv __pycache__/ venv-manager.log -/api/.env \ No newline at end of file +/api/.env +api/webqueueapi.egg-info \ No newline at end of file diff --git a/api/webqueueapi.egg-info/PKG-INFO b/api/webqueueapi.egg-info/PKG-INFO deleted file mode 100644 index d92f4ac..0000000 --- a/api/webqueueapi.egg-info/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: webqueueapi -Version: 1.0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff --git a/api/webqueueapi.egg-info/SOURCES.txt b/api/webqueueapi.egg-info/SOURCES.txt deleted file mode 100644 index 2f0f7ee..0000000 --- a/api/webqueueapi.egg-info/SOURCES.txt +++ /dev/null @@ -1,6 +0,0 @@ -api.py -setup.py -webqueueapi.egg-info/PKG-INFO -webqueueapi.egg-info/SOURCES.txt -webqueueapi.egg-info/dependency_links.txt -webqueueapi.egg-info/top_level.txt \ No newline at end of file diff --git a/api/webqueueapi.egg-info/dependency_links.txt b/api/webqueueapi.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/api/webqueueapi.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/api/webqueueapi.egg-info/top_level.txt b/api/webqueueapi.egg-info/top_level.txt deleted file mode 100644 index 7cc9ebf..0000000 --- a/api/webqueueapi.egg-info/top_level.txt +++ /dev/null @@ -1,2 +0,0 @@ -ECNqueue -api From 3b5399d9513a4f818f1ad21b7cd5447dcc4d00a3 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Wed, 27 Jan 2021 14:37:02 -0500 Subject: [PATCH 5/6] Fix ignore for egg-info --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d8b16ea..184e9b6 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ yarn-error.log* __pycache__/ venv-manager.log /api/.env -api/webqueueapi.egg-info \ No newline at end of file +/api/webqueueapi.egg-info \ No newline at end of file From f5b4b1e9f9c8a1aec8a2265cef3afbc063605f09 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Wed, 27 Jan 2021 14:50:13 -0500 Subject: [PATCH 6/6] Update comments --- api/ECNQueue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index c304c86..88173c8 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -1332,7 +1332,7 @@ def getQueueCounts() -> list: validItems = [isValidItemName for file in possibleItems] queueInfo.append( {"name": queue, "number_of_items": len(validItems)} ) - # Sorts queueinfo alphabetically using the lambda function + # Sorts list of queue info alphabetically sortedQueueInfo = sorted(queueInfo, key = lambda queueInfoList: queueInfoList['name']) return sortedQueueInfo