FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 12-01-2008, 02:44 PM
Cole Robinson
 
Default virtinst: also look at xorg.conf for keymap

Cole Robinson wrote:
> Guido GŁnther wrote:
>> Hi,
>> attached patch looks at xorg.conf if no /etc/sysconfig/keyboard for the
>> default keyboard. This helps with distros that don't have
>> /etc/sysconfig/ like Debian.
>> Cheers,
>> -- Guido
>>
>
> Couple small nits:
>
>> HG changeset patch
>> # User Guido GŁnther <agx@sigxcpu.org>
>> # Date 1227979760 -3600
>> # Node ID a292eb8430cd2d9544e89dba127323704f3963ce
>> # Parent 16e923676e84d81cf9bf6dc2cdd30d95bf65bbe1
>> parse xorg.conf for keymap
>>
>> diff -r 16e923676e84 -r a292eb8430cd virtinst/util.py
>> --- a/virtinst/util.py Tue Nov 25 10:25:08 2008 -0500
>> +++ b/virtinst/util.py Sat Nov 29 18:29:20 2008 +0100
>> @@ -33,6 +33,7 @@
>>
>>
>> KEYBOARD_DIR = "/etc/sysconfig/keyboard"
>> +XORG_CONF = "/etc/X11/xorg.conf"
>>
>> def default_route():
>> route_file = "/proc/net/route"
>> @@ -276,6 +277,28 @@
>> return -1
>> return 0
>>
>> +def xorg_keymap():

One other thing: could you rename this to _xorg_keymap so it isn't
confused for a public function?

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-01-2008, 05:53 PM
Guido GŁnther
 
Default virtinst: also look at xorg.conf for keymap

On Mon, Dec 01, 2008 at 10:28:15AM -0500, Cole Robinson wrote:
> > + import keytable
>
> This is unused ('python setup.py check' will warn about this
Fixed.
>
> > + kt = None
> > + try:
> > + f = open(XORG_CONF, "r")
> > + except IOError, e:
> > + logging.debug('Could not open "%s": %s ' % (XORG_CONF, str(e)))
> > + else:
> > + keymap_re = re.compile(r's*Options+"XkbLayout"s+"(?P<kt>[a-z-]+)"')
> > + for line in f:
> > + m = keymap_re.match(line)
> > + if m:
> > + kt = m.group('kt')
> > + break
> > + else:
> > + logging.debug("Didn't find keymap '%s' in keytable!" % kt)
>
> This logging isn't really accurate here. Maybe 'Didn't find keymap in
> xorg.conf'
Yes, that's bogus. Fixed version attached.
-- Guido
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-01-2008, 06:07 PM
Cole Robinson
 
Default virtinst: also look at xorg.conf for keymap

Guido GŁnther wrote:
> On Mon, Dec 01, 2008 at 10:28:15AM -0500, Cole Robinson wrote:
>>> + import keytable
>> This is unused ('python setup.py check' will warn about this
> Fixed.
>>> + kt = None
>>> + try:
>>> + f = open(XORG_CONF, "r")
>>> + except IOError, e:
>>> + logging.debug('Could not open "%s": %s ' % (XORG_CONF, str(e)))
>>> + else:
>>> + keymap_re = re.compile(r's*Options+"XkbLayout"s+"(?P<kt>[a-z-]+)"')
>>> + for line in f:
>>> + m = keymap_re.match(line)
>>> + if m:
>>> + kt = m.group('kt')
>>> + break
>>> + else:
>>> + logging.debug("Didn't find keymap '%s' in keytable!" % kt)
>> This logging isn't really accurate here. Maybe 'Didn't find keymap in
>> xorg.conf'
> Yes, that's bogus. Fixed version attached.
> -- Guido
>

Applied now:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=bcd052e6ef9d

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 02:27 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org