From: <tre...@us...> - 2010-05-27 16:20:22
|
Revision: 291 http://spd.svn.sourceforge.net/spd/?rev=291&view=rev Author: treibholz Date: 2010-05-27 16:20:14 +0000 (Thu, 27 May 2010) Log Message: ----------- Hotfix * Bug with double decrypt * removed embarassing FooBar Modified Paths: -------------- trunk/src/spd-cli trunk/src/spdCLI.py Modified: trunk/src/spd-cli =================================================================== --- trunk/src/spd-cli 2010-05-26 12:01:43 UTC (rev 290) +++ trunk/src/spd-cli 2010-05-27 16:20:14 UTC (rev 291) @@ -25,6 +25,7 @@ from optparse import OptionParser version = "0.3-alpha" +ConfigFile = '~/.spd/config' pp = spdCore.name(sys.argv[0]) @@ -68,9 +69,9 @@ (options, args) = parser.parse_args() # }}} -pc = spdCore.PasswordContainer('~/.spd/config') +pc = spdCore.PasswordContainer(ConfigFile) -interface = spdCLI.cli() +interface = spdCLI.cli(ConfigFile) # check if it is a search or not. Modified: trunk/src/spdCLI.py =================================================================== --- trunk/src/spdCLI.py 2010-05-26 12:01:43 UTC (rev 290) +++ trunk/src/spdCLI.py 2010-05-27 16:20:14 UTC (rev 291) @@ -1,7 +1,8 @@ # -*- coding: UTF-8 -*- import sys +import os import platform -import spdCore +from ConfigParser import RawConfigParser class cli(object): @@ -17,11 +18,18 @@ # print k.keys() return k - def __init__(self): # {{{ - FooBar = spdCore.PasswordContainer('.spd/config') - self.config = { "passwordField" : FooBar.passwordField, - "passwordFG" : FooBar.passwordFG, - "passwordBG" : FooBar.passwordBG, + def __init__(self,ConfigFile): # {{{ + ConfigFile = os.path.expanduser(ConfigFile) + + Config = RawConfigParser() + if os.access(ConfigFile,os.F_OK): + Config.read(ConfigFile) + else: + print "HELP" + + self.config = { "passwordField" : Config.get('Main','passwordField'), + "passwordFG" : Config.get('Colors','passwordFG'), + "passwordBG" : Config.get('Colors','passwordBG'), "listSeparator" : ":", } @@ -35,6 +43,7 @@ } self.colorReset = '\033[0m' + # }}} def tableOutput(self,table): # {{{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |