Python win32api.GetVersionEx() Examples

The following are 6 code examples of win32api.GetVersionEx(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module win32api , or try the search function .
Example #1
Source File: app.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def InitInstance(self):
		" Called to crank up the app "
		numMRU = win32ui.GetProfileVal("Settings","Recent File List Size", 10)
		win32ui.LoadStdProfileSettings(numMRU)
#		self._obj_.InitMDIInstance()
		if win32api.GetVersionEx()[0]<4:
			win32ui.SetDialogBkColor()
			win32ui.Enable3dControls()

		# install a "callback caller" - a manager for the callbacks
#		self.oldCallbackCaller = win32ui.InstallCallbackCaller(self.CallbackManager)
		self.LoadMainFrame()
		self.SetApplicationPaths() 
Example #2
Source File: platutils.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def get_platform():
    global os 
    rv = OSInfo()
    rv.platform = sys.platform
    if sys.platform.startswith("linux"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_linux_dist()
    elif sys.platform.startswith("darwin"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_darwin_dist()
    elif sys.platform in ("win32", "cli"):
        import os
        rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
        rv.osname = os.environ["OS"]
        rv.distribution = "Microsoft"
        if sys.platform == "win32":
            import win32api
            major, minor, build, api, extra = win32api.GetVersionEx()
            rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
            rv.release = "Unknown"
        elif sys.platform == "cli":
            rv.osversion = "Unknown"
            rv.release = "Unknown"
    return rv 
Example #3
Source File: platutils.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def get_platform():
    global os 
    rv = OSInfo()
    rv.platform = sys.platform
    if sys.platform.startswith("linux"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_linux_dist()
    elif sys.platform.startswith("darwin"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_darwin_dist()
    elif sys.platform in ("win32", "cli"):
        import os
        rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
        rv.osname = os.environ["OS"]
        rv.distribution = "Microsoft"
        if sys.platform == "win32":
            import win32api
            major, minor, build, api, extra = win32api.GetVersionEx()
            rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
            rv.release = "Unknown"
        elif sys.platform == "cli":
            rv.osversion = "Unknown"
            rv.release = "Unknown"
    return rv 
Example #4
Source File: platutils.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def get_platform():
    global os 
    rv = OSInfo()
    rv.platform = sys.platform
    if sys.platform.startswith("linux"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_linux_dist()
    elif sys.platform.startswith("darwin"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_darwin_dist()
    elif sys.platform in ("win32", "cli"):
        import os
        rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
        rv.osname = os.environ["OS"]
        rv.distribution = "Microsoft"
        if sys.platform == "win32":
            import win32api
            major, minor, build, api, extra = win32api.GetVersionEx()
            rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
            rv.release = "Unknown"
        elif sys.platform == "cli":
            rv.osversion = "Unknown"
            rv.release = "Unknown"
    return rv 
Example #5
Source File: platutils.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def get_platform():
    global os 
    rv = OSInfo()
    rv.platform = sys.platform
    if sys.platform.startswith("linux"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_linux_dist()
    elif sys.platform.startswith("darwin"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_darwin_dist()
    elif sys.platform in ("win32", "cli"):
        import os
        rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
        rv.osname = os.environ["OS"]
        rv.distribution = "Microsoft"
        if sys.platform == "win32":
            import win32api
            major, minor, build, api, extra = win32api.GetVersionEx()
            rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
            rv.release = "Unknown"
        elif sys.platform == "cli":
            rv.osversion = "Unknown"
            rv.release = "Unknown"
    return rv 
Example #6
Source File: platutils.py    From pycopia with Apache License 2.0 5 votes vote down vote up
def get_platform():
    global os 
    rv = OSInfo()
    rv.platform = sys.platform
    if sys.platform.startswith("linux"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_linux_dist()
    elif sys.platform.startswith("darwin"):
        import os # making this global breaks on IronPython
        osname, _, kernel, _, arch = os.uname()
        rv.arch = arch
        rv.osname = osname
        rv.osversion = kernel
        rv.distribution, rv.release = _get_darwin_dist()
    elif sys.platform in ("win32", "cli"):
        import os
        rv.arch = os.environ["PROCESSOR_ARCHITECTURE"]
        rv.osname = os.environ["OS"]
        rv.distribution = "Microsoft"
        if sys.platform == "win32":
            import win32api
            major, minor, build, api, extra = win32api.GetVersionEx()
            rv.osversion = "%d.%d.%d-%s" % (major, minor, build, extra)
            rv.release = "Unknown"
        elif sys.platform == "cli":
            rv.osversion = "Unknown"
            rv.release = "Unknown"
    return rv