# Path: Wammu/Locales.py
# def ugettext(message):
#     if _TRANSLATION:
#         if six.PY2:
#             return _TRANSLATION.ugettext(message)
#         return _TRANSLATION.gettext(message)
#     return message


import wx
import re
from Wammu.Locales import ugettext as _
            self.config.Write('/%s/model' % path, model)
        if not found:
            self.list.append({'Id': position, 'Name': name, 'Path': path})
        self.config.Flush()

    def FirstFree(self):
        '''
        Find first free entry in configuration file.
        '''
        idxmap = {}
        first_free = None
        for config in self.list:
            idxmap[config['Id']] = 1
        for i in range(1000):
            if i not in idxmap:
                first_free = i
                break
        if first_free is None:
            raise Exception('Could not find free configuration entry!')
        return first_free

    def GetConfigList(self, new=False):
        '''
        Returns list of available configurations as tuple of (details, verbose).
        '''
        lst = []
        if new:
            lst.append({
                'Id': self.FirstFree(),
                'Path': None,

# Path: Wammu/Locales.py
# def ugettext(message):
#     if _TRANSLATION:
#         if six.PY2:
#             return _TRANSLATION.ugettext(message)
#         return _TRANSLATION.gettext(message)
#     return message


# Path: Wammu/GammuSettings.py
import wx
import re
from Wammu.Locales import ugettext as _

            self.config.Write('/%s/model' % path, model)
        if not found:
            self.list.append({'Id': position, 'Name': name, 'Path': path})
        self.config.Flush()

    def FirstFree(self):
        '''
        Find first free entry in configuration file.
        '''
        idxmap = {}
        first_free = None
        for config in self.list:
            idxmap[config['Id']] = 1
        for i in range(1000):
            if i not in idxmap:
                first_free = i
                break
        if first_free is None:
            raise Exception('Could not find free configuration entry!')
        return first_free

    def GetConfigList(self, new=False):
        '''
        Returns list of available configurations as tuple of (details, verbose).
        '''
        lst = []
        if new:
            lst.append({
                'Id': self.FirstFree(),
                'Path': None,

                'Name': _('Create new configuration')