當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.VERSION_STRING屬性代碼示例

本文整理匯總了Python中wx.VERSION_STRING屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.VERSION_STRING屬性的具體用法?Python wx.VERSION_STRING怎麽用?Python wx.VERSION_STRING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.VERSION_STRING屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: version

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import VERSION_STRING [as 別名]
def version():
    """
    Returns a string containing version and port info
    """
    if wx.Port == '__WXMSW__':
        port = 'msw'
    elif wx.Port == '__WXMAC__':
        if 'wxOSX-carbon' in wx.PlatformInfo:
            port = 'osx-carbon'
        else:
            port = 'osx-cocoa'
    elif wx.Port == '__WXGTK__':
        port = 'gtk'
        if 'gtk2' in wx.PlatformInfo:
            port = 'gtk2'
        elif 'gtk3' in wx.PlatformInfo:
            port = 'gtk3'
    else:
        port = '???'
    return "%s %s (phoenix)" % (wx.VERSION_STRING, port) 
開發者ID:dougthor42,項目名稱:wafer_map,代碼行數:22,代碼來源:core.py

示例2: destroy_widget

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import VERSION_STRING [as 別名]
def destroy_widget(self, level):
        if self.widget is None: return
        if misc.currently_under_mouse is self.widget:
            misc.currently_under_mouse = None

        self.widget.Hide()

        if wx.VERSION_STRING!="2.8.12.0":
            # unbind events to prevent new created (and queued) events
            self.widget.Bind(wx.EVT_PAINT, None)
            self.widget.Bind(wx.EVT_RIGHT_DOWN, None)
            self.widget.Bind(wx.EVT_LEFT_DOWN, None)
            self.widget.Bind(wx.EVT_MIDDLE_DOWN, None)
            self.widget.Bind(wx.EVT_ENTER_WINDOW, None)
            self.widget.Bind(wx.EVT_LEAVE_WINDOW, None)
            self.widget.Bind(wx.EVT_KEY_DOWN, None)
        compat.DestroyLater(self.widget)
        self.widget = None

        if misc.focused_widget is self:
            misc.set_focused_widget(None) 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:23,代碼來源:edit_base.py

示例3: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import VERSION_STRING [as 別名]
def __init__(self, bitmap, dpi):
        """
        Initialise a wxWindows renderer instance.
        """
        RendererBase.__init__(self)
        DEBUG_MSG("__init__()", 1, self)
        if wx.VERSION_STRING < "2.8":
            raise RuntimeError("matplotlib no longer supports wxPython < 2.8 for the Wx backend.\nYou may, however, use the WxAgg backend.")
        self.width  = bitmap.GetWidth()
        self.height = bitmap.GetHeight()
        self.bitmap = bitmap
        self.fontd = {}
        self.dpi = dpi
        self.gc = None 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:16,代碼來源:backend_wx.py

示例4: AddExceptHook

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import VERSION_STRING [as 別名]
def AddExceptHook(path, app_version='[No version]'):#, ignored_exceptions=[]):
    
    def handle_exception(e_type, e_value, e_traceback):
        traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func
        last_tb = get_last_traceback(e_traceback)
        ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno)
        if str(e_value).startswith("!!!"):
            Display_Error_Dialog(e_value)
        elif ex not in ignored_exceptions:
            ignored_exceptions.append(ex)
            result = Display_Exception_Dialog(e_type,e_value,e_traceback)
            if result:
                info = {
                    'app-title' : wx.GetApp().GetAppName(), # app_title
                    'app-version' : app_version,
                    'wx-version' : wx.VERSION_STRING,
                    'wx-platform' : wx.Platform,
                    'python-version' : platform.python_version(), #sys.version.split()[0],
                    'platform' : platform.platform(),
                    'e-type' : e_type,
                    'e-value' : e_value,
                    'date' : time.ctime(),
                    'cwd' : os.getcwd(),
                    }
                if e_traceback:
                    info['traceback'] = ''.join(traceback.format_tb(e_traceback)) + '%s: %s' % (e_type, e_value)
                    last_tb = get_last_traceback(e_traceback)
                    exception_locals = last_tb.tb_frame.f_locals # the locals at the level of the stack trace where the exception actually occurred
                    info['locals'] = format_namespace(exception_locals)
                    if 'self' in exception_locals:
                        info['self'] = format_namespace(exception_locals['self'].__dict__)
                
                output = open(path+os.sep+"bug_report_"+info['date'].replace(':','-').replace(' ','_')+".txt",'w')
                lst = info.keys()
                lst.sort()
                for a in lst:
                    output.write(a+":\n"+str(info[a])+"\n\n")

    #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args)
    sys.excepthook = handle_exception 
開發者ID:jgeisler0303,項目名稱:CANFestivino,代碼行數:42,代碼來源:objdictedit.py

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import VERSION_STRING [as 別名]
def __init__(self, parent):
        from eg.WinApi.SystemInformation import GetWindowsVersionString
        buildTime = time.strftime(
            Text.CreationDate,
            time.gmtime(eg.Version.buildTime)
        ).decode(eg.systemEncoding)
        totalMemory = GetRam()[0]
        pythonVersion = "%d.%d.%d %s %d" % tuple(sys.version_info)
        if is_stackless:
            pythonVersion = "Stackless Python " + pythonVersion
        self.sysInfos = [
            "Software",
            ("Program Version", eg.Version.string),
            ("Build Time", buildTime),
            ("Python Version", pythonVersion),
            ("wxPython Version", wx.VERSION_STRING),
            "\nSystem",
            ("Operating System", GetWindowsVersionString()),
            ("CPU", GetCpuName()),
            ("RAM", "%s GB" % totalMemory),
            "\nUSB-Devices",
        ]
        devices = eg.WinUsb.ListDevices()
        for hardwareId in sorted(devices.keys()):
            device = devices[hardwareId]
            self.sysInfos.append((device.name, device.hardwareId))
        lines = []
        for line in self.sysInfos:
            if isinstance(line, tuple):
                lines.append('<tr><td>%s:</td><td>%s</td></tr>' % line)
            else:
                lines.append('</table><p><b>%s</b><br><table>' % line)
        lines.append('</table>')
        page = "\n".join(lines)
        HtmlPanel.__init__(self, parent, page)
        self.htmlWindow.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.htmlWindow.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)

        contextMenu = wx.Menu()
        contextMenu.Append(wx.ID_COPY, eg.text.MainFrame.Menu.Copy)
        self.Bind(wx.EVT_MENU, self.OnCmdCopy, id=wx.ID_COPY)
        self.contextMenu = contextMenu 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:44,代碼來源:AboutDialog.py


注:本文中的wx.VERSION_STRING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。