예제 #1
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/eve/client/script/sys/evePatchService.py
import util

appName = 'EVE'
patchInfoURLs = {
    'optic': 'http://www.eve-online.com.cn/patches/',
    'ccp': 'http://client.eveonline.com/patches/'
}
optionalPatchInfoURLs = {
    'optic': 'http://www.eve-online.com.cn/patches/optional/',
    'ccp': 'http://client.eveonline.com/patches/optional/'
}
exports = util.AutoExports('appPatch', locals())
예제 #2
0
    testTasklet = uthread.new(fun)
    uthread.schedule(testTasklet)
    try:
        while testTasklet.alive:
            PD.Yield()

    except RuntimeError:
        PD.BeFrameNice()


def RunSymmetricalSingleNudeLODTest(iterations = 20, coldCache = True, printStatistics = True):
    RunSymmetricalSingleDollLODTest(iterations=iterations, printStatistics=printStatistics)


def RunSymmetricalSingleClothedDollLODTest(iterations = 20, coldCache = True, printStatistics = True):
    RunSymmetricalSingleDollLODTest(iterations=iterations, respaths=CollectCharacterSelectionPaths(), printStatistics=printStatistics)


def RunComprehensiveSymmetricalDollLODTest(iterations = 20):

    def fun():
        RunSymmetricalSingleNudeLODTest(coldCache=True, iterations=iterations)
        RunSymmetricalSingleClothedDollLODTest(coldCache=True, iterations=iterations)
        RunSymmetricalSingleNudeLODTest(coldCache=False, iterations=iterations)
        RunSymmetricalSingleClothedDollLODTest(coldCache=False, iterations=iterations)

    uthread.new(fun)


exports = util.AutoExports('paperDoll.testing', globals())
예제 #3
0
        if not hasattr(each, 'effect'):
            continue
        if not hasattr(each.effect, 'highLevelShaderName'):
            continue
        for entry in params:
            if entry.highLevelShader != each.effect.highLevelShaderName:
                continue
            resourcePath = ''
            if entry.textureName != 'NoTexture' and entry.parameter in each.effect.parameters and hasattr(each.effect.parameters[entry.parameter], 'resourcePath'):
                resourcePath = each.effect.parameters[entry.parameter].resourcePath.lower()
            if entry.textureName.lower() in resourcePath or entry.textureName == 'NoTexture':
                SetShaderMaterialValue(each.effect.parameters, entry.parameter, entry.value, entry.hdr)


def SetShaderMaterialValue(parameter, effectEntry, value, modifier = 1.0):
    if isinstance(value, basestring):
        parameter[effectEntry].resourcePath = value
    elif isinstance(value, float):
        parameter[effectEntry].value = value * modifier
    else:
        parameter[effectEntry].value = [ x * modifier for x in value ]


def UpdateEnlightenTexture():
    scene = sm.GetService('sceneManager').incarnaRenderJob.scene.object
    for entry in scene.Find('trinity.Tr2InteriorEnlightenSystem'):
        entry.UpdateEnlightenMaterialTextures()


exports = util.AutoExports('worldspaceCustomization', locals())
예제 #4
0
    return errorTuple


autoConsumeTypes = {}
autoConsumeGroups = {const.groupIceProduct: (const.flagSpecializedFuelBay, )}
autoConsumeCategories = {}


def GetBaysToCheck(typeID, priorityBays=[]):
    baysToCheck = priorityBays
    if baysToCheck is None:
        baysToCheck = []
    if typeID in autoConsumeTypes:
        baysToCheck.extend(autoConsumeTypes[typeID])
    else:
        invType = cfg.invtypes.Get(typeID)
        if invType.groupID in autoConsumeGroups:
            baysToCheck.extend(autoConsumeGroups[invType.groupID])
        elif invType.categoryID in autoConsumeCategories:
            baysToCheck.extend(autoConsumeCategories[invType.categoryID])
    if const.flagCargo not in baysToCheck:
        baysToCheck.append(const.flagCargo)
    return baysToCheck


def GetNameForFlag(flagID):
    return localization.GetByLabel(inventoryFlagData[flagID]['name'])


