showoffline in .gajimrc and convertion "~/" -> "/home/user" in optparser.py

This commit is contained in:
Yann Leboulanger 2003-10-23 18:29:15 +00:00
parent 7d6e55243e
commit 7bea0341fa
3 changed files with 11 additions and 9 deletions

View File

@ -20,12 +20,13 @@
import ConfigParser
import logging
import os
log = logging.getLogger('common.options')
class OptionsParser:
def __init__(self, fname):
self.__fname = fname
self.__fname = os.path.expanduser(fname)
# END __init__
def parseCfgFile(self):

View File

@ -21,7 +21,6 @@
import Queue
import socket
import sys
import os
import time
import logging
@ -32,17 +31,13 @@ import common.optparser
log = logging.getLogger('core.core')
log.setLevel(logging.DEBUG)
if 'HOME' in os.environ:
home = os.environ['HOME']
elif os.name == 'posix':
home = os.path.expanduser("~/")
CONFPATH = os.path.join(home,".gajimrc")
CONFPATH = "~/.gajimrc"
class GajimCore:
def __init__(self):
self.connected = 0
self.cfgParser = common.optparser.OptionsParser(CONFPATH)
print '%s\n' % self.cfgParser.Server_hostname;
# print '%s\n' % self.cfgParser.Server_hostname;
self.hub = common.hub.GajimHub()
self.cfgParser.parseCfgFile()
# END __init__

View File

@ -23,6 +23,9 @@ pygtk.require('2.0')
import gtk
import gtk.glade
import gobject
import string
import common.optparser
CONFPATH = "~/.gajimrc"
class user:
def __init__(self, *args):
@ -214,6 +217,8 @@ class roster:
def __init__(self, queueOUT):
#initialisation des variables
# FIXME : handle no file ...
self.cfgParser = common.optparser.OptionsParser(CONFPATH)
self.cfgParser.parseCfgFile()
self.xml = gtk.glade.XML('plugins/gtkgui.glade', 'Gajim')
self.tree = self.xml.get_widget('treeview')
self.treestore = gtk.TreeStore(gtk.gdk.Pixbuf, str, str)
@ -225,7 +230,8 @@ class roster:
self.optionmenu = self.xml.get_widget('optionmenu')
self.optionmenu.set_history(6)
self.tab_messages = {}
self.showOffline=0
self.showOffline=string.atoi(self.cfgParser.GtkGui_showoffline)
print self.showOffline
#colonnes
self.col = gtk.TreeViewColumn()