Пример #1
0
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

##IMPORTS######################################################################
import nt
import sys

##LOGGING######################################################################
from iptest.util import get_env_var

try:
    import logging as l

    __log_file = get_env_var("TMP") + "\\iptest.log"
    l.basicConfig(level=l.DEBUG,
                  format="%(asctime)s %(levelname)-8s %(message)s",
                  filename=__log_file,
                  filemode="w+")
    __temp_handler = l.StreamHandler(sys.stdout)
    __temp_formatter = l.Formatter("%(asctime)s %(levelname)-8s %(message)s")
    __temp_handler.setFormatter(__temp_formatter)
    __temp_handler.setLevel(l.INFO)
    l.getLogger().addHandler(__temp_handler)

    #Hack needed because IP doesn't implement sys._getframe by default
    if sys.platform != "win32":
        l.getLogger().findCaller = lambda: ("Unknown", 0, "Unknown")
except:
    #Fake the implementation of logging module under Silverlight
Пример #2
0
if is_ironpython:
    #We'll use System, if available, to figure out more info on the test
    #environment later
    import System
    import clr


#--The bittedness of the Python implementation
is_cli32, is_cli64 = False, False
if is_ironpython: 
    is_cli32, is_cli64 = (System.IntPtr.Size == 4), (System.IntPtr.Size == 8)

is_32, is_64 = is_cli32, is_cli64
if not is_ironpython:
    cpu = get_env_var("PROCESSOR_ARCHITECTURE")
    if cpu.lower()=="x86":
        is_32 = True
    elif cpu.lower()=="amd64":
        is_64 = True
    

#--CLR version we're running on (if any)
is_orcas = False
if is_cli:
    is_orcas = len(clr.GetClrType(System.Reflection.Emit.DynamicMethod).GetConstructors()) == 8


#--Newlines
if is_ironpython:
    newline = System.Environment.NewLine
Пример #3
0
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

##IMPORTS######################################################################
import sys
import os

##LOGGING######################################################################
from iptest.util import get_env_var

try:
    import logging as l

    __log_file = os.path.join(get_env_var("TMP"), "iptest.log")
    l.basicConfig(level=l.DEBUG,
                  format="%(asctime)s %(levelname)-8s %(message)s",
                  filename=__log_file,
                  filemode="w+")
    __temp_handler = l.StreamHandler(sys.stdout)
    __temp_formatter = l.Formatter("%(asctime)s %(levelname)-8s %(message)s")
    __temp_handler.setFormatter(__temp_formatter)
    __temp_handler.setLevel(l.INFO)
    l.getLogger().addHandler(__temp_handler)

    #Hack needed because IP doesn't implement sys._getframe by default
    if sys.platform != "win32":
        l.getLogger().findCaller = lambda stack_info=False: ("Unknown", 0,
                                                             "Unknown")
except:
Пример #4
0
    #We'll use System, if available, to figure out more info on the test
    #environment later
    import System
    import clr
    is_posix = sys.platform == 'posix' or System.Environment.OSVersion.Platform == System.PlatformID.Unix
    is_osx = os.path.exists('/System/Library/CoreServices/SystemVersion.plist')
    is_mono = clr.IsMono

#--The bittedness of the Python implementation
is_cli32, is_cli64 = False, False
if is_ironpython:
    is_cli32, is_cli64 = (System.IntPtr.Size == 4), (System.IntPtr.Size == 8)

is_32, is_64 = is_cli32, is_cli64
if not is_ironpython:
    cpu = get_env_var("PROCESSOR_ARCHITECTURE")
    if cpu.lower() == "x86":
        is_32 = True
    elif cpu.lower() == "amd64":
        is_64 = True

#--CLR version we're running on (if any)
is_orcas = False
if is_cli:
    is_orcas = len(
        clr.GetClrType(
            System.Reflection.Emit.DynamicMethod).GetConstructors()) == 8

is_net40 = False
is_net45 = False
is_net45Or46 = False
Пример #5
0
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

##IMPORTS######################################################################
import nt
import sys

##LOGGING######################################################################
from iptest.util     import get_env_var

try:
    import logging as l
    
    __log_file = get_env_var("TMP") + "\\iptest.log"
    l.basicConfig(level=l.DEBUG,
                  format="%(asctime)s %(levelname)-8s %(message)s",
                  filename=__log_file,
                  filemode="w+")
    __temp_handler = l.StreamHandler(sys.stdout)
    __temp_formatter = l.Formatter("%(asctime)s %(levelname)-8s %(message)s")
    __temp_handler.setFormatter(__temp_formatter)
    __temp_handler.setLevel(l.INFO)
    l.getLogger().addHandler(__temp_handler)

    #Hack needed because IP doesn't implement sys._getframe by default
    if sys.platform!="win32":
        l.getLogger().findCaller = lambda: ("Unknown", 0, "Unknown")
except:
    #Fake the implementation of logging module under Silverlight