exports = util.AutoExports('inventoryFlagsCommon', locals())
예제 #5
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/carbon/common/script/mgt/logConst.py
import util
groupCoreCharacter = 30001
groupCoreItem = 30003
groupCoreMiscellaneous = 30002
eventCoreCharacterCancelPrepareRemove = 30004
eventCoreCharacterCreate = 30001
eventCoreCharacterDevPaperdollClone = 30019
eventCoreCharacterGmPaperdollCopy = 30018
eventCoreCharacterGmRecustomizationAuthorized = 30017
eventCoreCharacterLogoff = 30006
eventCoreCharacterLogon = 30005
eventCoreCharacterPaperdollAppearanceUpdated = 30015
eventCoreCharacterPaperdollCreated = 30014
eventCoreCharacterPrepareRemove = 30003
eventCoreCharacterPurchasedFullRecustomize = 30016
eventCoreCharacterRemove = 30002
eventCoreItemCreated = 30011
eventCoreItemOwnerChanged = 30013
eventCoreMiscellaneousAction = 30010
eventCoreMiscellaneousCommand = 30008
eventCoreMiscellaneousConsole = 30009
eventCoreMiscellaneousText = 30007
eventItemSingletonMade = 30012
exports = util.AutoExports('logConst', locals())
예제 #6
0
파일: logUtil.py 프로젝트: R4M80MrX/eve-1
        s = ' '.join(map(str, what))
    except UnicodeEncodeError:

        def conv(what):
            if isinstance(what, unicode):
                return what.encode('ascii', 'replace')
            return str(what)

        s = ' '.join(map(conv, what))

    log.general.Log(s.replace('\x00', '\\0'), severity)


def LogInfo(*what):
    _Log(log.LGINFO, what)


def LogNotice(*what):
    _Log(log.LGNOTICE, what)


def LogWarn(*what):
    _Log(log.LGWARN, what)


def LogError(*what):
    _Log(log.LGERR, what)


exports = util.AutoExports('log', locals())
예제 #7
0
            return i

    return i + 1


def GetAdjustedClonePrice(solarSystemID, factionID, basePrice):
    level = GetSolarSystemUpgradeLevel(solarSystemID, factionID)
    return basePrice * (1 - 0.1 * level)


def GetAdjustedFeePercentage(solarSystemID, factionID, feePercentage):
    level = GetSolarSystemUpgradeLevel(solarSystemID, factionID)
    return feePercentage * (1 - 0.1 * level)


def GetDonationTax(factionID):
    if boot.role == 'client':
        facwarSvc = sm.GetService('facwar')
        zoneInfo = facwarSvc.GetFacWarZoneInfo(factionID)
        percentControlled = zoneInfo.factionPoints / zoneInfo.maxWarZonePoints
    else:
        facWarZoneMgr = sm.GetService('facWarZoneMgr')
        points, maxPoints = facWarZoneMgr.GetZonePoints(factionID)
        percentControlled = points / maxPoints
    rawTax = 5 * math.pow(percentControlled, 3)
    donationTax = round(1 - 1 / (1 + rawTax), 2)
    return donationTax


exports = util.AutoExports('facwarCommon', locals())
예제 #8
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/eve/client/script/ui/shared/infoPanels/infoPanelConst.py
import util
PANEL_LOCATION_INFO = 1
PANEL_ROUTE = 2
PANEL_MISSIONS = 3
PANEL_INCURSIONS = 4
PANEL_FACTIONAL_WARFARE = 5
PANEL_PLANETARY_INTERACTION = 6
PANELTYPES = (PANEL_LOCATION_INFO,
 PANEL_ROUTE,
 PANEL_MISSIONS,
 PANEL_INCURSIONS,
 PANEL_FACTIONAL_WARFARE,
 PANEL_PLANETARY_INTERACTION)
MODE_NORMAL = 1
MODE_COMPACT = 2
MODE_COLLAPSED = 3
PANELWIDTH = 312
LEFTPAD = 42
exports = util.AutoExports('infoPanel', locals())
예제 #9
0
        log.LogTraceback('Authoring error: No inputs/outputs defined for schematic with id=%s' % schematicID)
    for typeInfo in schematicstypemap:
        data = util.KeyVal(name=cfg.invtypes.Get(typeInfo.typeID).typeName, typeID=typeInfo.typeID, quantity=typeInfo.quantity)
        if typeInfo.isInput:
            inputs.append(data)
        else:
            outputs.append(data)

    return (inputs, outputs)


def GetSchematicDataByGroupID():
    schematics = GetSchematicData()
    ret = {}
    for schematic in schematics:
        groupID = cfg.invtypes.Get(schematic.output.typeID).groupID
        if groupID not in ret:
            ret[groupID] = []
        ret[groupID].append(schematic)

    return ret


def PinHasBeenBuilt(pinID):
    if isinstance(pinID, tuple):
        return False
    return True


exports = util.AutoExports('planetCommon', locals())
예제 #10
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/eve/common/script/entities/proximityOpenTutorialComponent.py
import util

class ProximityOpenTutorialComponent:
    __guid__ = 'tutorial.ProximityOpenTutorialComponent'

    def __init__(self):
        self.tutorialID = None
        self.radius = None


exports = util.AutoExports('tutorial', locals())
예제 #11
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/carbon/client/script/ui/control/browser/browserConst.py
import util
selectedPage = 1
selectedFrame = 2
selectedLink = 4
selectedImage = 8
selectedSelection = 16
selectedEditable = 32
selectedMisspelledWord = 64
flagCanDoNone = 0
flagCanUndo = 1
flagCanRedo = 2
flagCanCut = 4
flagCanCopy = 8
flagCanPaste = 16
flagCanDelete = 32
flagCanSelectAll = 64
commandCut = 0
commandCopy = 1
commandPaste = 2
commandDelete = 3
commandSelectAll = 4
exports = util.AutoExports('browserConst', locals())
예제 #12
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/eve/common/script/util/taleCommon.py
import blue
import util


def CalculateDecayedInfluence(info):
    currentTime = blue.os.GetWallclockTime()
    return CalculateDecayedInfluenceWithTime(info.influence, info.lastUpdated,
                                             currentTime, info.decayRate,
                                             info.graceTime)


def CalculateDecayedInfluenceWithTime(influence, lastUpdated, currentTime,
                                      decayRate, graceTime):
    if decayRate > 0.0 and currentTime - graceTime * const.MIN > lastUpdated:
        timePastGrace = (currentTime - lastUpdated) / const.MIN - graceTime
        hourPast = max(timePastGrace / 60.0, 0.0)
        decay = decayRate * hourPast
        influence = influence - decay
    else:
        influence = influence
    if influence < 0.0001:
        influence = 0.0
    return influence


exports = util.AutoExports('taleCommon', locals())
예제 #13
0
        return util.KeyVal(valueInt=None, valueFloat=value, valueString=None)
    if type(value) is not types.StringType:
        try:
            value = str(value)
        except ValueError as e:
            return util.KeyVal(valueInt=None,
                               valueFloat=None,
                               valueString=None)

    try:
        valueInt = int(value)
    except ValueError as e:
        valueInt = None

    if valueInt is not None:
        valueFloat = None
    else:
        try:
            valueFloat = float(value)
        except ValueError as e:
            valueFloat = None

    if valueInt is not None or valueFloat is not None or value.strip() == '':
        value = None
    return util.KeyVal(valueInt=valueInt,
                       valueFloat=valueFloat,
                       valueString=value)


exports = util.AutoExports('entityCommon', locals())
예제 #14
0
파일: materials.py 프로젝트: R4M80MrX/eve-1
MATERIAL_METALGRATE = 12
MATERIAL_RUBBERMATS = 13
CLIMBABLE_FLAG = 65536 | MATERIAL_CONCRETE
LADDERTOP_FLAG = 131072 | MATERIAL_CONCRETE
DEFAULT_MATERIAL = MATERIAL_CONCRETE
MATERIAL_INDEXES = [
    MATERIAL_CONCRETE, MATERIAL_WOOD, MATERIAL_METAL, MATERIAL_GLASS,
    MATERIAL_CARDBOARD, MATERIAL_GRASS, MATERIAL_GRAVEL, MATERIAL_PLASTIC,
    MATERIAL_CARPET, MATERIAL_STONE, MATERIAL_WATER, MATERIAL_METALGRATE,
    MATERIAL_RUBBERMATS
]
MATERIAL_NAMES = {
    u'Invalid': MATERIAL_INVALID,
    u'Concrete': MATERIAL_CONCRETE,
    u'Wood': MATERIAL_WOOD,
    u'Metal': MATERIAL_METAL,
    u'Glass': MATERIAL_GLASS,
    u'Cardboard': MATERIAL_CARDBOARD,
    u'Grass': MATERIAL_GRASS,
    u'Gravel': MATERIAL_GRAVEL,
    u'Plastic': MATERIAL_PLASTIC,
    u'Carpet': MATERIAL_CARPET,
    u'Stone': MATERIAL_STONE,
    u'Water': MATERIAL_WATER,
    u'MetalGrate': MATERIAL_METALGRATE,
    u'RubberMats': MATERIAL_RUBBERMATS,
    u'Climbable': CLIMBABLE_FLAG,
    u'LadderTop': LADDERTOP_FLAG
}
exports = util.AutoExports('materialTypes', globals())
예제 #15
0
        for i, each in enumerate(self.areas):
            if each.name == name:
                found = True
                break

        if found:
            self.areas[i] = area
        return found

    def GetAreas(self, name):
        areas = []
        for each in self.areas:
            if each.name == name:
                areas.append(each)

        return areas

    def SetDisplay(self, val):
        for each in self.areas:
            each.display = val

        self._display = val

    def GetDisplay(self):
        return self._display

    display = property(GetDisplay, SetDisplay)


