Load example output directory write premissions

Bug #138806 reported by Charles Edward Pax
2
Affects Status Importance Assigned to Milestone
Gladex
Fix Released
High
Christopher Pax
0.4
Fix Released
High
Christopher Pax

Bug Description

Version: bzr revision 123

Steps to repeat:
1) Start Gladex at the terminal
2) Select Gladex > Load example
3) Choose a plugin (any plugin will yield the same results)
4) Click Execute
5) Observe the terminal outout:
"""
Traceback (most recent call last):
  File "./gladex.py", line 49, in <lambda>
  File "./gladex.py", line 58, in calls
  File "./gladex_callbacks.py", line 211, in on_execute_clicked
  File "./plugins/perl/perl.py", line 128, in execute
  File "./gladex_functions.py", line 86, in __init__
IOError: [Errno 13] Permission denied: '/usr/share/gladex/examples/example.pl'
"""

Analysis: Loading the example file automatically selects /usr/share/gladex/examples/ as the output directory. When Execute is selected Gladex tries to write the output to this directory, but fails.

Solution: Change the behavior of the Load example feature. The file /usr/share/gladex/examples/example.glade will be loaded and the default output directory will be the user's home directory.

Revision history for this message
Charles Edward Pax (pax) wrote :

We should fix this before 0.4. I think this is the last thing keeping us from release.

Changed in gladex:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Christopher Pax (paxmanchris) wrote :

I disagree that this is a bug.The program is working exactly the way it should. The solution to this is for the user to change the directory for output.
But what I will do is write something to check the permissions of the file, and see if the current user has write access to it, if that person does not, a messaged dialog will come up and tell the user to change the directory.

Revision history for this message
Christopher Pax (paxmanchris) wrote :

Created the permissions checker. A error message pops up when you can not write to the output directory.

Changed in gladex:
assignee: nobody → paxmanchris
status: Confirmed → Fix Committed
Revision history for this message
Christopher Pax (paxmanchris) wrote :

In addition to the 'check permissions' I also made the '/home/user/Desktop' load as the directory when the example file is loaded.

Changed in gladex:
status: Fix Committed → Fix Released
Revision history for this message
lauranger (lauranger) wrote :

Hi
For the permission checking, why did not you used access(path, mode) ?
pwd and co are not available on Winblows.

Revision history for this message
Christopher Pax (paxmanchris) wrote :

Because I was fallowing a example I found Online. if you can write a replacement function, you are welcome to submit the diff as a attachment to this bug.

p.s. if you like gladex, please spread the word in these places:
http://gnomefiles.org/app.php/Gladex
http://ubuntuforums.org
digg.com
http://groups.google.com/group/gladex

and anywhere else you can think of.

you can also email me or my brother any suggestion or diffs to our email addresses as showed in the authors file included with the software.

Revision history for this message
lauranger (lauranger) wrote :

Hi
Here is a patch for win32 to get a operational python source pair (perl not touched, not tested).
I mainly changed permission checking as I mentioned above,
changed path calculations from "dir+"/"+file_name" to "os.path.join(dir, file_name)",
changed naked __file__ to some_module.__file__ where possible because naked __file__ points to idle.py,
remove naked __file__ where I could not find a already imported module to help as import searched locally first.
There is a possible danger with this my removal of naked __file__ at start of main template.
Hope that helps. Great job from you.
Regards

Charles Edward Pax (pax)
Changed in gladex:
status: Fix Released → In Progress
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.