public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: [email protected]
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM#1432 - File Browser - File does not exist error
Date: Wed, 6 Jul 2016 15:12:16 +0530
Message-ID: <CAM5-9D_ebJh8VJfvhk2cR-w=QqkC2YTWhc8ft+v3a9qSTTotKw@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

Please find the patch with issue fixed:
File Browser - File does not exist error

> it is due to wrong path formation. strip the leftmost slash only from the
> file name selected not from the full path.


Please review.

*Reply to the comments:*
The file browser is virtually unreadable (see screen shot), it does not
work like Mac app
It seems to be font issue to me. I will fix it and send a patch.

When I click on the folder name, it offers to change the folder name
instead of opening it (opening works when I click on the folder logo)
we are performing two operations on double click:
1) Navigate inside the folder
double clicking on folder icon allows to navigate inside the folder.
2) Rename folder
double clicking on folder name allows to rename the file/folder.

When I manage to navigate to the right file and want to open it, I get a
red message ‘File does not exist’. That message disappears after 2-3 seconds
attached a patch with fix.

Thanks,
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM#1432.patch (920B, 3-RM%231432.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py
index c713fb5..92e4b17 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -1121,16 +1121,13 @@ def load_file():
     if request.data:
         file_data = json.loads(request.data.decode())

+    file_path = unquote(file_data['file_name'])
     # retrieve storage directory path
     storage_manager_path = get_storage_directory()
-    if storage_manager_path is None:
-        storage_manager_path = ""
+    if storage_manager_path:
+        # generate full path of file
+        file_path = os.path.join(storage_manager_path, file_path.lstrip('/'))

-    # generate full path of file
-    file_path = os.path.join(
-        storage_manager_path,
-        unquote(file_data['file_name'].lstrip('/'))
-    )
     file_data = None

     # check if file type is text or binary


view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM#1432 - File Browser - File does not exist error
  In-Reply-To: <CAM5-9D_ebJh8VJfvhk2cR-w=QqkC2YTWhc8ft+v3a9qSTTotKw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox