~osomon/phatch/extract-all-metadata

« back to all changes in this revision

Viewing changes to wxcheck.py

  • Committer: stani
  • Date: 2007-06-12 17:18:53 UTC
  • Revision ID: spe.stani.be@gmail.com-20070612171853-cndnqupa2o42iai4
gettext support, major rewrite

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import sys
2
 
from translation import _
3
2
 
4
3
def ensure(recommended,minimal):
5
4
    """Ensures the minimal version of wxPython is installed.
21
20
    try:
22
21
        import wx
23
22
    except ImportError:
24
 
        sys.stderr.write(_(
25
 
              'Error: wxPython %s (or at least %s) can not be found,'
26
 
              'but is required.')\
27
 
                %(recommended,minimal)
 
23
        sys.stderr.write(_('Error')+': wxPython %s ('%recommended+
 
24
            _('or at least')+' '+minimal+') '+
 
25
            _('can not be found, but is required.')
28
26
        )
29
27
        sys.exit()
30
28
        
32
30
    if wx.VERSION_STRING < minimal: 
33
31
        class MyApp(wx.App):
34
32
            def OnInit(self):
35
 
                result = wx.MessageBox(_(
36
 
                    "This application is known to be compatible with\n"
37
 
                    "wxPython version(s) %s (or at least %s),\n"
38
 
                    "but you have %s installed.\n\n"
39
 
                    "Please upgrade your wxPython.")\
40
 
                    %(recommended, minimal, wx.VERSION_STRING),
41
 
                    "wxPython Version Error",
 
33
                result = wx.MessageBox(
 
34
                    _("This application is known to be compatible with\n"
 
35
                    "wxPython version(s) ")+recommended+
 
36
                    " ("+_("or at least")+" "+minimal+"),\n"+
 
37
                    _("but you have")+" %s "%wx.VERSION_STRING+_("installed")+
 
38
                    ".\n\n"+_("Please upgrade your wxPython."),
 
39
                    _("wxPython Version Error"),
42
40
                    style   = wx.ICON_ERROR)
43
41
                return False
44
42
        app = MyApp()