exports = util.AutoExports('dungeonEditorToolGeometry', locals())
예제 #16
0
LFX_REAR_UPPER_RIGHT = 67108864
LFX_ALL = 134217727
LFX_ALL_RIGHT = 76695844
LFX_ALL_LEFT = 19173961
LFX_ALL_UPPER = 117670336
LFX_ALL_LOWER = 1838599
LFX_ALL_FRONT = 511
LFX_ALL_REAR = 133955584
LFX_OFF = 0
LFX_BLACK = 0
LFX_RED = 16711680
LFX_GREEN = 65280
LFX_BLUE = 255
LFX_WHITE = 16777215
LFX_YELLOW = 16776960
LFX_ORANGE = 16744448
LFX_PINK = 16744703
LFX_CYAN = 65535
LFX_FULL_BRIGHTNESS = 4278190080L
LFX_HALF_BRIGHTNESS = 2147483648L
LFX_MIN_BRIGHTNESS = 0
LFX_ACTION_MORPH = 1
LFX_ACTION_PULSE = 2
LFX_ACTION_COLOR = 3
LFX_HIGHEST_PRIORITY = 1
LFX_HIGH_PRIORITY = 250
LFX_NORMAL_PRIORITY = 500
LFX_LOW_PRIORITY = 750
LFX_LOWEST_PRIORITY = 1000
exports = util.AutoExports('lightfxConstants', globals())
예제 #17
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/carbon/common/script/util/inspect.py
import types


def IsClassMethod(func):
    if type(func) != types.MethodType:
        return False
    if type(func.im_self) is types.TypeType:
        return True
    return False


def IsStaticMethod(func):
    return type(func) == types.FunctionType


def IsNormalMethod(func):
    if type(func) != types.MethodType:
        return False
    if type(func.im_self) is not types.TypeType:
        return True
    return False


import util
exports = util.AutoExports('util', locals())
예제 #18
0
    diameter = 2 * radius
    hasPole = True
    if latitude - radius < 0.0 or diameter / math.cos(
            latitude - radius - MATH_PI_DIV_2) > MATH_2PI:
        minLatitude, maxLatitude = 0.0, latitude + radius
        minLongitude, maxLongitude = 0.0, MATH_2PI
    elif latitude + radius > math.pi or diameter / math.cos(
            latitude + radius - MATH_PI_DIV_2) > MATH_2PI:
        minLatitude, maxLatitude = latitude - radius, math.pi
        minLongitude, maxLongitude = 0.0, MATH_2PI
    else:
        minLatitude, maxLatitude = latitude - radius, latitude + radius
        minLongitude, maxLongitude = longitude - radius, longitude + radius
        hasPole = False
    latitudeStepSize = (maxLatitude - minLatitude) / (numSamplesPerAxis - 1)
    longitudeStepSize = (maxLongitude - minLongitude) / (numSamplesPerAxis - 1)
    _latitude = 0
    for x in xrange(numSamplesPerAxis):
        _latitude = minLatitude + x * latitudeStepSize
        for y in xrange(numSamplesPerAxis):
            if hasPole:
                _longitude = minLongitude + y * longitudeStepSize
            else:
                tempDiameter = diameter / math.cos(_latitude - MATH_PI_DIV_2)
                tempStepSize = 1.0 / (numSamplesPerAxis - 1) * tempDiameter
                _longitude = longitude - tempDiameter * 0.5 + y * tempStepSize
            yield (_latitude, _longitude)


