# Path: Wammu/Locales.py
# def StrConv(txt):
#     """
#     This function coverts something (txt) to string form usable by wxPython. There
#     is problem that in default configuration in most distros (maybe all) default
#     encoding for unicode objects is ascii. This leads to exception when converting
#     something different than ascii. And this exception is not catched inside
#     wxPython and leads to segfault.
# 
#     So if wxPython supports unicode, we give it unicode, otherwise locale
#     dependant text.
#     """
#     try:
#         if isinstance(txt, unicode):
#             return txt
#         elif isinstance(txt, str):
#             return unicode(txt, LOCALE_CHARSET)
#         return str(txt)
#     except UnicodeEncodeError:
#         return '???'
# 
# 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 wx.wizard
import Wammu.Paths
import Wammu.Wizard
import Wammu.Data
import Wammu.SettingsStorage
import Wammu.PhoneSearch
import Wammu.Events
import Wammu.Utils
import wx.lib.hyperlink
from Wammu.Locales import StrConv
from Wammu.Locales import ugettext as _
                limit=self.parent.settings.GetConnection(),
                win=self
            )
            self.thread.start()
            self.results = []

    def SearchNotice(self, title, text):
        evt = Wammu.Events.ShowMessageEvent(
            message=text,
            title=title,
            type=wx.ICON_WARNING
        )
        wx.PostEvent(self, evt)

    def SearchMessage(self, text):
        """
        This has to send message as it is called from different thread.
        """
        evt = Wammu.Events.TextEvent(text=text + '\n')
        wx.PostEvent(self, evt)

    def SearchDone(self, lst):
        """
        This has to send message as it is called from different thread.
        """
        self.results = lst
        evt = Wammu.Events.DoneEvent()
        wx.PostEvent(self, evt)

    def OnText(self, evt):

# Path: Wammu/Locales.py
# def StrConv(txt):
#     """
#     This function coverts something (txt) to string form usable by wxPython. There
#     is problem that in default configuration in most distros (maybe all) default
#     encoding for unicode objects is ascii. This leads to exception when converting
#     something different than ascii. And this exception is not catched inside
#     wxPython and leads to segfault.
# 
#     So if wxPython supports unicode, we give it unicode, otherwise locale
#     dependant text.
#     """
#     try:
#         if isinstance(txt, unicode):
#             return txt
#         elif isinstance(txt, str):
#             return unicode(txt, LOCALE_CHARSET)
#         return str(txt)
#     except UnicodeEncodeError:
#         return '???'
# 
# Path: Wammu/Locales.py
# def ugettext(message):
#     if _TRANSLATION:
#         if six.PY2:
#             return _TRANSLATION.ugettext(message)
#         return _TRANSLATION.gettext(message)
#     return message


# Path: Wammu/PhoneWizard.py
import wx
import wx.wizard
import Wammu.Paths
import Wammu.Wizard
import Wammu.Data
import Wammu.SettingsStorage
import Wammu.PhoneSearch
import Wammu.Events
import Wammu.Utils
import wx.lib.hyperlink
from Wammu.Locales import StrConv
from Wammu.Locales import ugettext as _

                limit=self.parent.settings.GetConnection(),
                win=self
            )
            self.thread.start()
            self.results = []

    def SearchNotice(self, title, text):
        evt = Wammu.Events.ShowMessageEvent(
            message=text,
            title=title,
            type=wx.ICON_WARNING
        )
        wx.PostEvent(self, evt)

    def SearchMessage(self, text):
        """
        This has to send message as it is called from different thread.
        """
        evt = Wammu.Events.TextEvent(text=text + '\n')
        wx.PostEvent(self, evt)

    def SearchDone(self, lst):
        """
        This has to send message as it is called from different thread.
        """
        self.results = lst
        evt = Wammu.Events.DoneEvent()
        wx.PostEvent(self, evt)

    def OnText(self, evt):

        self.edit.AppendText(StrConv(evt.text))