From c596147b59722b0ce7fdb3ebf646e114c944079d Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 12 Mar 2015 20:56:10 -0600 Subject: [PATCH] List the iourc file in upload handler. --- gns3server/handlers/upload_handler.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gns3server/handlers/upload_handler.py b/gns3server/handlers/upload_handler.py index 0e0a7291..7fef01b5 100644 --- a/gns3server/handlers/upload_handler.py +++ b/gns3server/handlers/upload_handler.py @@ -32,16 +32,19 @@ class UploadHandler: api_version=None ) def index(request, response): - image_files = [] + uploaded_files = [] try: for root, _, files in os.walk(UploadHandler.image_directory()): for filename in files: image_file = os.path.join(root, filename) if os.access(image_file, os.X_OK): - image_files.append(image_file) + uploaded_files.append(image_file) except OSError: pass - response.template("upload.html", files=image_files) + iourc_path = os.path.join(os.path.expanduser("~/"), ".iourc") + if os.path.exists(iourc_path): + uploaded_files.append(iourc_path) + response.template("upload.html", files=uploaded_files) @classmethod @Route.post(