aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpapoteur-mga <yves.brungard_git@gadz.org>2014-05-04 15:26:21 +0200
committerpapoteur-mga <yves.brungard_git@gadz.org>2014-05-04 15:26:21 +0200
commit268d357214b814e1798dd6286a0e379108c467af (patch)
treebd8e1ba8b561b62f0adeac25cf396deee78c4f3b
parent74ef74bfb1581aa45bf69369d0a3a025e871006a (diff)
downloadisodumper-268d357214b814e1798dd6286a0e379108c467af.tar
isodumper-268d357214b814e1798dd6286a0e379108c467af.tar.gz
isodumper-268d357214b814e1798dd6286a0e379108c467af.tar.bz2
isodumper-268d357214b814e1798dd6286a0e379108c467af.tar.xz
isodumper-268d357214b814e1798dd6286a0e379108c467af.zip
Added transmission of the user name to write the log file at the good place.
-rwxr-xr-xisodumper2
-rwxr-xr-xlib/isodumper.py14
2 files changed, 11 insertions, 5 deletions
diff --git a/isodumper b/isodumper
index 326d082..fb1bdcc 100755
--- a/isodumper
+++ b/isodumper
@@ -13,4 +13,4 @@ TERM=xterm
DIR=/usr/lib/isodumper
-$DIR/isodumper.py
+$DIR/isodumper.py $1
diff --git a/lib/isodumper.py b/lib/isodumper.py
index fb09476..17edf2c 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -56,10 +56,12 @@ def find_devices():
class IsoDumper:
- def __init__(self):
+ def __init__(self, user):
APP="isodumper"
DIR="/usr/share/locale"
RELEASE="v0.21"
+ # for the localisation of log file
+ self.user=user
gettext.bindtextdomain(APP, DIR)
gettext.textdomain(APP)
@@ -341,8 +343,10 @@ class IsoDumper:
def write_logfile(self):
start = self.log.get_start_iter()
end = self.log.get_end_iter()
- from os.path import expanduser
- home = expanduser("~")
+ if (self.user != 'root') and (self.user !=''):
+ home='/home/'+self.user
+ else:
+ home='/root'
if not(os.path.isdir(home+'/.isodumper')):
os.mkdir(home+'/.isodumper')
logfile=open(home+'/.isodumper/isodumper.log',"w")
@@ -379,5 +383,7 @@ class IsoDumper:
#exit(0)
if __name__ == "__main__":
- app = IsoDumper()
+ import sys
+ user=sys.argv[1]
+ app = IsoDumper(user)
gtk.main()