Пример #1
0
def loadConfig(account, name):
    if name == 'General':
        c = aMSNConfig()
        c._config = {"ns_server":'messenger.hotmail.com',
                     "ns_port":1863,
                    }
        configpath = os.path.join(account.account_dir, "config.xml")
        try:
            configfile = file(configpath, "r")
        except IOError:
            return c
        root_tree = ElementTree(file=configfile)
        configfile.close()
        config = root_tree.getroot()
        if config.tag == "aMSNConfig":
           lst = config.findall("entry")
           for elmt in lst:
               if elmt.attrib['type'] == 'int':
                   c.setKey(elmt.attrib['name'], int(elmt.text))
               else:
                   c.setKey(elmt.attrib['name'], elmt.text)
        print repr(c._config)
        return c
    else:
        return None
Пример #2
0
    def load_config(self, account):
        """
        @type account: L{amsn2.core.account_manager.aMSNAccount}
        """
        c = aMSNConfig()
        c.set_key("ns_server", "messenger.hotmail.com")
        c.set_key("ns_port", 1863)

        configpath = os.path.join(self.accounts_dir,
                                  self._get_dir(account.view.email),
                                  "config.xml")
        
        configfile = None
        try:
            configfile = file(configpath, "r")
        except IOError:
            return c

        root_tree = ElementTree(file=configfile)
        configfile.close()
        config = root_tree.getroot()
        if config.tag == "aMSNConfig":
            lst = config.findall("entry")
            for elmt in lst:
                if elmt.attrib['type'] == 'int':
                    c.set_key(elmt.attrib['name'], int(elmt.text))
                else:
                    c.set_key(elmt.attrib['name'], elmt.text)
        return c
Пример #3
0
    def load_config(self, account):
        """
        @type account: L{amsn2.core.account_manager.aMSNAccount}
        """
        c = aMSNConfig()
        c.set_key("ns_server", "messenger.hotmail.com")
        c.set_key("ns_port", 1863)

        configpath = os.path.join(self.accounts_dir,
                                  self._get_dir(account.view.email),
                                  "config.xml")

        configfile = None
        try:
            configfile = file(configpath, "r")
        except IOError:
            return c

        root_tree = ElementTree(file=configfile)
        configfile.close()
        config = root_tree.getroot()
        if config.tag == "aMSNConfig":
            lst = config.findall("entry")
            for elmt in lst:
                if elmt.attrib['type'] == 'int':
                    c.set_key(elmt.attrib['name'], int(elmt.text))
                else:
                    c.set_key(elmt.attrib['name'], elmt.text)
        return c
Пример #4
0
 def load_config(self, account):
     """
     @type account: L{amsn2.core.amsn.aMSNAccount}
     """
     c = aMSNConfig()
     c._config = {"ns_server":'messenger.hotmail.com',
                    "ns_port":1863,
                  }
     return c
Пример #5
0
 def load_config(self, account):
     """
     @type account: L{amsn2.core.amsn.aMSNAccount}
     """
     c = aMSNConfig()
     c._config = {
         "ns_server": 'messenger.hotmail.com',
         "ns_port": 1863,
     }
     return c
Пример #6
0
def loadConfig(account):
    c = aMSNConfig()
    c.setKey("ns_server", "messenger.hotmail.com")
    c.setKey("ns_port", 1863)
    configpath = os.path.join(account.account_dir, "config.xml")
    try:
        configfile = file(configpath, "r")
    except IOError:
        return c
    configfile = file(configpath, "r")
    root_tree = ElementTree(file=configfile)
    configfile.close()
    config = root_tree.getroot()
    if config.tag == "aMSNConfig":
        lst = config.findall("entry")
        for elmt in lst:
            if elmt.attrib['type'] == 'int':
                c.setKey(elmt.attrib['name'], int(elmt.text))
            else:
                c.setKey(elmt.attrib['name'], elmt.text)
    return c
Пример #7
0
def loadConfig(account):
    c = aMSNConfig()
    c._config = {"ns_server":'messenger.hotmail.com',
                   "ns_port":1863,
                 }
    return c
Пример #8
0
 def loadConfig(self, account):
     c = aMSNConfig()
     c._config = {"ns_server":'messenger.hotmail.com',
                    "ns_port":1863,
                  }
     return c