From 9e6e682130d7ea12ff1d6be5fecca094ad4ec105 Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 26 Nov 2006 11:00:53 +0000 Subject: [PATCH] * Added eject field in config. * Added information (written on terminal, where program is runned) about writing configuration in the very first time. --- config.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/config.py b/config.py index fa17ef1..0041cbf 100644 --- a/config.py +++ b/config.py @@ -1,5 +1,4 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +# This Python file uses the following encoding: utf-8 """ config parser object """ @@ -39,6 +38,7 @@ class Config: 'v' : 300, 'exportxls' : False, 'cd' : '/cdrom', + 'eject' : 'eject -r' } dictconf = { @@ -48,10 +48,11 @@ class Config: "vertical panes":"v", "export xls":"exportxls", "cd drive":"cd", + "eject command":"eject", } dbool = ('exportxls') - dstring = ('cd') + dstring = ('cd','eject') try: path = os.environ['HOME'] @@ -62,7 +63,10 @@ class Config: self.load() def save(self): - self.confd + try: + os.lstat("%s/.pygtktalog" % self.path) + except: + print "Saving preferences to %s/.pygtktalog" % self.path newIni = Ini() newIni.add_section("pyGTKtalog conf") for opt in self.dictconf: @@ -92,6 +96,5 @@ class Config: except: pass except: - print "No config file" pass