summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-04-10 14:15:51 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-04-10 14:15:51 +0200
commit8fea55de1d00401a1e5d7e185f664741a304dcf7 (patch)
tree44491228618afebe83700385a5e6a43516b20783
parentd038124033ca882ad57dd5395e631dcae9c08017 (diff)
downloadportato-8fea55de1d00401a1e5d7e185f664741a304dcf7.tar.gz
portato-8fea55de1d00401a1e5d7e185f664741a304dcf7.tar.bz2
portato-8fea55de1d00401a1e5d7e185f664741a304dcf7.zip
Make config sections be always unicode objects to fix the turkish capital I/i thingy
Diffstat (limited to '')
-rw-r--r--portato/session.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/portato/session.py b/portato/session.py
index ebf49af..aadf6c4 100644
--- a/portato/session.py
+++ b/portato/session.py
@@ -83,8 +83,8 @@ class Session (object):
- a function returning the number of option return values - getting them out of the program
"""
- convert = lambda (x,y): (y.upper(), x.lower())
- options = map(lambda x: (self._name, x.lower()) if not hasattr(x, "__iter__") else convert(x), options)
+ convert = lambda (x,y): (unicode(y).upper(), unicode(x).lower())
+ options = map(lambda x: (self._name, unicode(x).lower()) if not hasattr(x, "__iter__") else convert(x), options)
self._handlers.append((options, load_fn, save_fn, default))
def load (self, defaults_only = False):
@@ -140,7 +140,7 @@ class Session (object):
def set (self, key, value, section = None):
if section is None: section = self._name
- section = section.upper()
+ section = unicode(section).upper()
try:
self._cfg.set(section, key, value)
@@ -150,7 +150,7 @@ class Session (object):
def get (self, key, section = None):
if section is None: section = self._name
- section = section.upper()
+ section = unicode(section).upper()
try:
return self._cfg.get(section, key)
@@ -159,7 +159,7 @@ class Session (object):
def get_bool (self, key, section = None):
if section is None: section = self._name
- section = section.upper()
+ section = unicode(section).upper()
try:
return self._cfg.getboolean(section, key)
@@ -168,17 +168,17 @@ class Session (object):
def remove (self, key, section = None):
if section is None: section = self._name
- section = section.upper()
+ section = unicode(section).upper()
self._cfg.remove_option(section, key)
def remove_section (self, section):
- section = section.upper()
+ section = unicode(section).upper()
self._cfg.remove_section(section)
def rename (self, old, new, section = None):
if section is None: section = self._name
- section = section.upper()
+ section = unicode(section).upper()
val = self.get(old, section)
@@ -187,7 +187,7 @@ class Session (object):
self.set(new, val, section)
def rename_section (self, old, new):
- new = new.upper()
+ new = unicode(new).upper()
values = self._cfg.items(old)
self.remove_section(old)
@@ -202,7 +202,7 @@ class SectionDict (DictMixin):
"""A class, which maps a specific section of a session to a dictionary."""
def __init__ (self, session, section):
- self._section = section.upper()
+ self._section = unicode(section).upper()
self._session = session
def __getitem__ (self, name):
follow=1'>Add uninstall button and rename to PkgListWindowRené 'Necoro' Neumann1-2/+17 2009-10-05First quick hack to have a world listRené 'Necoro' Neumann3-2/+24 2009-09-06Re-formulate the debug message if a menu file has been found.René 'Necoro' Neumann1-1/+1 2009-09-06Update ui files with gladeRené 'Necoro' Neumann8-72/+167 2009-09-06Install .menuRené 'Necoro' Neumann1-1/+1 2009-09-06Automatic loading of the external menuRené 'Necoro' Neumann2-3/+25 2009-09-06Make glade update the MainWindow.ui fileRené 'Necoro' Neumann1-85/+134 2009-09-06Moved the menu to an extra fileRené 'Necoro' Neumann2-210/+207 2009-09-05One database instance is enough :)René 'Necoro' Neumann1-7/+18 2009-09-05Print database type at the bottom of exceptions. NOTE: This does not handle m...René 'Necoro' Neumann2-1/+6 2009-09-05Fix an error, where a category vanishes after refreshing, using the EixSQLDat...René 'Necoro' Neumann2-1/+19 2009-09-03And here is the debugging again :) ... using ctypesRené 'Necoro' Neumann1-1/+8 2009-09-03Fix the segfault in GLib due to wrong encodingRené 'Necoro' Neumann1-0/+1 2009-09-03Screw debugging ... prefer the ctypes approach to get rid of yet another c-mo...René 'Necoro' Neumann3-27/+11 2009-09-03Use this wrapper instead of ctypes to set the textdomain and stuff for the gt...René 'Necoro' Neumann1-9/+5 2009-09-03Add small wrapper to C-gettextRené 'Necoro' Neumann2-1/+22 2009-08-31Update messages.potRené 'Necoro' Neumann1-42/+94 2009-08-31Removed the gtk- strings from translationsRené 'Necoro' Neumann7-3639/+3479 2009-08-31Removed the 'translatable' attribute from 'gtk-*' stringsRené 'Necoro' Neumann5-11/+11 2009-08-31Removed TODO. Renamed ChangeLog to TODORené 'Necoro' Neumann2-40/+0 2009-08-27Only import stuff if necessaryRené 'Necoro' Neumann1-8/+8 2009-08-25Release the threadQueue-Lock in syncv0.13René 'Necoro' Neumann1-0/+1 2009-08-25Updated portugese translationAlberto Federman Neto1-650/+687 2009-08-15Update spanish translationDaniel Halens1-245/+258 2009-08-15Use boolean flags instead of obscure C flags for ipc.MessageQueueRené 'Necoro' Neumann3-13/+15 2009-08-15TypoRené 'Necoro' Neumann1-1/+1 2009-08-15Enhanced the extensions.shRené 'Necoro' Neumann1-3/+8 2009-08-15Move eix-format to correct locationRené 'Necoro' Neumann1-0/+0