/[gentoo-src]/xac/xac
Gentoo

Contents of /xac/xac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Jan 17 05:21:05 2008 UTC (6 years, 5 months ago) by josejx
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
Some typo fixes.

1 #! /usr/bin/env python
2 version = "0.6_pre3"
3
4 ### Set up the python path
5 import sys, os
6 sys.path.append('/usr/lib/xac')
7
8 try:
9 from interactive import interact
10 from config import XAC_Config
11
12 except ImportError, e:
13 print "Module loading failed with: " + str(e)
14 print "Please check that xac was installed correctly"
15 sys.exit()
16
17 ### Instance the Config
18 c = XAC_Config(version)
19
20 quiet = 0
21 interactive = 0
22
23 ### Deal with command line input
24 for arg in sys.argv[1:]:
25 ### Decide if we're going to stdout or file
26 if arg.count("--stdout"):
27 c.filename = None
28 ### Set which file to write to
29 elif arg.count("--file"):
30 c.filename = arg[7:]
31 ### Force Bus
32 elif arg.count("--force-bus"):
33 ### FIXME
34 pass
35 ### No Binary Drivers
36 elif arg.count("--no-binary-drivers"):
37 c.arch.set_binary_drivers(0)
38 ### Disable DRI
39 elif arg.count("--no-dri"):
40 c.dri = 0
41 ### Force Minimal (working?) Config
42 elif arg.count("--safe"):
43 c.dri = 0
44 c.arch.set_binary_drivers(0)
45 c.safe = 1
46 c.arch.ignore_fb = 1
47 c.arch.ignore_edid = 1
48 ### Set the Keyboard Layout
49 elif arg.count("--kbd-layout"):
50 c.kbd[0].layout = arg[13:]
51 ### Ignore the EDID when configuring the monitor
52 elif arg.count("--ignore-edid"):
53 c.arch.ignore_edid = 1
54 ### Ignore the FB when configuring the monitor
55 elif arg.count("--ignore-fb"):
56 c.arch.ignore_fb = 1
57 ### Dumps config info
58 elif arg.count("--dump"):
59 c.arch.dump_info()
60 sys.exit()
61 ### Enable interactive config
62 elif arg.count("--interactive"):
63 interactive = 1
64 ### Print nothing to the screen
65 elif arg.count("--quiet"):
66 quiet = 1
67 ### Print the version and quit
68 elif arg.count("--version"):
69 print "xac v" + version
70 sys.exit()
71 ### Help
72 else:
73 print "Usage: xac [options]"
74 print "\nOutput Options:"
75 print "\t--stdout\t\tPrint the config to stdout"
76 print "\t--file=FILENAME\t\tWrite the config to FILENAME"
77 print "\nNon-Interactive Configuration Options:"
78 print "\t--force-bus=X:X:X\tUse only the PCI device with this ID"
79 print "\t--no-binary-drivers\tDo not use binary drivers, even if available"
80 print "\t--no-dri\t\tDo not use DRI, even if available"
81 print "\t--safe\t\t\tForce a minimal (working?) config"
82 print "\t--kkb-layout=LAYOUT\tSet the layout for your keyboard"
83 print "\t--ignore-edid\t\tIgnores the EDID when configuring the monitor"
84 print "\t--ignore-fb\t\tIngores the Framebuffer when configuring the monitor"
85 print "\nOther Options:"
86 print "\t--dump\t\t\tDump debugging information"
87 print "\t--interactive\t\tInteractive configuration for complex setups"
88 print "\t--quiet\t\t\tPrint nothing to the screen"
89 print "\t--version\t\tPrints the version and quits"
90 print "\t--help\t\t\tThis help screen"
91 sys.exit()
92
93 ### Perform the interactive config if required
94 ### Don't do interactive if we're outputting to stdout
95 if interactive and c.filename:
96 interact(c)
97
98 ### Redirect to file
99 if c.filename != None:
100 try:
101 c.save_config()
102 if not quiet:
103 print 'Wrote', c.filename
104 print 'Please check the configuration file for additional options'
105 except IOError, e:
106 print 'Unable to write', c.filename
107 print 'Please check permissions'
108 ### Redirect to stdout
109 else:
110 print c.get_config()

  ViewVC Help
Powered by ViewVC 1.1.20