# Copyright (C) 2003, 2004 Konstantin Korikov
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os
import libxml2
def convert_config(xml_node):
dest_version = "0.0.7"
if len(xml_node.xpathEval("wnd-title-fmt-disconnected")) == 0:
xml_node.newChild(None, "wnd-title-fmt-disconnected",
"%(program_name)s-%(program_version)s - Disconnected")
if len(xml_node.xpathEval("wnd-title-fmt-connecting")) == 0:
xml_node.newChild(None, "wnd-title-fmt-connecting",
"%(program_name)s-%(program_version)s - Connecting to %(name)s")
if len(xml_node.xpathEval("wnd-title-fmt-connected")) == 0:
xml_node.newChild(None, "wnd-title-fmt-connected",
"%(program_name)s-%(program_version)s - Connected to %(name)s")
if len(xml_node.xpathEval("pppd-cbcp-with-auto-answer")) == 0:
xml_node.newChild(None, "pppd-cbcp-with-auto-answer", "0")
if len(xml_node.xpathEval("write-dns-to-resolv-conf")) == 0:
xml_node.newChild(None, "write-dns-to-resolv-conf", "1")
xres = xml_node.xpathEval("default-account")
if len(xres):
xres[0].setProp("callback-init2-cmd", "AT")
xres[0].setProp("init2-cmd", "AT")
xml_node.setProp("version", dest_version)
|