exports = util.AutoExports('planetUtil', locals())
예제 #19
0
    l = d.get(key, [])
    l.append(item)
    d[key] = l


def GetFromDictList(d, key):
    l = d.get(key, [])
    if type(l) != list:
        return []
    return l


@telemetry.ZONE_FUNCTION
def NastyYamlLoad(yamlStr):
    import paperDoll as PD
    sys.modules[PD.__name__] = PD
    instance = None
    try:
        blue.statistics.EnterZone('yaml.load')
        instance = yaml.load(yamlStr, Loader=yaml.CLoader)
    except Exception:
        log.LogError('PaperDoll: Yaml parsing failed for data', yamlStr)
    finally:
        blue.statistics.LeaveZone()
        del sys.modules[PD.__name__]

    return instance


exports = util.AutoExports('paperDoll', globals())
예제 #20
0
파일: misc.py 프로젝트: R4M80MrX/eve-1
        while True:
            try:
                args, kw = ch.receive()
                blue.pyos.synchro.SleepWallclock(self._delay)
                while ch.balance != 0:
                    args, kw = ch.receive()

                self._fn(*args, **kw)
            except self._StopExc:
                sys.exc_clear()
                return
            except Exception:
                log.LogException()
                sys.exc_clear()


@telemetry.ZONE_FUNCTION
def ReadYamlFile(path):
    telemetry.APPEND_TO_ZONE(path)
    data = None
    rf = blue.ResFile()
    if rf.FileExists(path):
        rf.Open(path)
        yamlStr = rf.read()
        rf.close()
        data = yaml.load(yamlStr, Loader=yaml.CLoader)
    return data


exports = util.AutoExports('util', globals())
예제 #21
0
파일: autoLogin.py 프로젝트: R4M80MrX/eve-1
        else:
            return
        atomicArgs = myArgs.split(DELIMITER)
        if len(atomicArgs) == 2:
            user, password = atomicArgs
            self.LoginUser(user=user, password=password)

    def LoginUser(self, user = '******', password = '******'):
        self.eventHandler.WaitForEula()
        loginForm = uicore.layer.login
        if user:
            loginForm.usernameEditCtrl.SetValue(user)
        if password:
            loginForm.passwordEditCtrl.SetValue(password)

        def amIReadyToRock():
            Sleep(1000)
            return ': OK' in loginForm.serverStatusTextControl.GetText()

        if not amIReadyToRock():
            raise Exception
        loginForm.Connect()
        self.eventHandler.WaitForCharsel()
        charSelForm = uicore.layer.charsel
        Sleep(5000)
        charSelForm.Confirm()


import util
exports = util.AutoExports('autoLogin', locals())
예제 #22
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/carbon/common/script/entities/audioEmitter.py
import util
INITIAL_EVENT_NAME = 'initialEventName'
INITIAL_SOUND_ID = 'initialSoundID'
EMITTER_GROUP_NAME = 'groupName'


class AudioEmitterComponent:
    __guid__ = 'audio.AudioEmitterComponent'

    def __init__(self):
        self.initialEventName = None
        self.initialSoundID = None
        self.groupName = None


