Hi,

I started writing a 42-line python lxdm-configurator attached to this
mail.

At first, this raises the question, if you want to add python programms
or 'just' C programms… Do you want to include python?

The current drawback of my programm is, that it deletes out commented
lines.

        Thomas
#!/usr/bin/python
import ConfigParser
from optparse import OptionParser

CONFIGFILE='data/lxdm.conf'
cp = ConfigParser.ConfigParser()
cp.read(CONFIGFILE)

parser = OptionParser()
parser.add_option("", "--autologin", dest="autologin",
                help="USER, which will be logged on", metavar="USER")
parser.add_option("", "--greeter", dest="greeter",
                help="Which GREETER should be used?", metavar="GREETER")
parser.add_option("", "--session", dest="session",
                help="SESSION, which will be used", metavar="SESSION")
parser.add_option("", "--server-arg", dest="server_arg",
                help="ARGS, which will be passed to the server", metavar="ARGS")
parser.add_option("", "--background", dest="background",
                help="BACKGROUND picture", metavar="BACKGROUND")
parser.add_option("-l", "--list", action="store_true", dest="list",
                default=False, help="list current options")
(options, args) = parser.parse_args()

if options.list:
    for section in cp._sections:
        print section+": "
        for option in cp.options(section):
            print "\t"+option+" = "+cp.get(section, option)


if not cp.has_section("base"): cp.add_section("base")
if not cp.has_section("server"): cp.add_section("server")
if not cp.has_section("display"): cp.add_section("display")
if not cp.has_section("input"): cp.add_section("input")

if options.autologin: cp.set("base", "autologin", options.autologin)
if options.greeter: cp.set("base", "greeter", options.greeter)
if options.session: cp.set("base", "session", options.session)
if options.server_arg: cp.set("server", "arg", options.server_arg)
if options.background: cp.set("display", "bg", options.background)
f = file(CONFIGFILE, "w")
cp.write(f)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Lxde-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxde-list

Reply via email to