Added KDE3 version of KDE Guidance utilities

git-svn-id: svn:// 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tpearson 13 years ago
commit 19ae07d0d4

@ -0,0 +1,280 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

@ -0,0 +1,334 @@
- Handle "ain't got no cpufreq" more gracefully (Malone bug # 99198)
- Fix typo in mountconfig that lead to a crash (Malone bug # 87861)
- BUG: Fix detection of the nvidia proprietary driver (Malone bug #104860)
- BUG: Displayconfig and would crash in combination
with later versions Xorg if the xrandr extension was not available.
(Malone bug #91545)
* Wednesday 29 March 2007 Simon Edwards <>
- version 0.8
- Deal with AttributeError in displayconfigabstraction (Malone bug #94108)
- Add menu to choose CPU frequency policy manually
- Handle problems not being able to read the filesystem label gracefully
- Make displayconfig-restore not crash on incorrect modelines (Malone bug # 76393)
- Make displayconfig a little smarter when the preferred resolution can't be found
- Make wineconfig not crash on empty fstab lines
- Fix the fuser frontend in mountconfig to actually work again.
- Handle ZeroDivisionError in displayconfig gracefully (Malone bug #77844)
- Support for LABEL in fstab added to mountconfig, improved support for
- Support for changing CPU frequency policy with HAL added to powermanager.
- Suspend after N minutes idle added to powermanager
- Added an option to not lock screen on resume (Malone bug # 64650)
- Handle crash in userconfig due to problems with locale (Malone bug #65739)
- Support for UUIDs in fstab added to mountconfig.
- grubconfig added. (Martin Böhm)
* Tuesday 6 March 2007 Simon Edwards <>
- version 0.7.1
- BUG: Fixed typo in (thanks to Rocco Stanzione)
- BUG: Fix double hibernate call on lid close. (Malone bug #65885)
- BUG: Change CHARGE_LEVEL_THRESHOLD to 10% (was 50%) to better workaround
acpi issue. when remaining_time is not reported correctly. Also use
threshold for battery low notification warning. (Malone bug #64752,
- BUG: Handle error in locale.getpreferredencoding gracefully. (Malone bug
- BUG: DPMS settings had not been saved on Apply, do that.
- BUG: Fix crash where cpu frequency scaling is not readable.
- BUG: Fix unicode and localisation handling in targetgamma, do a better job
choosing the right resolutions for example for nvidia twinview and other
unusual resolutions.
- BUG: Powermanager, first read config, then adapt the state of the UI from
those values.
- BUG: Don't crash displayconfig-restore when screenwidth and height are
bogus, use a sensible value of 96 instead. (Malone bug #77844)
- BUG: Make displayconfig-restore not crash on unknown modelines.
- BUG: Make tempfile handling more robust by using Python's tempfile.
- BUG: Check for None groupids in userconfig.
- BUG: Clear password edit after exiting the edit dialog in userconfig.
- BUG: Make AC adapter detection more robust to potential failure of
actions. (Malone bug #77091)
- BUG: permissions on groupfile should've been read, before they can be set.
- BUG: Check for valid groupid when selecting in userconfig.
- BUG: gamma settings were not being restored after logging in.
- BUG: A rounding error was causing problems in displayconfig when filtering
resolutions by the selected monitor.
- BUG: Displayconfig, userconfig and wineconfig didn't handle RTL desktops
correctly. (Diego lastrubni)
- BUG: Displayconfig would sometimes consider some widescreen modes as being
standand aspect ratio.
- BUG: Displayconfig would sometimes fail to set Display virtual size in
- BUG: Stopped displayconfig from stacktracing when it encounters a
degenerate gfx card + monitor combination that has no valid resolutions.
* Thursday 12 October 2006 Simon Edwards <>
- version 0.7
- BUG: Don't bail out of laptop-detect is not there (Malone bug #60309)
- BUG: didn't handle USB disks correctly. (KDE bug #132390)
- BUG: Disable double click opening items in mountconfig if the user is not
- BUG: Don't bail out if the device section is already there (Malone bug #50411)
- BUG: Don't show new_user in the secondary groups (Malone bug #44203)
- BUG: userconfig set wrong uid for new users (Malone bug #56275)
- BUG: would sometimes fail on non-English systems.
(Malone bug #43313).
- BUG: userconfig would sometimes fail when writing the shadow password file.
(Malone bug #47090)
- BUG: userconfig would fail if the password warning field in /etc/shadow was
empty. (Malone bug #47317)
- Changed a couple of labels in order to match the new system-settings spec:
- mountconfig now uses CIFS for Windows Shares instead of obsolete smbfs.
(Martin Böhm)
- Displayconfig now hides useless Monitor Orientation and Second Screen group
box options which can never be activated without changing hardware or the
X driver.
- Simplified the color and gamma tab in displayconfig.
- BUG: Better detection for dualhead intel chips in displayconfig.
- Updated the data files for displayconfig from
- wineconfig added for configuring Wine. (Yuriy Kozlov)
- powermanager applet added for monitoring laptop power levels (Sebastian
* Saturday 13 May 2006 Simon Edwards <>
- version 0.6.7
- Dutch translation added (Rinse de Vries)
- BUG: Displayconfig would fail if the monitor frequency settings in xorg.conf
contained extra spaces. (Malong bug #38692)
- BUG: Displayconfig would not add the lowest screen resolution available to
the modes list in the xorg.conf's Screen section/Display subsection.
- French translation added from Launchpad Rossetta.
* Friday 28 April 2006 Simon Edwards <>
- version 0.6.6
- BUG: Serviceconfig didn't correctly remove links in runlevel directories.
(Malone bug #39404)
- BUG: In Serviceconfig, toggling the "Start during boot" checkbox using the
context menu would fail. (Malone bug #34252)
- BUG: was would fail with "global name 'syslog'
undefined". (Malone bug #40683)
- BUG: Displayconfig had trouble picking a driver gfxcard model entry instead
of the detected default (e.g. VESA). (Malone bug #41127)
- BUG: Displayconfig would fail when writing out a xorg.conf that contained
non-ascii characters. (Malone bug #41474)
- Work around for an annoying bug in PyQt/PyKDE that causes the tools to
crash on exit if a dialog window has been used.
- BUG: The file paths used in displayconfig for checking for the proprietary
nvidia driver were wrong or out of date.
* Tuesday 18 April 2006 Simon Edwards <>
- version 0.6.5
- BUG: services that have not been installed via apt would cause long loops
a lot of dpkg queries. Only query dpkg db once.
- BUG: Serviceconfig's Apply button doesn't work. It should actually be Close
(Malone #38582)
- BUG: Changing an user's password can change another password for a different
user (Malone bug #39444)
- BUG: Displayconfig would fail at startup on systems with an nVidia 7800 GTX.
(Malone bug #32915 for Rob Hughes)
- BUG: Serviceconfig would crash if the windows is closed quickly after
serviceconfig appears.
- BUG: userconfig would fail at startup if an entry in /etc/passwd refered to
a group that is not defined in /etc/group. (Malone bug #34311)
- BUG: Userconifg. Manually typing in or editing the list of secondary groups
for a user had no effect. (Malone bug #37212)
- BUG: Displayconfig fails to detect the presence of the proprietary ATI and
nVidia drivers. (The location of some of the driver files had been recently
- BUG: would calculated the needed DPI at login using
stale screen information which would sometimes result in the wrong DPI.
- BUG: Numerious small bugs and compatibility problems in mountconfig.
- BUG: When browsing for a SMB share, mountconfig now correctly catches the
authentication information entered by the user into the smaller popup from
- Displayconfig now assumes that dualhead/clone mode is supported if the
laptop-detect script detects a laptop.
- Displayconfig now uses the clone mode support in the i810 driver.
- Displayconfig now only offers resolutions that both monitors support when
using clone mode.
- Displayconfig now supports clone mode on any setup that also supports
- BUG: Mountconfig failed to take into account that the order of the
user/users, exec/noexc, suid/nosuid etc options in /etc/fstab is significant.
(thanks Christoph Wiesen)
- French translations added to the desktop files. (Anthony Mercatante)
* Sunday 2 April 2006 Simon Edwards <>
- version 0.6.4
- BUG: All of the tools no longer write out config files under ~/.kde when
running as root. This should stop the annoying creation of config files
that can't be overwritten by the normal user.
- Userconfig is now by default not quite as tall. This should help stop
it from appearing too big in systemsettings.
- Displayconfig updated to also recognise late model nVidia chipsets.
- BUG: Displayconfig didn't support Clone mode for the proprietary nVidia
- BUG: The tools now correctly specify which translation catalogue to use for
- The screen images in the dualhead widget make better use of available widget
- Displayconfig: The 40guidance-displayconfig_restore script which is used by
the Xsession script during login via KDM/xdm, has now been fixed to not stop
the login in case of failure.
- BUG: Displayconfig was getting confused by unknown graphics cards and
crashing. (Malone bug #32915)
- BUG: Displayconfig still can't handling unicode in xorg.conf. (Malone bug
- BUG: Displayconfig is now more forgiving when xorg.conf contains characters
that are illegal with respect to the system character encoding. (Malone bug
- BUG: Displayconfig would have trouble detecting hardware on the PCI bus on
big endian architectures. (raphink)
- BUG: Displayconfig did not correctly handle situations where the X RandR
extension is missing.
- BUG: Displayconfig would fail when loading some xorg.conf files containing
multiple graphics card specifications. (Malone bug #37275, patch applied)
- BUG: Userconfig didn't respect the entered UID when creating a account.
(Malone bug #37722).
- Displayconfig: Added 1280x960 modes (60 & 75Hz).
* Friday 17 March 2006 Simon Edwards <>
- version 0.6.3
- BUG: userconfig and unixauthdb didn't respect the ownership of system files
when update /etc/passwd and friends. (Malone bug #26175).
- BUG: userconfig and unixauthdb would fail if /etc/passwd, /etc/groups or
/etc/shadow contained blank lines.
- BUG: displayconfig now does a better job of detecting graphics PCI devices
and handling non-detected graphics cards. Instead of crashing, "generic
VESA" is used when the type of card can't be found. (Malone bug #32915)
- The DPI that uses at login time can now be
controlled by adding a line to ~/.kde/share/config/displayconfigrc
in the [General] section. Add "dpi=xserver" to use the default DPI
from the X server, or "dpi=100" to use 100 DPI for example.
- BUG: Widescreen modes were missing in displayconfig.
- Displayconfig: Monitors can now be specified as being standard aspect ratio
or widescreen.
- BUG: Using the xresprobe command in displayconfig would crash some people's
machines. The much more safer ddcprobe command is now used.
(Malone bug #33943)
- BUG: A bug is displayconfig stopped monitor model detection. The xresprobe
command didn't actually return the eisa ID of the connected monitor.
ddcprobe does though (see above).
- BUG: Displayconfig. Changes to the monitor model or image format are
shown immediately on the "Size & Orientation" tab, even if the screen is
currently being used.
- BUG: When userconfig asks about whether the home directory should be created
when creating a new account, sometimes the wrong directory name was shown in
the dialog.
- BUG: Powerbook screen mode "1280x854" add to displayconfig. (Malone bug
- BUG: Displayconfig would throw an exception if the current display didn't
support DPMS. (Malone bug #34316).
- BUG: Most utilities would fail if they came across UTF-8 or unicode
characters. (Malone bug #34194).
- BUG: Displayconfig wouldn't correctly detect the presence of installed
proprietary drivers. (OculusAquilae)
- BUG: Displayconfig had trouble handling BusID rows in xorg.conf. This would
cause the xorg.conf to be incorrectly read. (Tonio)
- Added some extra methods to to aid debugging.
- BUG: Displayconfig would not save the user's display settings when running
in kcontrol or systemsettings. (Malone bug #35257)
* Wednesday 1 March 2006 Simon Edwards <>
- version 0.6.2
- BUG: Small bug in displayconfig that caused it to bug out around the
newCustomMonitor() method.
- BUG: userconfig had space character just before the she-bang which really
caused some trouble the for the shell.
- BUG: Displayconfig: Selecting the "Plug n Play" monitor directly without
clicking on "Detect" meant that only a very small set of resolutions would
be written to xorg.conf.
- BUG: The DPI calculations in where broken. This
resulted in the wrong DPI being used.
- BUG: Displayconfig: The clone mode option is now correctly disabled for
Matrox cards (mga driver).
- BUG: Displayconfig would bug out if the monitor model in the xorg.conf was
anything other than Plug n Play.
- BUG: Displayconfig would bug out if the DPMS Standby setting was 0 and DPMS
- Displayconfig is now shown in kcontrol under settings/hardware instead of
- BUG: Small bug in displayconfig that will causes displayconfig to bug out
when trying to detect the monitor and no EDID info is available.
- BUG: Small cosmetic bug in displayconfig where the some tabs were missing
margins when shown in kcontrol/system settings.
- BUG: displayconfig would bug out when detecting ATI dualhead cards.
(pci_device.text was None).
* Monday 20 February 2006 Simon Edwards <>
- version 0.6.1
- now saves its scan info in
- "Details..." button added to mountconfig in addition to the context menu for
opening the disk info dialog.
- BUG: serviceconfig: When starting and stopping daemons, the scripts expect a
terminal that understands colours. The command runner dialog doesn't, and
you end up seeing garbage characters. TERM is now set to vt100 when running
- BUG: displayconfig: Reset button didn't reset all of the parts/fields in the
- Detect dualhead Matrox cards.
- now at login time also chooses and sets a 'sane'
DPI setting used by applications for fonts. More info is in the source file.
- BUG: wasn't restoring the user's display resolution
at login.
- Plug N Play monitors are handled much better and are automatically probed
when neccessary.
* Tuesday 14 February 2006 Simon Edwards <>
- version 0.6.0
- Right mousebutton action for most listviews.
- mountconfig can now handle multi-fs entries.
- i18n() all over the place.
- Dualhead support added to displayconfig.
- displayconfig's hardware database files updated from Mandriva.
- numerous bug fixes.
- add. This is Ubuntu specific right now, but
what it does is detect hardware changes at boottime and automatically
run "dpkg-reconfigure" to generate a xorg.conf file that will get Xorg
* Tuesday 29 November 2005 Simon Edwards <>
- version 0.5.0
- displayconfig should now work for single head configurations.
- displayconfig has a shiney new preview.
- displayconfig is now usable on low resolution screens.
- DPMS tab cleaned up in displayconfig.
- displayconfig's hardware database files updated from Mandriva.
* Monday 12 September 2005 Simon Edwards <>
- version 0.4.0
- displayconfig has been massively restructured internally.
- numerous bug fixes.
- start of dualhead support in displayconfig.
- When umount fails in mountconfig the option to killing blocking processes
has been added.
- better Debian support in serviceconfig. It now uses apt and dpkg to get
service descriptions.
- ext3 added to mountconfig. :)
- userconfig now respects /etc/useradd.conf
- Now uses PyKDE Extensions for building and installation.
- DPMS tab added to displayconfig.
* Tuesday 5 April 2005 Simon Edwards <>
- version 0.3.0
- Displayconfig working and also feature complete.
- xf86config C module has been removed and replaced with pure Python.
- Numerous little bugs fixed in the userconfig, mountconfig and serviceconfig.
* Thursday 9 December 2004 Simon Edwards <>
- version 0.2.0
- mountconfig added, beta quality, feature complete.
- displayconfig added, alpha quality, not feature complete.
- userconfig, beta quality, feature complete.
- serviceconfig, beta quality, feature complete.
* Thursday 20 November 2003 Simon Edwards <>
- version 0.1.0
- Initial release.

@ -0,0 +1,21 @@
recursive-include kde *.png *.svg
recursive-include doc *.docbook *.png
graft package
prune package/.svn
graft package/mandrake
graft debian
prune package/mandrake/.svn
global-include *.desktop *.py *.pot *.po *.ui
global-exclude *~ .svn
include displayconfig/40guidance-displayconfig_restore
include displayconfig/vesamodes
include displayconfig/extramodes
include displayconfig/widescreenmodes
include displayconfig/ldetect-lst/Cards+
include displayconfig/ldetect-lst/MonitorsDB
include displayconfig/ldetect-lst/pcitable
exclude displayconfig/
exclude displayconfig/
exclude displayconfig/
exclude displayconfig/

@ -0,0 +1,15 @@
LIST=`find . -name \*.py`; \
if test -n "$$LIST"; then \
xgettext -ki18n -LPython $$LIST -o po/guidance.pot; \
sh /usr/lib/kubuntu-desktop-i18n/findfiles LIST
perl /usr/lib/kubuntu-desktop-i18n/ --file-list=LIST --base-dir=. > desktop.guidance.tmp
msguniq --to-code=UTF-8 --no-wrap -o desktop.guidance desktop.guidance.tmp 2>/dev/null
python /usr/lib/kubuntu-desktop-i18n/msgsplit desktop.guidance
mv desktop.guidance po/desktop_guidance.pot
rm -f desktop.guidance desktop.guidance.tmp


@ -0,0 +1,189 @@
!!! Warning: Read this through to the end. These tools can be dangerous. !!!
Guidance 0.8.0
by Simon Edwards <>, Sebastian Kügler <>
& Yuriy Kozlov <>, Martin Böhm <>
Guidance is a collection of system administration tools for Linux/KDE systems
that is designed to be:
* Update to date
* High quality, designed with user friendliness as high priority. (That is
to say that the tools should get the job done quickly, accurately and with
as little effort as possible.)
* Use KDE and "fit in" with KDE.
* Maintainable.
* Free Software
These tools often require root access and modify important system files in
order to do their job. There is a very real chance that these tools can
destroy your computer and your data. Backup your data! Also especially
backup up /etc/passwd, /etc/shadow and /etc/fstab. If you don't know what
I'm talking about now then you probably shouldn't try using Guidance yet.
You should have some idea how to fix
We accept no responsibility in the event that something goes terribly wrong.
You have been warned.
The tools that make up Guidance are in different stages of development and
have only been tested on Mandrake.
* userconfig - User & Group configuration. Supports /etc/passwd and
/etc/shadow right now.
* serviceconfig - System services configuration utility. Feature complete.
Works on Mandrake, Debian, (K)ubuntu Gentoo and maybe Red Hat out of the box.
* mountconfig - Mount point configuration utility. Feature complete and
* displayconfig - Display and graphics card configuration utility. Feature
complete but it only tested on Kubuntu right now.
* wineconfig - Wine configuration utility.
* grubconfig - Grub boot loader configuration utility. beta quality now.
* Linux.
* Python. 2.4 recommended. You probably already have Python installed, and if
not then it will most definately be available for you distribution of choice.
* PyQt / PyKDE. Version 3.7 or higher. PyQt and PyKDE are distributed with
KDE as part of kde-bindings since version 3.3.
For versions of KDE before 3.3 it is possible to install PyQt/PyKDE
directly. The homepage for PyQt and PyKDE is:
Packages for most popular distributions are available here:
* KDE 3.
* "PyKDE Extensions" is needed for installation. It is available here:
This is also a runtime requirement!
* libpythonize. If you don't want the tools to appear on the KDE Control
Center of you just don't want to bother with libpythonize, then you can
build Guidance with this command:
python install build_kcm --no-kcontrol
libpythonize is only needed for the KDE Control Center.
* You also need to have the development files from your X-server installed,
XFree86 or Xorg. Most distributions package these files up in a package
called XFree86-devel, or Xorg-devel, or libxorg-X11-devel or some similar.
* Specifically, the following packages are needed on Kubuntu:
As root run:
./ install
This will test for a working installation of PyQt/PyKDE and automatically
install the files using the same installation prefix as KDE. You will need
to have a working Python install before you can even run the script.
displayconfig-hwprobe installation
---------------------------------- is a small program that should be run at boottime
before Xorg is started. It scans the PCI bus looking for graphics cards and
compares the list it finds to the previous time it was run. If the two lists
of hardware are different then "dpkg-reconfigure xserver-xorg" is automatically
run in non-interactive mode to generate a new xorg.conf based on the new
The philosophy is that it is better to have a system with a raw but working
xorg.conf and X server, than to keep the old configuration and a Xorg that
won't startup. Swapping a graphics card should not "break" the OS.
The script currently does not install by
itself. For now this must be done by the packager.
should be put in /etc/init.d and installed to run at boot time with a command
like this:
update-rc.d start 18 3 . only supports Kubuntu right now. Perhaps in the
future displayconfig-hwprobe will be expanded to detect hardware and generate
an xorg.conf by itself.
More information about and the files it uses is
inside Currently the hardware data is written to
/var/lib/guidance/guidance-gfxhardware-snapshot. IMPORTANT: The directory
/var/lib/guidance/ should be created before using
Installation should add a couple of entries to the KDE Control Center in the
System section (displayconfig will show up in Peripherals). It is also possible
to run the commands outside of the KDE Control Center from the shell as root:
* serviceconfig
* userconfig
* mountconfig
* displayconfig
* wineconfig
* grubconfig
Reporting Bugs
Bug reports and feedback can be sent to . Do make sure
that say which version of Guidance you are using and also what Linux
distribution you are using, and also how you installed SIP, PyQt, PyKDE. Also
if any error messages are printing to the console, email those too. By
running these tools from the command line you can often get useful (to me)
debug information. That kind of information is valuable.
As root run:
./ uninstall
Thanks go to
Jim Bublitz
David Boddie
Sebastian Kügler
Theo Houtman
Pete Andrews (gamma correction system)
Simon Edwards

@ -0,0 +1,48 @@
In this file I want to try to explain some practical things about Guidance
the "project" and some basic (and hopefully not too heavy) policies about how
things work organisationally.
-- 11 Feb 2007, Simon Edwards <>
The list of developers as of 11 Feb 2007:
Simon Edwards <>, SVN username: sedwards, IRC: sime (unregistered)
Sebastian Kügler <>, SVN username: sebas, IRC: sebas
Yuriy Kozlov <>, SVN username: ykozlov, IRC: yuriy
Martin Böhm <>, SVN username: martinbohm, IRC: ???
"Lure" on #kubuntu-devel will join this list whether he likes it or not if he keeps
on committing stuff to powermanager. ;-)
Main development occurs in KDE's subversion repository in
/trunk/kdereview/guidance. Branches of the stable releases can be found
in svn under /kde/branches/guidance/. 0.6 was used in the Kubuntu Dapper, 0.7
was in Edgy.
Python source code
Use 4 spaces for indentation, for the simple reason that it is very common
and mixing indentation styles is a PITA.
I (Simon) use Qt/KDE style naming conventions for methods. For variable
names I'm a bit inconsistent but it is usually lower case of lower case
with underscores. All I ask is that variable names be descriptive and
TIP: When dealing with translated strings, use uncide() and not str(),
otherwise things will break on translated desktops.
Release procedure
[TODO: explain how a release tarball is created.]


@ -0,0 +1,294 @@
BUG: Mountconfig has no "enable/disable" in the context menu.
BUG: Mountconfig: "enable/disable" can sometime be available for normal users.
BUG: mountconfig: The disk details dialog ( doesn't show *unpartioned* free space.
BUG: Live gamma changes didn't seem to work on one of the S3s.
BUG: mountconfig. Authentication details in the SMSShareSelectDialog are sometimes not
correctly used when browsing.
TODO: Some S3 cards need to have the video ram specified, and some later model don't.
It would be good if we could tell the difference and only offer the ram pulldown
when strictly needed.
TODO: Monitor type selection (CRT, lcd etc). needed for clone mode on ATI at least.
TODO: When using the proprietary nVidia driver, choose between the nVidia AGP
and kernel agpgart based on what is best the of the machine's chipset.
TODO: The proprietary ATI drivers have a 'Option "BusType" "PCI"' thing which may
of may not need to be set for PCI based ATI cards.
TODO: 3D accel on the 9250 with open source drivers.
Future TODO
* LDAP (post-1.0) in-progress
* (others?) (post-1.0)
* Change os.system() to the calls Simon uses in some cases.
* Some services are running, but not in /var/run, implement special treatment. :>
* Remove commented line from /etc/shells in userconfig -> Modify -> Shell.
* Add 'proper' GUIs for editing some of the more common FS types.
- NFS.
* AttributeError when mounting Samba volume
* Handle the 'managed' mount entry options. See
This is stand on Mandriva 2005.
* Implement "real" HAL backend.
* Use HAL for fetching PCI and card info? alongside existing systems (ldetect)?
* Swap/kernel config:
"To tune, simply echo a value from 0 to 100 onto /proc/sys/vm/swappiness."
* Hardware detection info:
From: Pixel (
Subject: Re: Why so many HW detection packages?
Newsgroups: linux.debian.devel
Date: 2002-05-09 17:20:07 PST
On Fre, 26 Apr 2002, Petter Reinholdtsen wrote:
> The reson is that there are 3 hardware detection system:
> - Mandrake (libdetect, old)
truly libdetect is old and deprecated
(harddrake (was lothar) used to use it)
we (mandrake) are now mostly using ldetect & ldetect-lst
AFAIK here are the various free software hardware databases:
- pci ----------
- pci.ids (in pciutils)
maps vendor+device -> description
and vendor+device+subvendor+subdevice -> description
also has device classes names
- modules.pcimap (in kernel /lib/modules/2.4*/)
maps vendor+device -> module
and vendor+device+subvendor+subdevice -> module
- XFree's xf86PciInfo.h (in XFree's source: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h)
maps vendor+device -> description
- RedHat's pcitable (in hwdata)
maps vendor+device -> module+description
and a few vendor+device+subvendor+subdevice -> module+description
when needed
module can also be "Card:xxxx" for XFree (using Cards, see below)
- Mandrake's pcitable (in ldetect-lst)
same format as RedHat's (except for a few syntactical changes since mandrake kept old RedHat's format)
module can also be
"Card:xxxx" for XFree (using Cards+, see below)
"Server:xxxx" for XFree3
"ISDN:xxxx" for hisax special parameters
"Bad:xxxx" for warning about unhandled devices (mainly winmodems)
- Mandrake old detect's pci.lst (in detect-lst)
maps vendor+device -> class+module+description
- Progeny's pci.lst (in discover-data)
same format as detect
maps vendor+device -> class+module+description
module can also be
"Server:XFree86(module)" for XFree4
"Server:XF86_xxx" for XFree3
some comments:
- the "class" in pci.lst is not useful when "module" is given since
from the module name, one can have the "class"
- the subvendor+subdevice distinction is sometimes useful
(not very often though)
- hopefully one day modules.pcimap will be the reference :)
(except for XFree of course)
tools using those databases:
- kudzu and anaconda are using pcitable from hwdata
- library ldetect accesses pcitable from ldetect-lst,
this library is used by DrakX and drakxtools.
Mandrake's patched kudzu uses pcitable from ldetect-lst
- discover uses pci.ids from discover-data
- i don't know if tools are using modules.pcimap
- XFree --------------------
- XFree comes with Cards
- Redhat has its own version (in hwdata)
- Mandrake has its own version Cards+ & CardsNames (in ldetect-lst)
(mainly a merge of XF3 Cards and XF4 Cards)
- discover doesn't need it since it's precising the server name
(XF3) or the module name (XF4) (?)
this is usually enough (except if you want to propose the choice,
but who wants XF3 nowadays :)
- usb --------------------
- usbutils's usb.ids
maps vendor+device -> description
also has device classes names and some more stuff
- modules.usbmap (in kernel /lib/modules/2.4*/)
maps vendor+device -> module (?)
- Mandrake's usbtable (in ldetect-lst)
maps vendor+device -> module+description
module can also be
"Mouse:xxxx" for mouse configuration (fed to mousedrake)
"Tablet:wacom" for wacom tablet configuration
"Flag:xxxx" for DrakX package choosing
- Progeny's usb.lst (in discover-data)
maps vendor+device -> class+module+description
(but current's version only have module=unknown, so what's it
for, why not usb.ids?)
tools using those databases:
- library ldetect accesses usbtable from ldetect-lst
this library is used by DrakX and drakxtools
- i don't know if tools are using modules.usbmap
- scanner --------------------
- ScannerDB (in ldetect-lst)
maps name -> driver+kind(usb,scsi,serial,parallel)+options+various
(i don't know much about it, i don't know if yves made it from
scratch or what. ask for more)
- isdn --------------------
- isdn.db (in ldetect-lst)
list of internet providers by country
-> phone number + domainname + dns1 (ip) + dns2
- old or small databases ----------
- isa.lst (detect), isatable (ldetect-lst), modules.isapnpmap (kernel)
- pcmcia.lst (detect, discover-data), pcmciatable (ldetect-lst)
- modules.parportmap (kernel but empty?)
- modules.ieee1394map (kernel but empty?)
There may be some errors, or some missing stuff, please correct me!
I've written a tool to keep in sync with as many databases as
possible. see in
Maybe some common mailing list could be set up to deal with this?
*but* note that the database is quite kernel dependent.
- our pcitable doesn't handle this nicely
- redhat has "upgradelist" in hwdata to partly handle this
- i know we handle some pbs via /lib/modutils/macros with things like
"if `kernelversion` = 2.4", debian seems to have it in
Once again, hopefully one day modules.pcimap and modules.usbmap will
be the reference! :)
> Mandrake switched from libdetect to kudzu, afaik
> (latest mandrake (8.2) version is using kudzu for HW detection).
well, mandrake has many tools doing more or less the same thing (and
alas, not exactly always the same thing): DrakX (during install),
drakxtools (when called, after install), kudzu (at boot, usually
calling a drakxtools)
List of hardware probing tools to use for displayconfig:
[1] xvinfo - Print out X-Video extension adaptor information
xvinfo prints out the capabilities of any video adaptors
associated with the display
that are accesible through the X-Video extension.
[2] xresprobe - Prints out resolutions, frequency and displaytype.
Doesn't work in all cases. Works via ddc, I guess.
[3] ddcprobe - Uses VESA BIOS Extension
Detects VGA + OEM, modes (only set up modes?), vid mem (kudzu)
[3] read-edid
get-edid|parse-edid prints out a "good-looking" Monitor Section for
xorg.conf, not reliable (failed on notebook)
[4] ddcxinfo - prints out modelines, hsync and vsync (kudzu)
[5] svgamodes - prints out supported video modes (kudzu)
programming languages addict

@ -0,0 +1,135 @@
* How many cards do we have? autodetection?
* Is our card a dualhead card?
* How many monitors are connected?
* difference between one and two card is different device sections
* twinview has one device, one screen, one serverlayout
* xinerama has two devices, two screens, two monitors
twinview <> xinerama:
all sections double
one or two cards:
different device sections
one or two monitors
?? one or two cards
?? twinview or xinerama (driver? different resolutions?)
class XSetup(Object):
Screens[] getScreens()
bool maySetDualhead()
(xoff,yoff) getDualheadPosition() # offset from screen 1 top left corner.
bool is3DAccelerated()
GFXCard[] getGFXCards()
class Screen(Object):
Resolution[] getAvailableResolutions()
int getRefreshRate()
bool isAvailableMirrorHorizontal()
bool isAvailableMirrorVertical()
class Resolution(Object):
int getWidth()
int getHeight()
int[] getRefreshRates():
* What is the current setup? (Xinerama? Singlehead? Twinview?)
- Warning: Xinerama vs. DRI
* "unlinking" the sliders will yield a warning "Using different
resolutions on the screens will disable 3D hardware acceleration on
the second head", which is a Xinerama deficiency).
Note: Probably only Ati and nvidia do support mergedFB properly, other
drivers might lose xinerama features like placement and maximize
- Drag and drop widget
* The fun part: implementing a Drag and Drop widget where the (resizing)
screens can be dragged into their respective relative position,
"snapping" in the more obvious ones, i.e. plain "left of" and "right
of", "above" and "under" (without offset).
- displayconfig.MonitorPreview:
Singleheadpreview: Monitor keeps size
DualheadPreview: like now, monitor resizes to show relative screen size
Displayconfig; Notes abstractielaag
* een XSetup heeft N gfxcards.
* een GfxCard heeft N Monitors
* XSetup is een container voor alle objecten uit de abstractielaag.
* XSetup.addMonitor(monitor,gfxcard) waarbij gfxcard al in XSetup zit en een
referentie naar de kaart vormt waarop monitor is aangesloten.
* Een Adaptor heeft een 1:1 relatie met een monitor, en is 'onderdeel' van
een "Screen" (in de zin van Screen section uit xorg.conf)
* Controls zoals resize en de rotatie / mirroring widgets manipuleren een
Adaptor, die intern de Screen manipuleert
* Singlehead resolutie verandert via xrandr en slaat settings op via
* Dualhead resolutie aanpassen pakt intern een passende metamode (bij twinview)
en checkt of alle zinvolle metamodes beschikbaar zijn, anders wordt de user
gewaarschuwd dat dit eerst moet gebeuren.
* Adaptor in dualhead / twinview modus worden dus naar een screen vertaald
metamodes heeft.
* Screen moet dan nog support voor metamodes krijgen.
* Current resolution doesn't get recognized if current != highest resolution
* new tab display powermanagement, just like the existing tab, we need to be
able to at least replace existing functionality
New Widgets:
* DualheadPreview
* RadioButtons instead of dropdown for Positioning
* Detect if we're already running on dualhead, (en|dis)able widgets accordingly
* Nvidia MergedFB
- Make preview of dualhead more clear (only xinerama or also mergedFB?)
- Generate list of Metamodes from resolutions available
- write dualhead settings to xorg.conf
* Compare dualhead with different drivers WRT xorg.conf
- generic Xinerama (Matrox, others?)
- dualhead for fglrx, SiS ...
- MergedFB as special case for nvidia (sis?)
* Preview should be rotatable (and|or) resizable (and|or) DualHeadpreview?
* Add missing elements to DualHeadTab
- [ ] Use MergedFB (binds two resolution sliders)
- label with warning "You can only use DRI on one head with different resolutions blahblah"
FIXME: enabling Dualhead should:
- Update resolutions with "metamodes"
- disable Rotation/mirroring stuff
- Add ServerLayout to xorg.conf
- Add second Screen to xorg.conf
- Alternatively (if both resolutions are the same enable MergedFB

@ -0,0 +1,11 @@
# Set the X server resolution to that selected by the user.
# This needs to be done before windows managers or X clients start,
# otherwise the DPI and fonts sizes get all screwed up.
# This file is sourced by Xsession(5), not executed.
# The "|| true" is to ensure that the Xsession script does not terminate
# and stop the login if something fails in the Python program.
/opt/kde3/bin/displayconfig-restore || true

@ -0,0 +1,340 @@
# - #
# ------------------------------ #
# copyright : (C) 2005 by Simon Edwards #
# email : #
# #
# #
# 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. #
# #
"""Provides information about the devices attached to the PCI bus.
import struct
import csv
import os.path
import sys
class PCIDevice(object):
def __init__(self,line=None):
self.vendor = None # PCI vendor id
self.device = None
self.subvendor = None # 0xffff if not probe_type'd or no subid
self.subdevice = None # 0xffff if not probe_type'd or no subid
self.pci_class = None # 'None' if not probe_type'd
self.pci_bus = None # pci bus id 8 bits wide
self.pci_device = None # pci device id 5 bits wide
self.pci_function = None# pci function id 3 bits wide
self.module = None
self.text = None
self.already_found = False
if line is not None:
def isGfxCard(self):
if self.module is not None and \
(self.module.startswith("Card:") or self.module.startswith("Server:XFree86(")):
return True
def getModule(self):
if self.module is not None:
if self.module.startswith("Server:XFree86("):
return self.module[15:-1]
elif self.module.startswith("Card:"):
return self.module[5:]
return self.module
def isModuleXorgDriver(self):
return self.module is not None and \
(self.module.startswith("Server:XFree86(") or self.module.startswith("Card:"))
def __str__(self):
s = "PCI:%i:%i:%i, " % (self.pci_bus,self.pci_device,self.pci_function)
s += "Vendor:%x, Device:%x," % (self.vendor,self.device)
if self.subvendor is not None:
s += " Subvendor:%x," % self.subvendor
if self.subdevice is not None:
s += " Subdevice:%x," % self.subdevice
if self.pci_class is not None:
s += " Class:%x," % self.pci_class
if self.module is not None:
s += " Module:%s," % self.module
if self.text is not None:
s += " Text:%s" % self.text
return s
def loadFromString(self,line):
parts = line.split(",")
for i in range(len(parts)):
bit = parts[i].strip()
if bit.startswith("PCI:"):
pci_code = bit[4:].split(":")
self.pci_bus = int(pci_code[0])
self.pci_device = int(pci_code[1])
self.pci_function = int(pci_code[2])
elif bit.startswith("Vendor:"):
self.vendor = int(bit[7:],16)
elif bit.startswith("Device:"):
self.device = int(bit[7:],16)
elif bit.startswith("Subvendor:"):
self.subvendor = int(bit[10:],16)
elif bit.startswith("Subdevice:"):
self.subdevice = int(bit[10:],16)
elif bit.startswith("Class:"):
self.pci_class = int(bit[6:],16)
elif bit.startswith("Module:"):
self.module = bit[7:]
elif bit.startswith("Text:"):
self.text = " ".join(parts[i:]).strip()[5:]
class PCIBus(object):
def __init__(self, data_file_dir="."):
self.devices = []
self.data_file_dir = data_file_dir
def detect(self,device_data="/proc/bus/pci/devices"):
# Shamelessly translated from ldetect's pci.c.
fhandle = open(device_data)
for line in fhandle.readlines():
#print "L:",line
entry = PCIDevice()
parts = line.split()
devbusfn = int(parts[0],16)
idbits = int(parts[1],16)
entry.vendor = idbits >> 16
entry.device = idbits & 0xffff
entry.pci_bus = devbusfn >> 8
entry.pci_device = (devbusfn & 0xff) >> 3
entry.pci_function = (devbusfn & 0xff) & 0x07
infohandle = open("/proc/bus/pci/%02x/%02x.%d" % (
entry.pci_bus, entry.pci_device, entry.pci_function),"r")
# these files are 256 bytes but we only need first 48 bytes
buf =
(class_prog, entry.pci_class, entry.subvendor, entry.subdevice) = \
#print "STRUCT: ",struct.unpack("@xxxxxxxxxBHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHH",buf)
if (entry.subvendor==0 and entry.subdevice==0) or \
(entry.subvendor==entry.vendor and entry.subdevice==entry.device):
entry.subvendor = 0xffff
entry.subdevice = 0xffff
if entry.pci_class == PCIBus.PCI_CLASS_SERIAL_USB:
# taken from kudzu's pci.c
if class_prog == 0:
entry.module = "usb-uhci"
elif class_prog == 0x10:
entry.module = "usb-ohci"
elif class_prog == 0x20:
entry.module = "ehci-hcd"
if entry.pci_class == PCIBus.PCI_CLASS_SERIAL_FIREWIRE:
# taken from kudzu's pci.c
if class_prog == 0x10:
entry.module = "ohci1394"
except IOError:
#if False or os.path.exists("/usr/share/ldetect-lst/pcitable"):
def _resolveDevicesWithLdetect(self):
# Scan the PCI database.
#fhandle = open(os.path.join(self.data_file_dir,"pcitable"),"r")
fhandle = open(os.path.join("/opt/kde3/share/apps/guidance/","pcitable"),"r")
# This class is just for skipping comment lines in the database file.
# This whole class is just an iterator wrapper that we put around our file iterator.
class commentskipperiterator(object):
def __init__(self,fhandle):
self.fhandle = iter(fhandle)
def __iter__(self):
return self
def next(self):
line =
while line[0]=="#":
line =
return line
unknowndevices = self.devices[:]
# Process each row of the DB.
for row in csv.reader(commentskipperiterator(fhandle),delimiter='\t'):
if len(row)==4:
(vendor,device,module,text) = row
elif len(row)==6:
(vendor, device, subvendor, subdevice, module, text) = row
subvendor = int(subvendor[2:],16)
subdevice = int(subdevice[2:],16)
vendor = int(vendor[2:],16) # parse hex numbers of the form 0x1abc
device = int(device[2:],16)
i = 0
while i<len(unknowndevices):
pcidevice = unknowndevices[i]
if pcidevice.vendor==vendor and pcidevice.device==device \
and (len(row)==4 \
or (pcidevice.subvendor==subvendor and pcidevice.subdevice==subdevice)):
if module!="unknown":
pcidevice.module = module
pcidevice.text = text
if len(row)==6: # Close match, also matched on subdevice/subvendor ids.
del unknowndevices[i]
i += 1
i += 1
def _resolveDevicesWithDiscover(self):
unknown_devices = self.devices[:]
def _resolveDevicesWithDiscoverFile(self,filename,unknown_devices):
# Scan the PCI database.
fhandle = open(filename,"r")
# Process each row of the DB.
for line in fhandle:
row = line.replace("\t"," ").split(" ")
if len(row) >= 1 and row[0] != '':
# Skip manufacturer info lines.
vendor = int(row[1][:4],16)
device = int(row[1][4:],16)
module = row[3]
text = ' '.join(row[4:]).strip()
i = 0
while i<len(unknown_devices):
pcidevice = unknown_devices[i]
if pcidevice.vendor==vendor and pcidevice.device==device:
pcidevice.module = module
pcidevice.text = text
del unknown_devices[i]
i += 1
def _resolveDevicesWithHwdata(self):
# Scan the PCI database.
fhandle = open("/usr/share/hwdata/pci.ids","r")
# This class is just for skipping comment lines in the database file.
# This whole class is just an iterator wrapper that we put around our file iterator.
class commentskipperiterator(object):
def __init__(self,fhandle):
self.fhandle = iter(fhandle)
def __iter__(self):
return self
def next(self):
line =
while line[0]=="#":
line =
return line
unknowndevices = self.devices[:]
# Process each row of the DB.
for row in fhandle:
stripped_row = row.strip()
if stripped_row=='' or stripped_row[0]=='#':
continue # Comment or blank line, skip it.
if stripped_row[0]=='C':
# Reached the device class data, stop.
if row[0]!='\t':
# Vendor line
vendor_parts = stripped_row.split(' ')
vendor = int(vendor_parts[0],16)
if row[1]!='\t':
# Device line
device_parts = stripped_row.split(' ')
device = int(device_parts[0],16)
subvendor = None
subdevice = None
# Subvendor line
subvendor_parts = stripped_row.split(' ')
subvendor = int(subvendor_parts[0],16)
subdevice = int(subvendor_parts[1],16)
i = 0
while i<len(unknowndevices):
pcidevice = unknowndevices[i]
if pcidevice.vendor==vendor and pcidevice.device==device \
and (subvendor is None \
or (pcidevice.subvendor==subvendor and pcidevice.subdevice==subdevice)):
#pcidevice.module = module
if subvendor is None:
pcidevice.text = ' '.join(vendor_parts[1:]) + '|' + ' '.join(device_parts[1:]).strip()
i += 1
pcidevice.text = ' '.join(vendor_parts[1:]) + '|' + ' '.join(device_parts[1:]+subvendor_parts[2:]).strip()
del unknowndevices[i] # Perfect match, finished with this device.
i += 1