exports = util.AutoExports('audio', locals())
예제 #23
0
#Embedded file name: c:/depot/games/branches/release/EVE-TRANQUILITY/eve/client/script/ui/shared/neocom/neocom/neocomCommon.py
import util
import math
import blue
ICONPATH_DEFAULT = 'ui_105_64_45'
ICONPATH_GROUP = 'ui_79_64_10'
ICONPATH_CHAT = 'ui_9_64_2'
ICONPATH_UNDOCK = 'ui_9_64_6'
ICONPATH_BOOKMARKS = 'ui_9_64_4'
BTNTYPE_CMD = 1
BTNTYPE_WINDOW = 2
BTNTYPE_GROUP = 3
BTNTYPE_INVENTORY = 4
BTNTYPE_CHAT = 10
BTNTYPE_BOOKMARKS = 11
BTNTYPE_CHATCHANNEL = 12
BTNTYPE_BOOKMARK = 13
PANEL_SHOWABOVE = 1
PANEL_SHOWONSIDE = 2
FIXED_PARENT_BTNTYPES = [BTNTYPE_CHAT, BTNTYPE_WINDOW, BTNTYPE_INVENTORY]
COLOR_GROUPDEFAULT = (0.5, 1.0, 1.0, 1.0)
BLINK_INTERVAL = 1000
exports = util.AutoExports('neocom', locals())
예제 #24
0
        if bookmark.locationID == session.locationid
    ]
    bookmarksByOwnerByFolder = defaultdict(lambda: defaultdict(set))
    for bookmark in validBookmarks:
        bookmarksByOwnerByFolder[bookmark.ownerID][bookmark.folderID].add(
            bookmark)

    if session.charid in bookmarksByOwnerByFolder:
        ret.extend(
            GetFolderedMenu(
                bookmarksByOwnerByFolder[session.charid],
                folders,
                uiutil.MenuLabel('UI/PeopleAndPlaces/PersonalLocations'),
                isSubMenu=False))
    if session.corpid in bookmarksByOwnerByFolder:
        bookmarksByFolder = bookmarksByOwnerByFolder[session.corpid]
        entryLength = len(bookmarksByFolder)
        if None in bookmarksByFolder:
            entryLength += len(bookmarksByFolder[None]) - 1
        ret.extend(
            GetFolderedMenu(bookmarksByOwnerByFolder[session.corpid],
                            folders,
                            localization.GetByLabel(
                                'UI/PeopleAndPlaces/CorporationLocations'),
                            isSubMenu=entryLength >
                            BOOKMARK_RIGHTCLICK_GROUPING_THRESHOLD))
    return ret


exports = util.AutoExports('bookmarkUtil', globals())
예제 #25
0
                raise RuntimeError(
                    "Problem retrieving the avatar's model object. entityClient.FindEntityByID returned None for entityID",
                    self.charEntID)
        if not camera.mouseLeftButtonDown and not camera.mouseRightButtonDown:
            avatarHasMoved = geo2.Vec3Distance(
                self.model.translation,
                self.lastAvatarPosition) > const.FLOAT_TOLERANCE
            avatarHasRotated = geo2.Vec3Distance(
                geo2.QuaternionRotationGetYawPitchRoll(self.model.rotation),
                self.lastAvatarRotation) > const.FLOAT_TOLERANCE
            movementDetected = avatarHasMoved or avatarHasRotated
            self.lastAvatarPosition = self.model.translation
            self.lastAvatarRotation = geo2.QuaternionRotationGetYawPitchRoll(
                self.model.rotation)
            if movementDetected:
                self.rotationSpeed = cameras.SMOOTH_BEHIND_ANIMATION_SPEED_REALLY_FAST
            else:
                self.rotationSpeed = cameras.SMOOTH_BEHIND_ANIMATION_SPEED
            if self.enableTriggerableSmoothBehind:
                if movementDetected:
                    self.smoothBehind = True
            else:
                self.smoothBehind = True
        else:
            self.smoothBehind = False
        if self.smoothBehind:
            self.SmoothBehind()


exports = util.AutoExports('cameras', locals())
예제 #26
0
REGION_JUMP = 0
CONSTELLATION_JUMP = 1
SOLARSYSTEM_JUMP = 2
JUMP_TYPES = (REGION_JUMP, CONSTELLATION_JUMP, SOLARSYSTEM_JUMP)
COLOR_REGION = (0.5, 0.0, 0.5, 1.0)
COLOR_CONSTELLATION = (0.5, 0.0, 0.0, 1.0)
COLOR_SOLARSYSTEM = (0.0, 0.0, 1.0, 1.0)
JUMP_COLORS = (COLOR_REGION, COLOR_CONSTELLATION, COLOR_SOLARSYSTEM)
JUMPBRIDGE_CURVE_SCALE = 0.75
JUMPBRIDGE_COLOR = (0.0, 1.0, 0.0, 1.0)
JUMPBRIDGE_COLOR_SCALE = 0.25
JUMPBRIDGE_ANIMATION_SPEED = 1.0


class LegendItem(object):
    def __init__(self, order, caption, color, data=None, highlight=True):
        self.order = order
        self.caption = caption
        self.color = color
        self.data = data
        self.highlight = highlight

    def __cmp__(self, other):
        return cmp((self.order, self.caption), (other.order, self.caption))

    def __hash__(self):
        return hash(self.caption)


