aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpapoteur-mga <yves.brungard_git@gadz.org>2014-10-25 13:03:23 +0200
committerpapoteur-mga <yves.brungard_git@gadz.org>2014-10-25 13:03:23 +0200
commitb1ce1a25dae88a0143674b1ce89fe103778be98d (patch)
treefda65cd78699c6bee36f0dbeb29fa89d32935046 /lib
parent55f0107e4ae435b59864b99005ccb857f5c84062 (diff)
downloadisodumper-b1ce1a25dae88a0143674b1ce89fe103778be98d.tar
isodumper-b1ce1a25dae88a0143674b1ce89fe103778be98d.tar.gz
isodumper-b1ce1a25dae88a0143674b1ce89fe103778be98d.tar.bz2
isodumper-b1ce1a25dae88a0143674b1ce89fe103778be98d.tar.xz
isodumper-b1ce1a25dae88a0143674b1ce89fe103778be98d.zip
Reverse getting user with getlogin.
Diffstat (limited to 'lib')
-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()