aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/isodumper.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 19bafa3..0626cae 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -58,7 +58,7 @@ def find_devices():
class IsoDumper:
- def __init__(self):
+ def __init__(self,user):
APP="isodumper"
DIR="/usr/share/locale"
RELEASE="v0.32"
@@ -83,6 +83,7 @@ class IsoDumper:
# define size of the selected device
self.deviceSize=0
+ self.user = user
# Operation running
self.operation=False
@@ -158,7 +159,7 @@ class IsoDumper:
def backup_sel(self,widget):
if self.backup_bname.get_current_folder_uri() == None :
- self.backup_bname.set_current_folder_uri('file:///home/'+os.getlogin())
+ self.backup_bname.set_current_folder_uri('file:///home/'+self.user)
self.backup_bname.set_current_name(self.device_name+".img")
self.choose.run()
@@ -488,13 +489,12 @@ class IsoDumper:
def write_logfile(self):
start = self.log.get_start_iter()
end = self.log.get_end_iter()
- user = os.getlogin()
import pwd
- pw = pwd.getpwnam(user)
+ pw = pwd.getpwnam(self.user)
uid = pw.pw_uid
gid=pw.pw_gid
- if (user != 'root') and (user !=''):
- logpath='/home/'+user+'/.isodumper'
+ if (self.user != 'root') and (self.user !=''):
+ logpath='/home/'+self.user+'/.isodumper'
os.setgid(gid)
os.setuid(uid)
if not(os.path.isdir(logpath)):
@@ -540,5 +540,7 @@ class IsoDumper:
dialog.hide()
if __name__ == "__main__":
- app = IsoDumper()
+ import sys
+ user=sys.argv[1]
+ app = IsoDumper(user)
gtk.main()