exports = util.AutoExports('mapcommon', locals())
예제 #27
0
VXCMEDIAEVENTREASON_TIMEOUT = 2
VXCMEDIAEVENTREASON_BAD_DEVICE = 3
VXCMEDIAEVENTREASON_NO_PORT = 4
VXCMEDIAEVENTREASON_PORT_MAPPING_FAILED = 5
VXCMEDIAEVENTREASON_REMOTE_REQUEST = 6
VXCMESSAGINGEVENTTYPE_MESSAGE = 0
VXCMESSAGINGEVENTTYPE_STATUS = 1
VXCMESSAGINGUSERSTATUS_IDLE = 0
VXCMESSAGINGUSERSTATUS_TYPING = 1
VXCQUERYRESULTTYPE_CHANNELS = 0
VXCQUERYRESULTTYPE_CHANNEL_USERS = 1
JOINED = 0
TALKING = 1
MUTED = 2
NOTJOINED = 3
VXACCOUNT_MAXCREATIONATTEMPTS = 5
VXVOLUME_MIN = 40
VXVOLUME_MAX = 75
VXVOLUME_DEFAULT = 50
VXVOLUME_OFF = 0
VXVOLUME_LOW = 25
VX_NOTONACL = 20212
VX_ACCESSDENIED = 403
VX_NOTFOUND = 404
VXLOGLEVEL_NONE = 0
VXLOGLEVEL_ERRORS = 1
VXLOGLEVEL_WARNINGS = 2
VXLOGLEVEL_INFO = 3
VXLOGLEVEL_DEBUG = 4
exports = util.AutoExports('vivoxConstants', globals())
예제 #28
0
        timeVal = self.Seconds() * SEC
        showTo = 'minute'
        if _displaySeconds:
            showTo = 'second'
        return localizationUtil.FormatTimeIntervalWritten(timeVal,
                                                          showFrom='year',
                                                          showTo=showTo)

    def __repr__(self):
        label = localization.GetByLabel(
            '/Carbon/UI/Common/DateTimeQuantity/DateTimeShort3Elements',
            value1=int(self.Hours()),
            value2=int(self.Minutes() % 60),
            value3=int(self.Seconds() % 60))
        return '<Time: %s>' % label


_liveWatchSpan = Hours(24)
_testWatchSpan = Minutes(24)
_liveAllowedTime = Hours(3)
_testAllowedTime = Minutes(3)
_liveSchedule = [(NoTime(), lambda blah: KickPlayer()),
                 (Minutes(5), TimeWarning), (Minutes(15), TimeWarning),
                 (Hours(1), TimeWarning), (Hours(2), TimeWarning)]
_testSchedule = [(NoTime(), lambda blah: KickPlayer()),
                 (Seconds(5), TimeWarning), (Seconds(15), TimeWarning),
                 (Minutes(1), TimeWarning), (Minutes(2), TimeWarning)]
_liveSavePeriod = Minutes(1)
_testSavePeriod = Seconds(1)
exports = util.AutoExports('antiaddiction', locals())
예제 #29
0
    def deco(*args, **kw):
        old = sys.stdout
        sys.stdout = WithLogStdout.logStream
        try:
            return f(*args, **kw)
        finally:
            sys.stdout = old

    return deco


@WithLogStdout
def Profile(fn, *args, **kw):
    print 'Profile BEGIN -----------------------------------'
    p = cProfile.Profile()
    ret = p.runcall(fn, *args, **kw)
    pstats.Stats(p).sort_stats('time', 'cumulative').print_stats()
    print 'Profile END -------------------------------------'
    return ret


def Profiled(fn):
    @wraps(fn)
    def deco(*args, **kw):
        return Profile(fn, *args, **kw)

    return deco


exports = util.AutoExports('dbg', locals())
예제 #30
0
    def GetYPR(self):
        return (self.yaw, self.pitch, self.roll, self.mode)

    @staticmethod
    def Load(source):
        inst = source
        if isinstance(source, basestring):
            inst = PD.LoadYamlFileNicely(source)
        projectedDecal = PD.ProjectedDecal()
        for key, val in inst.__dict__.iteritems():
            if key in projectedDecal.__dict__:
                projectedDecal.__dict__[key] = val

        if inst.texturePath:
            projectedDecal.SetTexturePath(inst.texturePath)
        if inst.maskPath:
            projectedDecal.SetMaskPath(inst.maskPath)
        return projectedDecal

    @staticmethod
    def Save(source, resPath):
        f = file(resPath, 'w')
        yaml.dump(source, f, default_flow_style=False, Dumper=yaml.CDumper)
        f.flush()
        f.close()


import util
exports = util.AutoExports('paperDoll', locals())