コード例 #1
0
        def GetImage(self, name):
            from i18n import getImage
            import cStringIO

            f = getImage(name)

            raw = wx.ImageFromStream(cStringIO.StringIO(f.read())).Copy()
            return wx.BitmapFromImage(raw)
コード例 #2
0
ファイル: Shutdown.py プロジェクト: HackLinux/chandler
 def GetImage(self, name):
     from i18n import getImage
     import cStringIO
     
     f = getImage(name)
     
     raw = wx.ImageFromStream(cStringIO.StringIO(f.read())).Copy()
     return wx.BitmapFromImage(raw)
コード例 #3
0
ファイル: AboutBox.py プロジェクト: HackLinux/chandler
def _getRelImagePath(imgName):
    f = i18n.getImage(imgName)

    if f is None:
        return ""

    n = f.name

    if isinstance(n, unicode):
        n = n.encode(sys.getfilesystemencoding())

    #We want a relative directory so
    #remove CHANDLERHOME from path
    p = n.split(Globals.chandlerDirectory)[1]

    #We still want a relative path so strip of the leading
    #directory path separator
    if p[0] == os.path.sep:
        p = p[1:]

    return unicode(p, sys.getfilesystemencoding())
コード例 #4
0
def _getRelImagePath(imgName):
    f = i18n.getImage(imgName)

    if f is None:
        return ""

    n = f.name

    if isinstance(n, unicode):
        n = n.encode(sys.getfilesystemencoding())

    #We want a relative directory so
    #remove CHANDLERHOME from path
    p = n.split(Globals.chandlerDirectory)[1]

    #We still want a relative path so strip of the leading
    #directory path separator
    if p[0] == os.path.sep:
        p = p[1:]

    return unicode(p, sys.getfilesystemencoding())