diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-18 06:16:08 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-18 06:16:08 (GMT) |
commit | 182b5aca27d376b08a2904bed42b751496f932f3 (patch) | |
tree | df13115820dbc879c0fe2eae488c9f8c0215a7da /Lib/plat-mac | |
parent | e6ddc8b20b493fef2e7cffb2e1351fe1d238857e (diff) | |
download | cpython-182b5aca27d376b08a2904bed42b751496f932f3.zip cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.gz cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.bz2 |
Whitespace normalization, via reindent.py.
Diffstat (limited to 'Lib/plat-mac')
79 files changed, 1610 insertions, 1626 deletions
diff --git a/Lib/plat-mac/Audio_mac.py b/Lib/plat-mac/Audio_mac.py index 5350e55..fd96095 100644 --- a/Lib/plat-mac/Audio_mac.py +++ b/Lib/plat-mac/Audio_mac.py @@ -81,7 +81,7 @@ class Play_Audio_mac: del self._gc[0] if self._usercallback: self._usercallback() - + def setcallback(self, callback): self._usercallback = callback diff --git a/Lib/plat-mac/Carbon/Aliases.py b/Lib/plat-mac/Carbon/Aliases.py index 1211e3d..55e1a1f 100644 --- a/Lib/plat-mac/Carbon/Aliases.py +++ b/Lib/plat-mac/Carbon/Aliases.py @@ -3,16 +3,16 @@ def FOUR_CHAR_CODE(x): return x true = True false = False -rAliasType = FOUR_CHAR_CODE('alis') +rAliasType = FOUR_CHAR_CODE('alis') kARMMountVol = 0x00000001 kARMNoUI = 0x00000002 kARMMultVols = 0x00000008 kARMSearch = 0x00000100 kARMSearchMore = 0x00000200 -kARMSearchRelFirst = 0x00000400 +kARMSearchRelFirst = 0x00000400 asiZoneName = -3 asiServerName = -2 asiVolumeName = -1 asiAliasName = 0 -asiParentName = 1 -kResolveAliasFileNoUI = 0x00000001 +asiParentName = 1 +kResolveAliasFileNoUI = 0x00000001 diff --git a/Lib/plat-mac/Carbon/Appearance.py b/Lib/plat-mac/Carbon/Appearance.py index e42e531..d99c6dc 100644 --- a/Lib/plat-mac/Carbon/Appearance.py +++ b/Lib/plat-mac/Carbon/Appearance.py @@ -5,7 +5,7 @@ kAppearanceEventClass = FOUR_CHAR_CODE('appr') kAEAppearanceChanged = FOUR_CHAR_CODE('thme') kAESystemFontChanged = FOUR_CHAR_CODE('sysf') kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') -kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') +kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') kThemeDataFileType = FOUR_CHAR_CODE('thme') kThemePlatinumFileType = FOUR_CHAR_CODE('pltn') kThemeCustomThemesFileType = FOUR_CHAR_CODE('scen') @@ -64,12 +64,12 @@ kThemeBrushDrawerBackground = 51 kThemeBrushToolbarBackground = 52 kThemeBrushSheetBackgroundTransparent = 53 kThemeBrushMenuBackground = 54 -kThemeBrushMenuBackgroundSelected = 55 +kThemeBrushMenuBackgroundSelected = 55 kThemeBrushSheetBackground = kThemeBrushSheetBackgroundOpaque kThemeBrushBlack = -1 kThemeBrushWhite = -2 kThemeBrushPrimaryHighlightColor = -3 -kThemeBrushSecondaryHighlightColor = -4 +kThemeBrushSecondaryHighlightColor = -4 kThemeTextColorDialogActive = 1 kThemeTextColorDialogInactive = 2 kThemeTextColorAlertActive = 3 @@ -127,7 +127,7 @@ kThemeStateUnavailable = 7 kThemeStateUnavailableInactive = 8 kThemeStateDisabled = 0 kThemeStatePressedUp = 2 -kThemeStatePressedDown = 3 +kThemeStatePressedDown = 3 kThemeArrowCursor = 0 kThemeCopyArrowCursor = 1 kThemeAliasArrowCursor = 2 @@ -165,7 +165,7 @@ kThemeMenuItemAtBottom = 0x0200 kThemeMenuItemHierBackground = 0x0400 kThemeMenuItemPopUpBackground = 0x0800 kThemeMenuItemHasIcon = 0x8000 -kThemeMenuItemNoBackground = 0x4000 +kThemeMenuItemNoBackground = 0x4000 kThemeBackgroundTabPane = 1 kThemeBackgroundPlacard = 2 kThemeBackgroundWindowHeader = 3 @@ -178,7 +178,7 @@ kThemeHighlightColorTag = FOUR_CHAR_CODE('hcol') kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar') kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth') kThemeSoundsEnabledTag = FOUR_CHAR_CODE('snds') -kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll') +kThemeDblClickCollapseTag = FOUR_CHAR_CODE('coll') kThemeAppearanceFileNameTag = FOUR_CHAR_CODE('thme') kThemeSystemFontTag = FOUR_CHAR_CODE('lgsf') kThemeSmallSystemFontTag = FOUR_CHAR_CODE('smsf') @@ -195,18 +195,18 @@ kThemeSoundTrackNameTag = FOUR_CHAR_CODE('sndt') kThemeSoundMaskTag = FOUR_CHAR_CODE('smsk') kThemeUserDefinedTag = FOUR_CHAR_CODE('user') kThemeSmoothFontEnabledTag = FOUR_CHAR_CODE('smoo') -kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos') +kThemeSmoothFontMinSizeTag = FOUR_CHAR_CODE('smos') kTiledOnScreen = 1 kCenterOnScreen = 2 kFitToScreen = 3 kFillScreen = 4 -kUseBestGuess = 5 +kUseBestGuess = 5 kThemeCheckBoxClassicX = 0 -kThemeCheckBoxCheckMark = 1 +kThemeCheckBoxCheckMark = 1 kThemeScrollBarArrowsSingle = 0 -kThemeScrollBarArrowsLowerRight = 1 +kThemeScrollBarArrowsLowerRight = 1 kThemeScrollBarThumbNormal = 0 -kThemeScrollBarThumbProportional = 1 +kThemeScrollBarThumbProportional = 1 kThemeSystemFont = 0 kThemeSmallSystemFont = 1 kThemeSmallEmphasizedSystemFont = 2 @@ -238,7 +238,7 @@ kThemeSmallTabHeight = 16 kThemeLargeTabHeight = 21 kThemeTabPaneOverlap = 3 kThemeSmallTabHeightMax = 19 -kThemeLargeTabHeightMax = 24 +kThemeLargeTabHeightMax = 24 kThemeMediumScrollBar = 0 kThemeSmallScrollBar = 1 kThemeMediumSlider = 2 @@ -309,7 +309,7 @@ kThemeArrow9pt = 3 kThemeGrowLeft = (1 << 0) kThemeGrowRight = (1 << 1) kThemeGrowUp = (1 << 2) -kThemeGrowDown = (1 << 3) +kThemeGrowDown = (1 << 3) kThemePushButton = 0 kThemeCheckBox = 1 kThemeRadioButton = 2 @@ -351,7 +351,7 @@ kThemeAdornmentShadowOnly = kThemeAdornmentHeaderButtonShadowOnly kThemeAdornmentArrowLeftArrow = (1 << 6) kThemeAdornmentArrowDownArrow = (1 << 7) kThemeAdornmentArrowDoubleArrow = (1 << 8) -kThemeAdornmentArrowUpArrow = (1 << 9) +kThemeAdornmentArrowUpArrow = (1 << 9) kThemeNoSounds = 0 kThemeWindowSoundsMask = (1 << 0) kThemeMenuSoundsMask = (1 << 1) @@ -629,7 +629,7 @@ kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive -kAEThemeSwitch = kAEAppearanceChanged +kAEThemeSwitch = kAEAppearanceChanged kThemeNoAdornment = kThemeAdornmentNone kThemeDefaultAdornment = kThemeAdornmentDefault kThemeFocusAdornment = kThemeAdornmentFocus @@ -641,7 +641,7 @@ kThemeMetricRadioButtonGlyphHeight = kThemeMetricRadioButtonHeight kThemeMetricDisclosureButtonSize = kThemeMetricDisclosureButtonHeight kThemeMetricBestListHeaderHeight = kThemeMetricListHeaderHeight kThemeMetricSmallProgressBarThickness = kThemeMetricNormalProgressBarThickness -kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness +kThemeMetricProgressBarThickness = kThemeMetricLargeProgressBarThickness kThemeScrollBar = kThemeMediumScrollBar kThemeSlider = kThemeMediumSlider kThemeProgressBar = kThemeMediumProgressBar diff --git a/Lib/plat-mac/Carbon/AppleEvents.py b/Lib/plat-mac/Carbon/AppleEvents.py index 7253a3e..e23c079 100644 --- a/Lib/plat-mac/Carbon/AppleEvents.py +++ b/Lib/plat-mac/Carbon/AppleEvents.py @@ -44,7 +44,7 @@ typeQDRectangle = FOUR_CHAR_CODE('qdrt') typeFixed = FOUR_CHAR_CODE('fixd') typeProcessSerialNumber = FOUR_CHAR_CODE('psn ') typeApplicationURL = FOUR_CHAR_CODE('aprl') -typeNull = FOUR_CHAR_CODE('null') +typeNull = FOUR_CHAR_CODE('null') typeSessionID = FOUR_CHAR_CODE('ssid') typeTargetID = FOUR_CHAR_CODE('targ') typeDispatcherID = FOUR_CHAR_CODE('dspt') @@ -59,19 +59,19 @@ keyInteractLevelAttr = FOUR_CHAR_CODE('inte') keyEventSourceAttr = FOUR_CHAR_CODE('esrc') keyMissedKeywordAttr = FOUR_CHAR_CODE('miss') keyOriginalAddressAttr = FOUR_CHAR_CODE('from') -keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm') +keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm') kAEDescListFactorNone = 0 kAEDescListFactorType = 4 kAEDescListFactorTypeAndSize = 8 kAutoGenerateReturnID = -1 -kAnyTransactionID = 0 +kAnyTransactionID = 0 kAEDataArray = 0 kAEPackedArray = 1 kAEDescArray = 3 kAEKeyDescArray = 4 kAEHandleArray = 2 kAENormalPriority = 0x00000000 -kAEHighPriority = 0x00000001 +kAEHighPriority = 0x00000001 kAENoReply = 0x00000001 kAEQueueReply = 0x00000002 kAEWaitReply = 0x00000003 @@ -83,9 +83,9 @@ kAEAlwaysInteract = 0x00000030 kAECanSwitchLayer = 0x00000040 kAEDontRecord = 0x00001000 kAEDontExecute = 0x00002000 -kAEProcessNonReplyEvents = 0x00008000 +kAEProcessNonReplyEvents = 0x00008000 kAEDefaultTimeout = -1 -kNoTimeOut = -2 +kNoTimeOut = -2 kAEInteractWithSelf = 0 kAEInteractWithLocal = 1 kAEInteractWithAll = 2 @@ -95,9 +95,9 @@ kAEIgnoreAppEventHandler = 0x00000002 kAEIgnoreSysPhacHandler = 0x00000004 kAEIgnoreSysEventHandler = 0x00000008 kAEIngoreBuiltInEventHandler = 0x00000010 -# kAEDontDisposeOnResume = (long)0x80000000 +# kAEDontDisposeOnResume = (long)0x80000000 kAENoDispatch = 0 -# kAEUseStandardDispatch = (long)0xFFFFFFFF +# kAEUseStandardDispatch = (long)0xFFFFFFFF keyDirectObject = FOUR_CHAR_CODE('----') keyErrorNumber = FOUR_CHAR_CODE('errn') keyErrorString = FOUR_CHAR_CODE('errs') @@ -105,7 +105,7 @@ keyProcessSerialNumber = FOUR_CHAR_CODE('psn ') keyPreDispatch = FOUR_CHAR_CODE('phac') keySelectProc = FOUR_CHAR_CODE('selh') keyAERecorderCount = FOUR_CHAR_CODE('recr') -keyAEVersion = FOUR_CHAR_CODE('vers') +keyAEVersion = FOUR_CHAR_CODE('vers') kCoreEventClass = FOUR_CHAR_CODE('aevt') kAEOpenApplication = FOUR_CHAR_CODE('oapp') kAEOpenDocuments = FOUR_CHAR_CODE('odoc') @@ -113,12 +113,12 @@ kAEPrintDocuments = FOUR_CHAR_CODE('pdoc') kAEQuitApplication = FOUR_CHAR_CODE('quit') kAEAnswer = FOUR_CHAR_CODE('ansr') kAEApplicationDied = FOUR_CHAR_CODE('obit') -kAEShowPreferences = FOUR_CHAR_CODE('pref') +kAEShowPreferences = FOUR_CHAR_CODE('pref') kAEStartRecording = FOUR_CHAR_CODE('reca') kAEStopRecording = FOUR_CHAR_CODE('recc') kAENotifyStartRecording = FOUR_CHAR_CODE('rec1') kAENotifyStopRecording = FOUR_CHAR_CODE('rec0') -kAENotifyRecording = FOUR_CHAR_CODE('recr') +kAENotifyRecording = FOUR_CHAR_CODE('recr') kAEUnknownSource = 0 kAEDirectCall = 1 kAESameProcess = 2 @@ -143,7 +143,7 @@ cGraphicLine = FOUR_CHAR_CODE('glin') cGraphicObject = FOUR_CHAR_CODE('cgob') cGraphicShape = FOUR_CHAR_CODE('cgsh') cGraphicText = FOUR_CHAR_CODE('cgtx') -cGroupedGraphic = FOUR_CHAR_CODE('cpic') +cGroupedGraphic = FOUR_CHAR_CODE('cpic') cInsertionLoc = FOUR_CHAR_CODE('insl') cInsertionPoint = FOUR_CHAR_CODE('cins') cIntlText = FOUR_CHAR_CODE('itxt') @@ -163,7 +163,7 @@ cMenuItem = FOUR_CHAR_CODE('cmen') cObject = FOUR_CHAR_CODE('cobj') cObjectSpecifier = FOUR_CHAR_CODE('obj ') cOpenableObject = FOUR_CHAR_CODE('coob') -cOval = FOUR_CHAR_CODE('covl') +cOval = FOUR_CHAR_CODE('covl') cParagraph = FOUR_CHAR_CODE('cpar') cPICT = FOUR_CHAR_CODE('PICT') cPixel = FOUR_CHAR_CODE('cpxl') @@ -183,7 +183,7 @@ cTable = FOUR_CHAR_CODE('ctbl') cText = FOUR_CHAR_CODE('ctxt') cTextFlow = FOUR_CHAR_CODE('cflo') cTextStyles = FOUR_CHAR_CODE('tsty') -cType = FOUR_CHAR_CODE('type') +cType = FOUR_CHAR_CODE('type') cVersion = FOUR_CHAR_CODE('vers') cWindow = FOUR_CHAR_CODE('cwin') cWord = FOUR_CHAR_CODE('cwor') @@ -203,7 +203,7 @@ kAEAliasSelection = FOUR_CHAR_CODE('sali') kAEAllCaps = FOUR_CHAR_CODE('alcp') kAEArrowAtEnd = FOUR_CHAR_CODE('aren') kAEArrowAtStart = FOUR_CHAR_CODE('arst') -kAEArrowBothEnds = FOUR_CHAR_CODE('arbo') +kAEArrowBothEnds = FOUR_CHAR_CODE('arbo') kAEAsk = FOUR_CHAR_CODE('ask ') kAEBefore = FOUR_CHAR_CODE('befo') kAEBeginning = FOUR_CHAR_CODE('bgng') @@ -223,7 +223,7 @@ kAECountElements = FOUR_CHAR_CODE('cnte') kAECreateElement = FOUR_CHAR_CODE('crel') kAECreatePublisher = FOUR_CHAR_CODE('cpub') kAECut = FOUR_CHAR_CODE('cut ') -kAEDelete = FOUR_CHAR_CODE('delo') +kAEDelete = FOUR_CHAR_CODE('delo') kAEDoObjectsExist = FOUR_CHAR_CODE('doex') kAEDoScript = FOUR_CHAR_CODE('dosc') kAEDrag = FOUR_CHAR_CODE('drag') @@ -243,7 +243,7 @@ kAEGetClassInfo = FOUR_CHAR_CODE('qobj') kAEGetData = FOUR_CHAR_CODE('getd') kAEGetDataSize = FOUR_CHAR_CODE('dsiz') kAEGetEventInfo = FOUR_CHAR_CODE('gtei') -kAEGetInfoSelection = FOUR_CHAR_CODE('sinf') +kAEGetInfoSelection = FOUR_CHAR_CODE('sinf') kAEGetPrivilegeSelection = FOUR_CHAR_CODE('sprv') kAEGetSuiteInfo = FOUR_CHAR_CODE('gtsi') kAEGreaterThan = FOUR_CHAR_CODE('> ') @@ -263,7 +263,7 @@ kAEMiscStandards = FOUR_CHAR_CODE('misc') kAEModifiable = FOUR_CHAR_CODE('modf') kAEMove = FOUR_CHAR_CODE('move') kAENo = FOUR_CHAR_CODE('no ') -kAENoArrow = FOUR_CHAR_CODE('arno') +kAENoArrow = FOUR_CHAR_CODE('arno') kAENonmodifiable = FOUR_CHAR_CODE('nmod') kAEOpen = FOUR_CHAR_CODE('odoc') kAEOpenSelection = FOUR_CHAR_CODE('sope') @@ -283,7 +283,7 @@ kAEQDBic = FOUR_CHAR_CODE('bic ') kAEQDBlend = FOUR_CHAR_CODE('blnd') kAEQDCopy = FOUR_CHAR_CODE('cpy ') kAEQDNotBic = FOUR_CHAR_CODE('nbic') -kAEQDNotCopy = FOUR_CHAR_CODE('ncpy') +kAEQDNotCopy = FOUR_CHAR_CODE('ncpy') kAEQDNotOr = FOUR_CHAR_CODE('ntor') kAEQDNotXor = FOUR_CHAR_CODE('nxor') kAEQDOr = FOUR_CHAR_CODE('or ') @@ -304,7 +304,7 @@ kAERevert = FOUR_CHAR_CODE('rvrt') kAERightJustified = FOUR_CHAR_CODE('rght') kAESave = FOUR_CHAR_CODE('save') kAESelect = FOUR_CHAR_CODE('slct') -kAESetData = FOUR_CHAR_CODE('setd') +kAESetData = FOUR_CHAR_CODE('setd') kAESetPosition = FOUR_CHAR_CODE('posn') kAEShadow = FOUR_CHAR_CODE('shad') kAEShowClipboard = FOUR_CHAR_CODE('shcl') @@ -322,7 +322,7 @@ kAEUnderline = FOUR_CHAR_CODE('undl') kAEUndo = FOUR_CHAR_CODE('undo') kAEWholeWordEquals = FOUR_CHAR_CODE('wweq') kAEYes = FOUR_CHAR_CODE('yes ') -kAEZoom = FOUR_CHAR_CODE('zoom') +kAEZoom = FOUR_CHAR_CODE('zoom') kAEMouseClass = FOUR_CHAR_CODE('mous') kAEDown = FOUR_CHAR_CODE('down') kAEUp = FOUR_CHAR_CODE('up ') @@ -347,7 +347,7 @@ kAEWakeUpEvent = FOUR_CHAR_CODE('wake') kAEScrapEvent = FOUR_CHAR_CODE('scrp') kAEHighLevel = FOUR_CHAR_CODE('high') keyAEAngle = FOUR_CHAR_CODE('kang') -keyAEArcAngle = FOUR_CHAR_CODE('parc') +keyAEArcAngle = FOUR_CHAR_CODE('parc') keyAEBaseAddr = FOUR_CHAR_CODE('badd') keyAEBestType = FOUR_CHAR_CODE('pbst') keyAEBgndColor = FOUR_CHAR_CODE('kbcl') @@ -367,7 +367,7 @@ keyAEDescType = FOUR_CHAR_CODE('dstp') keyAEDestination = FOUR_CHAR_CODE('dest') keyAEDoAntiAlias = FOUR_CHAR_CODE('anta') keyAEDoDithered = FOUR_CHAR_CODE('gdit') -keyAEDoRotate = FOUR_CHAR_CODE('kdrt') +keyAEDoRotate = FOUR_CHAR_CODE('kdrt') keyAEDoScale = FOUR_CHAR_CODE('ksca') keyAEDoTranslate = FOUR_CHAR_CODE('ktra') keyAEEditionFileLoc = FOUR_CHAR_CODE('eloc') @@ -387,7 +387,7 @@ keyAEGraphicObjects = FOUR_CHAR_CODE('gobs') keyAEID = FOUR_CHAR_CODE('ID ') keyAEImageQuality = FOUR_CHAR_CODE('gqua') keyAEInsertHere = FOUR_CHAR_CODE('insh') -keyAEKeyForms = FOUR_CHAR_CODE('keyf') +keyAEKeyForms = FOUR_CHAR_CODE('keyf') keyAEKeyword = FOUR_CHAR_CODE('kywd') keyAELevel = FOUR_CHAR_CODE('levl') keyAELineArrow = FOUR_CHAR_CODE('arro') @@ -407,7 +407,7 @@ keyAEPixMapMinus = FOUR_CHAR_CODE('kpmm') keyAEPMTable = FOUR_CHAR_CODE('kpmt') keyAEPointList = FOUR_CHAR_CODE('ptlt') keyAEPointSize = FOUR_CHAR_CODE('ptsz') -keyAEPosition = FOUR_CHAR_CODE('kpos') +keyAEPosition = FOUR_CHAR_CODE('kpos') keyAEPropData = FOUR_CHAR_CODE('prdt') keyAEProperties = FOUR_CHAR_CODE('qpro') keyAEProperty = FOUR_CHAR_CODE('kprp') @@ -427,7 +427,7 @@ keyAEScriptTag = FOUR_CHAR_CODE('psct') keyAEShowWhere = FOUR_CHAR_CODE('show') keyAEStartAngle = FOUR_CHAR_CODE('pang') keyAEStartPoint = FOUR_CHAR_CODE('pstp') -keyAEStyles = FOUR_CHAR_CODE('ksty') +keyAEStyles = FOUR_CHAR_CODE('ksty') keyAESuiteID = FOUR_CHAR_CODE('suit') keyAEText = FOUR_CHAR_CODE('ktxt') keyAETextColor = FOUR_CHAR_CODE('ptxc') @@ -444,7 +444,7 @@ keyAEUniformStyles = FOUR_CHAR_CODE('ustl') keyAEUpdateOn = FOUR_CHAR_CODE('pupd') keyAEUserTerm = FOUR_CHAR_CODE('utrm') keyAEWindow = FOUR_CHAR_CODE('wndw') -keyAEWritingCode = FOUR_CHAR_CODE('wrcd') +keyAEWritingCode = FOUR_CHAR_CODE('wrcd') keyMiscellaneous = FOUR_CHAR_CODE('fmsc') keySelection = FOUR_CHAR_CODE('fsel') keyWindow = FOUR_CHAR_CODE('kwnd') @@ -477,7 +477,7 @@ pEnabled = FOUR_CHAR_CODE('enbl') pEndPoint = FOUR_CHAR_CODE('pend') pFillColor = FOUR_CHAR_CODE('flcl') pFillPattern = FOUR_CHAR_CODE('flpt') -pFont = FOUR_CHAR_CODE('font') +pFont = FOUR_CHAR_CODE('font') pFormula = FOUR_CHAR_CODE('pfor') pGraphicObjects = FOUR_CHAR_CODE('gobs') pHasCloseBox = FOUR_CHAR_CODE('hclb') @@ -497,7 +497,7 @@ pItemNumber = FOUR_CHAR_CODE('itmn') pJustification = FOUR_CHAR_CODE('pjst') pLineArrow = FOUR_CHAR_CODE('arro') pMenuID = FOUR_CHAR_CODE('mnid') -pName = FOUR_CHAR_CODE('pnam') +pName = FOUR_CHAR_CODE('pnam') pNewElementLoc = FOUR_CHAR_CODE('pnel') pPenColor = FOUR_CHAR_CODE('ppcl') pPenPattern = FOUR_CHAR_CODE('pppa') @@ -517,7 +517,7 @@ pStartPoint = FOUR_CHAR_CODE('pstp') pTextColor = FOUR_CHAR_CODE('ptxc') pTextFont = FOUR_CHAR_CODE('ptxf') pTextItemDelimiters = FOUR_CHAR_CODE('txdl') -pTextPointSize = FOUR_CHAR_CODE('ptps') +pTextPointSize = FOUR_CHAR_CODE('ptps') pTextStyles = FOUR_CHAR_CODE('txst') pTransferMode = FOUR_CHAR_CODE('pptm') pTranslation = FOUR_CHAR_CODE('ptrs') @@ -525,7 +525,7 @@ pUniformStyles = FOUR_CHAR_CODE('ustl') pUpdateOn = FOUR_CHAR_CODE('pupd') pUserSelection = FOUR_CHAR_CODE('pusl') pVersion = FOUR_CHAR_CODE('vers') -pVisible = FOUR_CHAR_CODE('pvis') +pVisible = FOUR_CHAR_CODE('pvis') typeAEText = FOUR_CHAR_CODE('tTXT') typeArc = FOUR_CHAR_CODE('carc') typeBest = FOUR_CHAR_CODE('best') @@ -539,7 +539,7 @@ typeDrawingArea = FOUR_CHAR_CODE('cdrw') typeElemInfo = FOUR_CHAR_CODE('elin') typeEnumeration = FOUR_CHAR_CODE('enum') typeEPS = FOUR_CHAR_CODE('EPS ') -typeEventInfo = FOUR_CHAR_CODE('evin') +typeEventInfo = FOUR_CHAR_CODE('evin') typeFinderWindow = FOUR_CHAR_CODE('fwin') typeFixedPoint = FOUR_CHAR_CODE('fpnt') typeFixedRectangle = FOUR_CHAR_CODE('frct') @@ -558,7 +558,7 @@ typeLongRectangle = FOUR_CHAR_CODE('lrct') typeMachineLoc = FOUR_CHAR_CODE('mLoc') typeOval = FOUR_CHAR_CODE('covl') typeParamInfo = FOUR_CHAR_CODE('pmin') -typePict = FOUR_CHAR_CODE('PICT') +typePict = FOUR_CHAR_CODE('PICT') typePixelMap = FOUR_CHAR_CODE('cpix') typePixMapMinus = FOUR_CHAR_CODE('tpmm') typePolygon = FOUR_CHAR_CODE('cpgn') @@ -578,9 +578,9 @@ typeScript = FOUR_CHAR_CODE('scpt') typeStyledText = FOUR_CHAR_CODE('STXT') typeSuiteInfo = FOUR_CHAR_CODE('suin') typeTable = FOUR_CHAR_CODE('ctbl') -typeTextStyles = FOUR_CHAR_CODE('tsty') +typeTextStyles = FOUR_CHAR_CODE('tsty') typeTIFF = FOUR_CHAR_CODE('TIFF') -typeVersion = FOUR_CHAR_CODE('vers') +typeVersion = FOUR_CHAR_CODE('vers') kAEMenuClass = FOUR_CHAR_CODE('menu') kAEMenuSelect = FOUR_CHAR_CODE('mhit') kAEMouseDown = FOUR_CHAR_CODE('mdwn') @@ -640,7 +640,7 @@ typeOffsetArray = FOUR_CHAR_CODE('ofay') typeTextRangeArray = FOUR_CHAR_CODE('tray') typeLowLevelEventRecord = FOUR_CHAR_CODE('evtr') typeEventRef = FOUR_CHAR_CODE('evrf') -typeText = typeChar +typeText = typeChar kTSMOutsideOfBody = 1 kTSMInsideOfBody = 2 kTSMInsideOfActiveInputArea = 3 @@ -653,7 +653,7 @@ kConvertedText = 4 kSelectedConvertedText = 5 kBlockFillText = 6 kOutlineText = 7 -kSelectedText = 8 +kSelectedText = 8 keyAEHiliteRange = FOUR_CHAR_CODE('hrng') keyAEPinRange = FOUR_CHAR_CODE('pnrg') keyAEClauseOffsets = FOUR_CHAR_CODE('clau') @@ -661,7 +661,7 @@ keyAEOffset = FOUR_CHAR_CODE('ofst') keyAEPoint = FOUR_CHAR_CODE('gpos') keyAELeftSide = FOUR_CHAR_CODE('klef') keyAERegionClass = FOUR_CHAR_CODE('rgnc') -keyAEDragging = FOUR_CHAR_CODE('bool') +keyAEDragging = FOUR_CHAR_CODE('bool') keyAELeadingEdge = keyAELeftSide typeUnicodeText = FOUR_CHAR_CODE('utxt') typeStyledUnicodeText = FOUR_CHAR_CODE('sutx') @@ -710,7 +710,7 @@ kFAAttachCommand = FOUR_CHAR_CODE('atfa') kFARemoveCommand = FOUR_CHAR_CODE('rmfa') kFAEditCommand = FOUR_CHAR_CODE('edfa') kFAFileParam = FOUR_CHAR_CODE('faal') -kFAIndexParam = FOUR_CHAR_CODE('indx') +kFAIndexParam = FOUR_CHAR_CODE('indx') kAEInternetSuite = FOUR_CHAR_CODE('gurl') kAEISWebStarSuite = FOUR_CHAR_CODE('WWW\xbd') kAEISGetURL = FOUR_CHAR_CODE('gurl') @@ -917,7 +917,7 @@ keyAEObject2 = FOUR_CHAR_CODE('obj2') keyAEDesiredClass = FOUR_CHAR_CODE('want') keyAEContainer = FOUR_CHAR_CODE('from') keyAEKeyForm = FOUR_CHAR_CODE('form') -keyAEKeyData = FOUR_CHAR_CODE('seld') +keyAEKeyData = FOUR_CHAR_CODE('seld') keyAERangeStart = FOUR_CHAR_CODE('star') keyAERangeStop = FOUR_CHAR_CODE('stop') keyDisposeTokenProc = FOUR_CHAR_CODE('xtok') @@ -926,7 +926,7 @@ keyAECountProc = FOUR_CHAR_CODE('cont') keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid') keyAEMarkProc = FOUR_CHAR_CODE('mark') keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm') -keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') +keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') formAbsolutePosition = FOUR_CHAR_CODE('indx') formRelativePosition = FOUR_CHAR_CODE('rele') formTest = FOUR_CHAR_CODE('test') @@ -943,7 +943,7 @@ typeIndexDescriptor = FOUR_CHAR_CODE('inde') typeRangeDescriptor = FOUR_CHAR_CODE('rang') typeLogicalDescriptor = FOUR_CHAR_CODE('logi') typeCompDescriptor = FOUR_CHAR_CODE('cmpd') -typeOSLTokenList = FOUR_CHAR_CODE('ostl') +typeOSLTokenList = FOUR_CHAR_CODE('ostl') kAEIDoMinimum = 0x0000 kAEIDoWhose = 0x0001 kAEIDoMarking = 0x0004 @@ -957,4 +957,4 @@ typeWhoseRange = FOUR_CHAR_CODE('wrng') keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr') keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp') keyAEIndex = FOUR_CHAR_CODE('kidx') -keyAETest = FOUR_CHAR_CODE('ktst') +keyAETest = FOUR_CHAR_CODE('ktst') diff --git a/Lib/plat-mac/Carbon/CarbonEvents.py b/Lib/plat-mac/Carbon/CarbonEvents.py index ff4f69c..357ee5d 100755 --- a/Lib/plat-mac/Carbon/CarbonEvents.py +++ b/Lib/plat-mac/Carbon/CarbonEvents.py @@ -71,9 +71,9 @@ kEventRawKeyRepeat = 2 kEventRawKeyUp = 3 kEventRawKeyModifiersChanged = 4 kEventHotKeyPressed = 5 -kEventHotKeyReleased = 6 +kEventHotKeyReleased = 6 kEventKeyModifierNumLockBit = 16 -kEventKeyModifierFnBit = 17 +kEventKeyModifierFnBit = 17 kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit kEventAppActivated = 1 @@ -262,18 +262,18 @@ kControlBoundsChangeSizeChanged = (1 << 2) kControlBoundsChangePositionChanged = (1 << 3) kEventTabletPoint = 1 kEventTabletProximity = 2 -kEventTabletPointer = 1 +kEventTabletPointer = 1 kEventVolumeMounted = 1 -kEventVolumeUnmounted = 2 -typeFSVolumeRefNum = FOUR_CHAR_CODE('voln') +kEventVolumeUnmounted = 2 +typeFSVolumeRefNum = FOUR_CHAR_CODE('voln') kEventAppearanceScrollBarVariantChanged = 1 kEventServiceCopy = 1 kEventServicePaste = 2 kEventServiceGetTypes = 3 kEventServicePerform = 4 -kEventParamDirectObject = FOUR_CHAR_CODE('----') +kEventParamDirectObject = FOUR_CHAR_CODE('----') kEventParamPostTarget = FOUR_CHAR_CODE('ptrg') -typeEventTargetRef = FOUR_CHAR_CODE('etrg') +typeEventTargetRef = FOUR_CHAR_CODE('etrg') kEventParamWindowRef = FOUR_CHAR_CODE('wind') kEventParamGrafPort = FOUR_CHAR_CODE('graf') kEventParamDragRef = FOUR_CHAR_CODE('drag') @@ -304,7 +304,7 @@ typeCFTypeRef = FOUR_CHAR_CODE('cfty') typeCGContextRef = FOUR_CHAR_CODE('cntx') typeHIPoint = FOUR_CHAR_CODE('hipt') typeHISize = FOUR_CHAR_CODE('hisz') -typeHIRect = FOUR_CHAR_CODE('hirc') +typeHIRect = FOUR_CHAR_CODE('hirc') kEventParamMouseLocation = FOUR_CHAR_CODE('mloc') kEventParamMouseButton = FOUR_CHAR_CODE('mbtn') kEventParamClickCount = FOUR_CHAR_CODE('ccnt') @@ -314,13 +314,13 @@ kEventParamMouseDelta = FOUR_CHAR_CODE('mdta') kEventParamMouseChord = FOUR_CHAR_CODE('chor') kEventParamTabletEventType = FOUR_CHAR_CODE('tblt') typeMouseButton = FOUR_CHAR_CODE('mbtn') -typeMouseWheelAxis = FOUR_CHAR_CODE('mwax') +typeMouseWheelAxis = FOUR_CHAR_CODE('mwax') kEventParamKeyCode = FOUR_CHAR_CODE('kcod') kEventParamKeyMacCharCodes = FOUR_CHAR_CODE('kchr') kEventParamKeyModifiers = FOUR_CHAR_CODE('kmod') kEventParamKeyUnicodes = FOUR_CHAR_CODE('kuni') kEventParamKeyboardType = FOUR_CHAR_CODE('kbdt') -typeEventHotKeyID = FOUR_CHAR_CODE('hkid') +typeEventHotKeyID = FOUR_CHAR_CODE('hkid') kEventParamTextInputSendRefCon = FOUR_CHAR_CODE('tsrc') kEventParamTextInputSendComponentInstance = FOUR_CHAR_CODE('tsci') kEventParamTextInputSendSLRec = FOUR_CHAR_CODE('tssl') @@ -350,9 +350,9 @@ kEventParamTextInputSendShowHide = FOUR_CHAR_CODE('tssh') kEventParamTextInputReplyShowHide = FOUR_CHAR_CODE('trsh') kEventParamTextInputSendKeyboardEvent = FOUR_CHAR_CODE('tske') kEventParamTextInputSendTextServiceEncoding = FOUR_CHAR_CODE('tsse') -kEventParamTextInputSendTextServiceMacEncoding = FOUR_CHAR_CODE('tssm') +kEventParamTextInputSendTextServiceMacEncoding = FOUR_CHAR_CODE('tssm') kEventParamHICommand = FOUR_CHAR_CODE('hcmd') -typeHICommand = FOUR_CHAR_CODE('hcmd') +typeHICommand = FOUR_CHAR_CODE('hcmd') kEventParamWindowFeatures = FOUR_CHAR_CODE('wftr') kEventParamWindowDefPart = FOUR_CHAR_CODE('wdpc') kEventParamCurrentBounds = FOUR_CHAR_CODE('crct') @@ -375,7 +375,7 @@ kEventParamPreviousDockRect = FOUR_CHAR_CODE('pdrc') kEventParamCurrentDockRect = FOUR_CHAR_CODE('cdrc') typeWindowRegionCode = FOUR_CHAR_CODE('wshp') typeWindowDefPartCode = FOUR_CHAR_CODE('wdpt') -typeClickActivationResult = FOUR_CHAR_CODE('clac') +typeClickActivationResult = FOUR_CHAR_CODE('clac') kEventParamControlPart = FOUR_CHAR_CODE('cprt') kEventParamInitCollection = FOUR_CHAR_CODE('icol') kEventParamControlMessage = FOUR_CHAR_CODE('cmsg') @@ -402,7 +402,7 @@ kEventParamControlOriginalOwningWindow = FOUR_CHAR_CODE('coow') kEventParamControlCurrentOwningWindow = FOUR_CHAR_CODE('ccow') typeControlActionUPP = FOUR_CHAR_CODE('caup') typeIndicatorDragConstraint = FOUR_CHAR_CODE('cidc') -typeControlPartCode = FOUR_CHAR_CODE('cprt') +typeControlPartCode = FOUR_CHAR_CODE('cprt') kEventParamCurrentMenuTrackingMode = FOUR_CHAR_CODE('cmtm') kEventParamNewMenuTrackingMode = FOUR_CHAR_CODE('nmtm') kEventParamMenuFirstOpen = FOUR_CHAR_CODE('1sto') @@ -428,24 +428,24 @@ typeMenuCommand = FOUR_CHAR_CODE('mcmd') typeMenuTrackingMode = FOUR_CHAR_CODE('mtmd') typeMenuEventOptions = FOUR_CHAR_CODE('meop') typeThemeMenuState = FOUR_CHAR_CODE('tmns') -typeThemeMenuItemType = FOUR_CHAR_CODE('tmit') +typeThemeMenuItemType = FOUR_CHAR_CODE('tmit') kEventParamProcessID = FOUR_CHAR_CODE('psn ') kEventParamLaunchRefCon = FOUR_CHAR_CODE('lref') -kEventParamLaunchErr = FOUR_CHAR_CODE('err ') +kEventParamLaunchErr = FOUR_CHAR_CODE('err ') kEventParamTabletPointRec = FOUR_CHAR_CODE('tbrc') kEventParamTabletProximityRec = FOUR_CHAR_CODE('tbpx') typeTabletPointRec = FOUR_CHAR_CODE('tbrc') typeTabletProximityRec = FOUR_CHAR_CODE('tbpx') kEventParamTabletPointerRec = FOUR_CHAR_CODE('tbrc') -typeTabletPointerRec = FOUR_CHAR_CODE('tbrc') -kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv') +typeTabletPointerRec = FOUR_CHAR_CODE('tbrc') +kEventParamNewScrollBarVariant = FOUR_CHAR_CODE('nsbv') kEventParamScrapRef = FOUR_CHAR_CODE('scrp') kEventParamServiceCopyTypes = FOUR_CHAR_CODE('svsd') kEventParamServicePasteTypes = FOUR_CHAR_CODE('svpt') kEventParamServiceMessageName = FOUR_CHAR_CODE('svmg') kEventParamServiceUserData = FOUR_CHAR_CODE('svud') typeScrapRef = FOUR_CHAR_CODE('scrp') -typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma') +typeCFMutableArrayRef = FOUR_CHAR_CODE('cfma') # sHandler = NewEventHandlerUPP( x ) kMouseTrackingMousePressed = kMouseTrackingMouseDown kMouseTrackingMouseReleased = kMouseTrackingMouseUp diff --git a/Lib/plat-mac/Carbon/Components.py b/Lib/plat-mac/Carbon/Components.py index 3fbca02..75574cf 100644 --- a/Lib/plat-mac/Carbon/Components.py +++ b/Lib/plat-mac/Carbon/Components.py @@ -3,7 +3,7 @@ def FOUR_CHAR_CODE(x): return x kAppleManufacturer = FOUR_CHAR_CODE('appl') kComponentResourceType = FOUR_CHAR_CODE('thng') -kComponentAliasResourceType = FOUR_CHAR_CODE('thga') +kComponentAliasResourceType = FOUR_CHAR_CODE('thga') kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 @@ -19,7 +19,7 @@ kComponentTargetSelect = -6 kComponentUnregisterSelect = -7 kComponentGetMPWorkFunctionSelect = -8 kComponentExecuteWiredActionSelect = -9 -kComponentGetPublicResourceSelect = -10 +kComponentGetPublicResourceSelect = -10 componentDoAutoVersion = (1 << 0) componentWantsUnregister = (1 << 1) componentAutoVersionIncludeFlags = (1 << 2) diff --git a/Lib/plat-mac/Carbon/ControlAccessor.py b/Lib/plat-mac/Carbon/ControlAccessor.py index 791544e..0998925 100644 --- a/Lib/plat-mac/Carbon/ControlAccessor.py +++ b/Lib/plat-mac/Carbon/ControlAccessor.py @@ -6,22 +6,22 @@ import struct # These needn't go through this module, but are here for completeness def SetControlData_Handle(control, part, selector, data): control.SetControlData_Handle(part, selector, data) - + def GetControlData_Handle(control, part, selector): return control.GetControlData_Handle(part, selector) - + _accessdict = { kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle), } _codingdict = { kControlPushButtonDefaultTag : ("b", None, None), - + kControlEditTextTextTag: (None, None, None), kControlEditTextPasswordTag: (None, None, None), - + kControlPopupButtonMenuIDTag: ("h", None, None), - + kControlListBoxDoubleClickTag: ("b", None, None), } @@ -38,7 +38,7 @@ def SetControlData(control, part, selector, data): if structfmt: data = struct.pack(structfmt, data) control.SetControlData(part, selector, data) - + def GetControlData(control, part, selector): if _accessdict.has_key(selector): setfunc, getfunc = _accessdict[selector] @@ -54,4 +54,3 @@ def GetControlData(control, part, selector): if type(data) == type(()) and len(data) == 1: data = data[0] return data - diff --git a/Lib/plat-mac/Carbon/Controls.py b/Lib/plat-mac/Carbon/Controls.py index d4bbda3..6e5d8ea 100644 --- a/Lib/plat-mac/Carbon/Controls.py +++ b/Lib/plat-mac/Carbon/Controls.py @@ -17,20 +17,20 @@ kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF') controlNotifyNothing = FOUR_CHAR_CODE('nada') controlNotifyClick = FOUR_CHAR_CODE('clik') controlNotifyFocus = FOUR_CHAR_CODE('focu') -controlNotifyKey = FOUR_CHAR_CODE('key ') -kControlCanAutoInvalidate = 1L << 0 +controlNotifyKey = FOUR_CHAR_CODE('key ') +kControlCanAutoInvalidate = 1L << 0 staticTextProc = 256 editTextProc = 272 iconProc = 288 userItemProc = 304 -pictItemProc = 320 +pictItemProc = 320 cFrameColor = 0 cBodyColor = 1 cTextColor = 2 cThumbColor = 3 kNumberCtlCTabEntries = 4 kControlNoVariant = 0 -kControlUsesOwningWindowsFontVariant = 1 << 3 +kControlUsesOwningWindowsFontVariant = 1 << 3 kControlNoPart = 0 kControlIndicatorPart = 129 kControlDisabledPart = 254 @@ -40,7 +40,7 @@ kControlStructureMetaPart = -1 kControlContentMetaPart = -2 kControlFocusNoPart = 0 kControlFocusNextPart = -1 -kControlFocusPrevPart = -2 +kControlFocusPrevPart = -2 kControlCollectionTagBounds = FOUR_CHAR_CODE('boun') kControlCollectionTagValue = FOUR_CHAR_CODE('valu') kControlCollectionTagMinimum = FOUR_CHAR_CODE('min ') @@ -53,7 +53,7 @@ kControlCollectionTagUnicodeTitle = FOUR_CHAR_CODE('uttl') kControlCollectionTagIDSignature = FOUR_CHAR_CODE('idsi') kControlCollectionTagIDID = FOUR_CHAR_CODE('idid') kControlCollectionTagCommand = FOUR_CHAR_CODE('cmd ') -kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc') +kControlCollectionTagVarCode = FOUR_CHAR_CODE('varc') kControlContentTextOnly = 0 kControlNoContent = 0 kControlContentIconSuiteRes = 1 @@ -67,11 +67,11 @@ kControlContentIconRef = 132 kControlContentICON = 133 kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any ') kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn') -kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') +kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') kControlFontBigSystemFont = -1 kControlFontSmallSystemFont = -2 kControlFontSmallBoldSystemFont = -3 -kControlFontViewSystemFont = -4 +kControlFontViewSystemFont = -4 kControlUseFontMask = 0x0001 kControlUseFaceMask = 0x0002 kControlUseSizeMask = 0x0004 @@ -81,12 +81,12 @@ kControlUseModeMask = 0x0020 kControlUseJustMask = 0x0040 kControlUseAllMask = 0x00FF kControlAddFontSizeMask = 0x0100 -kControlAddToMetaFontMask = 0x0200 -kControlUseThemeFontIDMask = 0x0080 +kControlAddToMetaFontMask = 0x0200 +kControlUseThemeFontIDMask = 0x0080 kDoNotActivateAndIgnoreClick = 0 kDoNotActivateAndHandleClick = 1 kActivateAndIgnoreClick = 2 -kActivateAndHandleClick = 3 +kActivateAndHandleClick = 3 kControlFontStyleTag = FOUR_CHAR_CODE('font') kControlKeyFilterTag = FOUR_CHAR_CODE('fltr') kControlKindTag = FOUR_CHAR_CODE('kind') @@ -110,7 +110,7 @@ kControlSupportsFlattening = 1 << 19 kControlSupportsSetCursor = 1 << 20 kControlSupportsContextualMenus = 1 << 21 kControlSupportsClickActivation = 1 << 22 -kControlIdlesWithTimer = 1 << 23 +kControlIdlesWithTimer = 1 << 23 drawCntl = 0 testCntl = 1 calcCRgns = 2 @@ -149,7 +149,7 @@ kControlMsgDragWithin = 40 kControlMsgDragReceive = 41 kControlMsgDisplayDebugInfo = 46 kControlMsgContextualMenuClick = 47 -kControlMsgGetClickActivation = 48 +kControlMsgGetClickActivation = 48 kControlSizeNormal = 0 kControlSizeSmall = 1 kControlSizeLarge = 2 @@ -165,9 +165,9 @@ noConstraint = kNoConstraint hAxisOnly = 1 vAxisOnly = 2 kControlDefProcPtr = 0 -kControlDefObjectClass = 1 +kControlDefObjectClass = 1 kControlKindSignatureApple = FOUR_CHAR_CODE('appl') -kControlPropertyPersistent = 0x00000001 +kControlPropertyPersistent = 0x00000001 kDragTrackingEnterControl = 2 kDragTrackingInControl = 3 kDragTrackingLeaveControl = 4 @@ -178,7 +178,7 @@ kInIndicatorControlPart = kControlIndicatorPart kReservedControlPart = kControlDisabledPart kControlInactiveControlPart = kControlInactivePart kControlTabListResType = FOUR_CHAR_CODE('tab#') -kControlListDescResType = FOUR_CHAR_CODE('ldes') +kControlListDescResType = FOUR_CHAR_CODE('ldes') kControlCheckBoxUncheckedValue = 0 kControlCheckBoxCheckedValue = 1 kControlCheckBoxMixedValue = 2 @@ -228,7 +228,7 @@ kControlClockMinuteMonthPart = 10 kControlClockSecondYearPart = 11 kControlClockAMPMPart = 12 kControlDataBrowserPart = 24 -kControlDataBrowserDraggedPart = 25 +kControlDataBrowserDraggedPart = 25 kControlBevelButtonSmallBevelProc = 32 kControlBevelButtonNormalBevelProc = 33 kControlBevelButtonLargeBevelProc = 34 @@ -245,7 +245,7 @@ kControlBehaviorSticky = 0x0200 kControlBehaviorSingleValueMenu = 0 kControlBehaviorMultiValueMenu = 0x4000 kControlBehaviorOffsetContents = 0x8000 -kControlBehaviorCommandMenu = 0x2000 +kControlBehaviorCommandMenu = 0x2000 kControlBevelButtonMenuOnBottom = 0 kControlBevelButtonMenuOnRight = (1 << 2) kControlKindBevelButton = FOUR_CHAR_CODE('bevl') @@ -279,12 +279,12 @@ kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc') kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval') kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd') kControlBevelButtonMenuRefTag = FOUR_CHAR_CODE('mhnd') -# kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') +# kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu') -kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') -kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') +kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') +kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') kControlBevelButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') -kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk') +kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk') kControlSliderProc = 48 kControlSliderLiveFeedback = (1 << 0) kControlSliderHasTickMarks = (1 << 1) @@ -302,18 +302,18 @@ kControlDisclosureTrianglePointDefault = 0 kControlDisclosureTrianglePointRight = 1 kControlDisclosureTrianglePointLeft = 2 kControlKindDisclosureTriangle = FOUR_CHAR_CODE('dist') -kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') +kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') kControlProgressBarProc = 80 kControlRelevanceBarProc = 81 kControlKindProgressBar = FOUR_CHAR_CODE('prgb') kControlKindRelevanceBar = FOUR_CHAR_CODE('relb') kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde') -kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim') +kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim') kControlLittleArrowsProc = 96 kControlKindLittleArrows = FOUR_CHAR_CODE('larr') kControlChasingArrowsProc = 112 kControlKindChasingArrows = FOUR_CHAR_CODE('carr') -kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim') +kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim') kControlTabLargeProc = 128 kControlTabSmallProc = 129 kControlTabLargeNorthProc = 128 @@ -323,7 +323,7 @@ kControlTabSmallSouthProc = 131 kControlTabLargeEastProc = 132 kControlTabSmallEastProc = 133 kControlTabLargeWestProc = 134 -kControlTabSmallWestProc = 135 +kControlTabSmallWestProc = 135 kControlTabDirectionNorth = 0 kControlTabDirectionSouth = 1 kControlTabDirectionEast = 2 @@ -333,11 +333,11 @@ kControlTabSizeSmall = kControlSizeSmall kControlKindTabs = FOUR_CHAR_CODE('tabs') kControlTabContentRectTag = FOUR_CHAR_CODE('rect') kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab') -kControlTabFontStyleTag = kControlFontStyleTag -kControlTabInfoTag = FOUR_CHAR_CODE('tabi') -kControlTabImageContentTag = FOUR_CHAR_CODE('cont') +kControlTabFontStyleTag = kControlFontStyleTag +kControlTabInfoTag = FOUR_CHAR_CODE('tabi') +kControlTabImageContentTag = FOUR_CHAR_CODE('cont') kControlTabInfoVersionZero = 0 -kControlTabInfoVersionOne = 1 +kControlTabInfoVersionOne = 1 kControlSeparatorLineProc = 144 kControlKindSeparator = FOUR_CHAR_CODE('sepa') kControlGroupBoxTextTitleProc = 160 @@ -351,13 +351,13 @@ kControlKindCheckGroupBox = FOUR_CHAR_CODE('cgrp') kControlKindPopupGroupBox = FOUR_CHAR_CODE('pgrp') kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlGroupBoxMenuRefTag = FOUR_CHAR_CODE('mhan') -kControlGroupBoxFontStyleTag = kControlFontStyleTag -kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') +kControlGroupBoxFontStyleTag = kControlFontStyleTag +kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') kControlImageWellProc = 176 kControlKindImageWell = FOUR_CHAR_CODE('well') kControlImageWellContentTag = FOUR_CHAR_CODE('cont') kControlImageWellTransformTag = FOUR_CHAR_CODE('tran') -kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag') +kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag') kControlPopupArrowEastProc = 192 kControlPopupArrowWestProc = 193 kControlPopupArrowNorthProc = 194 @@ -392,7 +392,7 @@ kControlClockIsLive = 2 kControlKindClock = FOUR_CHAR_CODE('clck') kControlClockLongDateTag = FOUR_CHAR_CODE('date') kControlClockFontStyleTag = kControlFontStyleTag -kControlClockAnimatingTag = FOUR_CHAR_CODE('anim') +kControlClockAnimatingTag = FOUR_CHAR_CODE('anim') kControlUserPaneProc = 256 kControlKindUserPane = FOUR_CHAR_CODE('upan') kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp') @@ -403,63 +403,63 @@ kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle') kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd') kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti') kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci') -kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') +kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') kControlEditTextProc = 272 kControlEditTextPasswordProc = 274 -kControlEditTextInlineInputProc = 276 +kControlEditTextInlineInputProc = 276 kControlKindEditText = FOUR_CHAR_CODE('etxt') kControlEditTextStyleTag = kControlFontStyleTag kControlEditTextTextTag = FOUR_CHAR_CODE('text') kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than') kControlEditTextKeyFilterTag = kControlKeyFilterTag kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele') -kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') +kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr') kControlEditTextLockedTag = FOUR_CHAR_CODE('lock') kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt') kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali') kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup') -kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') +kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') kControlEditTextCFStringTag = FOUR_CHAR_CODE('cfst') -kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf') +kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf') kControlStaticTextProc = 288 kControlKindStaticText = FOUR_CHAR_CODE('stxt') kControlStaticTextStyleTag = kControlFontStyleTag kControlStaticTextTextTag = FOUR_CHAR_CODE('text') -kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') -kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') -kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst') +kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') +kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') +kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst') kControlPictureProc = 304 -kControlPictureNoTrackProc = 305 +kControlPictureNoTrackProc = 305 kControlKindPicture = FOUR_CHAR_CODE('pict') -kControlPictureHandleTag = FOUR_CHAR_CODE('pich') +kControlPictureHandleTag = FOUR_CHAR_CODE('pich') kControlIconProc = 320 kControlIconNoTrackProc = 321 kControlIconSuiteProc = 322 -kControlIconSuiteNoTrackProc = 323 +kControlIconSuiteNoTrackProc = 323 kControlIconRefProc = 324 -kControlIconRefNoTrackProc = 325 +kControlIconRefNoTrackProc = 325 kControlKindIcon = FOUR_CHAR_CODE('icon') kControlIconTransformTag = FOUR_CHAR_CODE('trfm') -kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') +kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') kControlIconResourceIDTag = FOUR_CHAR_CODE('ires') -kControlIconContentTag = FOUR_CHAR_CODE('cont') +kControlIconContentTag = FOUR_CHAR_CODE('cont') kControlWindowHeaderProc = 336 -kControlWindowListViewHeaderProc = 337 +kControlWindowListViewHeaderProc = 337 kControlKindWindowHeader = FOUR_CHAR_CODE('whed') kControlListBoxProc = 352 kControlListBoxAutoSizeProc = 353 kControlKindListBox = FOUR_CHAR_CODE('lbox') kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan') kControlListBoxKeyFilterTag = kControlKeyFilterTag -kControlListBoxFontStyleTag = kControlFontStyleTag +kControlListBoxFontStyleTag = kControlFontStyleTag kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc') -kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') +kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') kControlPushButtonProc = 368 kControlCheckBoxProc = 369 kControlRadioButtonProc = 370 kControlPushButLeftIconProc = 374 -kControlPushButRightIconProc = 375 +kControlPushButRightIconProc = 375 kControlCheckBoxAutoToggleProc = 371 kControlRadioButtonAutoToggleProc = 372 kControlPushButtonIconOnLeft = 6 @@ -469,11 +469,11 @@ kControlKindPushIconButton = FOUR_CHAR_CODE('picn') kControlKindRadioButton = FOUR_CHAR_CODE('rdio') kControlKindCheckBox = FOUR_CHAR_CODE('cbox') kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt') -kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') +kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') kControlScrollBarProc = 384 -kControlScrollBarLiveProc = 386 +kControlScrollBarLiveProc = 386 kControlKindScrollBar = FOUR_CHAR_CODE('sbar') -kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro') +kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro') kControlPopupButtonProc = 400 kControlPopupFixedWidthVariant = 1 << 0 kControlPopupVariableWidthVariant = 1 << 1 @@ -482,10 +482,10 @@ kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant kControlKindPopupButton = FOUR_CHAR_CODE('popb') kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan') kControlPopupButtonMenuRefTag = FOUR_CHAR_CODE('mhan') -kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') +kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht') -kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') -kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck') +kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') +kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck') kControlRadioGroupProc = 416 kControlKindRadioGroup = FOUR_CHAR_CODE('rgrp') kControlScrollTextBoxProc = 432 @@ -495,14 +495,14 @@ kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl') kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl') kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt') kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres') -kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim') +kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim') kControlKindDisclosureButton = FOUR_CHAR_CODE('disb') kControlDisclosureButtonClosed = 0 kControlDisclosureButtonDisclosed = 1 kControlRoundButtonNormalSize = kControlSizeNormal kControlRoundButtonLargeSize = kControlSizeLarge kControlRoundButtonContentTag = FOUR_CHAR_CODE('cont') -kControlRoundButtonSizeTag = kControlSizeTag +kControlRoundButtonSizeTag = kControlSizeTag kControlKindRoundButton = FOUR_CHAR_CODE('rndb') kControlKindDataBrowser = FOUR_CHAR_CODE('datb') errDataBrowserNotConfigured = -4970 @@ -511,7 +511,7 @@ errDataBrowserItemNotAdded = -4975 errDataBrowserPropertyNotFound = -4972 errDataBrowserInvalidPropertyPart = -4973 errDataBrowserInvalidPropertyData = -4974 -errDataBrowserPropertyNotSupported = -4979 +errDataBrowserPropertyNotSupported = -4979 kControlDataBrowserIncludesFrameAndFocusTag = FOUR_CHAR_CODE('brdr') kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag @@ -525,23 +525,23 @@ kDataBrowserResetSelection = 1 << 2 kDataBrowserCmdTogglesSelection = 1 << 3 kDataBrowserNoDisjointSelection = 1 << 4 kDataBrowserAlwaysExtendSelection = 1 << 5 -kDataBrowserNeverEmptySelectionSet = 1 << 6 +kDataBrowserNeverEmptySelectionSet = 1 << 6 kDataBrowserOrderUndefined = 0 kDataBrowserOrderIncreasing = 1 kDataBrowserOrderDecreasing = 2 -kDataBrowserNoItem = 0L +kDataBrowserNoItem = 0L kDataBrowserItemNoState = 0 # kDataBrowserItemAnyState = (unsigned long)(-1) kDataBrowserItemIsSelected = 1 << 0 kDataBrowserContainerIsOpen = 1 << 1 -kDataBrowserItemIsDragTarget = 1 << 2 +kDataBrowserItemIsDragTarget = 1 << 2 kDataBrowserRevealOnly = 0 kDataBrowserRevealAndCenterInView = 1 << 0 kDataBrowserRevealWithoutSelecting = 1 << 1 kDataBrowserItemsAdd = 0 kDataBrowserItemsAssign = 1 kDataBrowserItemsToggle = 2 -kDataBrowserItemsRemove = 3 +kDataBrowserItemsRemove = 3 kDataBrowserSelectionAnchorUp = 0 kDataBrowserSelectionAnchorDown = 1 kDataBrowserSelectionAnchorLeft = 2 @@ -568,7 +568,7 @@ kDataBrowserContainerSorted = 12 kDataBrowserUserToggledContainer = 16 kDataBrowserTargetChanged = 15 kDataBrowserUserStateChanged = 13 -kDataBrowserSelectionSetChanged = 14 +kDataBrowserSelectionSetChanged = 14 kDataBrowserItemNoProperty = 0L kDataBrowserItemIsActiveProperty = 1L kDataBrowserItemIsSelectableProperty = 2L @@ -580,7 +580,7 @@ kDataBrowserContainerIsSortableProperty = 7L kDataBrowserItemSelfIdentityProperty = 8L kDataBrowserContainerAliasIDProperty = 9L kDataBrowserColumnViewPreviewProperty = 10L -kDataBrowserItemParentContainerProperty = 11L +kDataBrowserItemParentContainerProperty = 11L kDataBrowserCustomType = 0x3F3F3F3F kDataBrowserIconType = FOUR_CHAR_CODE('icnr') kDataBrowserTextType = FOUR_CHAR_CODE('text') @@ -590,7 +590,7 @@ kDataBrowserCheckboxType = FOUR_CHAR_CODE('chbx') kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog') kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank') kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu') -kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') +kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') kDataBrowserPropertyEnclosingPart = 0L kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----') kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc') @@ -604,7 +604,7 @@ kDataBrowserUniversalPropertyFlagsMask = 0xFF kDataBrowserPropertyIsMutable = 1 << 0 kDataBrowserDefaultPropertyFlags = 0 << 0 kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask -kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable +kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable kDataBrowserPropertyFlagsOffset = 8 kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset @@ -620,10 +620,10 @@ kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask -kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative +kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative kDataBrowserViewSpecificFlagsOffset = 16 kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset -kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask +kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask kDataBrowserClientPropertyFlagsOffset = 24 # kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset) kDataBrowserLatestCallbacks = 0 diff --git a/Lib/plat-mac/Carbon/CoreFoundation.py b/Lib/plat-mac/Carbon/CoreFoundation.py index 2907c1d..8d9c894 100644 --- a/Lib/plat-mac/Carbon/CoreFoundation.py +++ b/Lib/plat-mac/Carbon/CoreFoundation.py @@ -16,13 +16,13 @@ kCFStringEncodingNextStepLatin = 0x0B01 kCFStringEncodingASCII = 0x0600 kCFStringEncodingUnicode = 0x0100 kCFStringEncodingUTF8 = 0x08000100 -kCFStringEncodingNonLossyASCII = 0x0BFF +kCFStringEncodingNonLossyASCII = 0x0BFF kCFCompareCaseInsensitive = 1 kCFCompareBackwards = 4 kCFCompareAnchored = 8 kCFCompareNonliteral = 16 kCFCompareLocalized = 32 -kCFCompareNumerically = 64 +kCFCompareNumerically = 64 kCFURLPOSIXPathStyle = 0 kCFURLHFSPathStyle = 1 kCFURLWindowsPathStyle = 2 diff --git a/Lib/plat-mac/Carbon/CoreGraphics.py b/Lib/plat-mac/Carbon/CoreGraphics.py index d7a6f02..f4cb0b9 100755 --- a/Lib/plat-mac/Carbon/CoreGraphics.py +++ b/Lib/plat-mac/Carbon/CoreGraphics.py @@ -25,4 +25,4 @@ kCGEncodingMacRoman = 1 kCGInterpolationDefault = 0 kCGInterpolationNone = 1 kCGInterpolationLow = 2 -kCGInterpolationHigh = 3 +kCGInterpolationHigh = 3 diff --git a/Lib/plat-mac/Carbon/Dialogs.py b/Lib/plat-mac/Carbon/Dialogs.py index 9d2fa8f..f846d7c 100644 --- a/Lib/plat-mac/Carbon/Dialogs.py +++ b/Lib/plat-mac/Carbon/Dialogs.py @@ -45,7 +45,7 @@ kAlertCautionAlert = 2 kAlertPlainAlert = 3 kAlertDefaultOKText = -1 kAlertDefaultCancelText = -1 -kAlertDefaultOtherText = -1 +kAlertDefaultOtherText = -1 kAlertStdAlertOKButton = 1 kAlertStdAlertCancelButton = 2 kAlertStdAlertOtherButton = 3 @@ -71,8 +71,8 @@ kDialogFontAddFontSizeMask = 0x0100 kDialogFontUseFontNameMask = 0x0200 kDialogFontAddToMetaFontMask = 0x0400 kDialogFontUseThemeFontIDMask = 0x0080 -kHICommandOther = FOUR_CHAR_CODE('othr') -kStdCFStringAlertVersionOne = 1 +kHICommandOther = FOUR_CHAR_CODE('othr') +kStdCFStringAlertVersionOne = 1 kStdAlertDoNotDisposeSheet = 1 << 0 kStdAlertDoNotAnimateOnDefault = 1 << 1 kStdAlertDoNotAnimateOnCancel = 1 << 2 diff --git a/Lib/plat-mac/Carbon/Dragconst.py b/Lib/plat-mac/Carbon/Dragconst.py index e5c8b89..38e12be 100644 --- a/Lib/plat-mac/Carbon/Dragconst.py +++ b/Lib/plat-mac/Carbon/Dragconst.py @@ -6,56 +6,56 @@ from Carbon.QuickDraw import * fkDragActionAll = -1 -kDragHasLeftSenderWindow = (1 << 0) +kDragHasLeftSenderWindow = (1 << 0) kDragInsideSenderApplication = (1 << 1) -kDragInsideSenderWindow = (1 << 2) -kDragRegionAndImage = (1 << 4) -flavorSenderOnly = (1 << 0) -flavorSenderTranslated = (1 << 1) -flavorNotSaved = (1 << 2) -flavorSystemTranslated = (1 << 8) +kDragInsideSenderWindow = (1 << 2) +kDragRegionAndImage = (1 << 4) +flavorSenderOnly = (1 << 0) +flavorSenderTranslated = (1 << 1) +flavorNotSaved = (1 << 2) +flavorSystemTranslated = (1 << 8) kDragHasLeftSenderWindow = (1L << 0) kDragInsideSenderApplication = (1L << 1) -kDragInsideSenderWindow = (1L << 2) +kDragInsideSenderWindow = (1L << 2) kDragBehaviorNone = 0 -kDragBehaviorZoomBackAnimation = (1L << 0) -kDragRegionAndImage = (1L << 4) +kDragBehaviorZoomBackAnimation = (1L << 0) +kDragRegionAndImage = (1L << 4) kDragStandardTranslucency = 0L kDragDarkTranslucency = 1L kDragDarkerTranslucency = 2L -kDragOpaqueTranslucency = 3L +kDragOpaqueTranslucency = 3L kDragRegionBegin = 1 kDragRegionDraw = 2 kDragRegionHide = 3 kDragRegionIdle = 4 -kDragRegionEnd = 5 +kDragRegionEnd = 5 kZoomNoAcceleration = 0 kZoomAccelerate = 1 -kZoomDecelerate = 2 +kZoomDecelerate = 2 flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) -flavorDataPromised = (1 << 9) +flavorDataPromised = (1 << 9) kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs ') kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs') flavorTypeHFS = kDragFlavorTypeHFS -flavorTypePromiseHFS = kDragFlavorTypePromiseHFS +flavorTypePromiseHFS = kDragFlavorTypePromiseHFS kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1') -kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') +kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS') kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk') -kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') -flavorTypeDirectory = FOUR_CHAR_CODE('diry') +kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') +flavorTypeDirectory = FOUR_CHAR_CODE('diry') kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm') kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn') kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt') -kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') +kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') kDragTrackingEnterHandler = 1 kDragTrackingEnterWindow = 2 kDragTrackingInWindow = 3 kDragTrackingLeaveWindow = 4 -kDragTrackingLeaveHandler = 5 +kDragTrackingLeaveHandler = 5 kDragActionNothing = 0L kDragActionCopy = 1L kDragActionAlias = (1L << 1) @@ -66,21 +66,21 @@ kDragActionDelete = (1L << 5) # kDragActionAll = (long)0xFFFFFFFF dragHasLeftSenderWindow = kDragHasLeftSenderWindow dragInsideSenderApplication = kDragInsideSenderApplication -dragInsideSenderWindow = kDragInsideSenderWindow +dragInsideSenderWindow = kDragInsideSenderWindow dragTrackingEnterHandler = kDragTrackingEnterHandler dragTrackingEnterWindow = kDragTrackingEnterWindow dragTrackingInWindow = kDragTrackingInWindow dragTrackingLeaveWindow = kDragTrackingLeaveWindow -dragTrackingLeaveHandler = kDragTrackingLeaveHandler +dragTrackingLeaveHandler = kDragTrackingLeaveHandler dragRegionBegin = kDragRegionBegin dragRegionDraw = kDragRegionDraw dragRegionHide = kDragRegionHide dragRegionIdle = kDragRegionIdle -dragRegionEnd = kDragRegionEnd +dragRegionEnd = kDragRegionEnd zoomNoAcceleration = kZoomNoAcceleration zoomAccelerate = kZoomAccelerate -zoomDecelerate = kZoomDecelerate +zoomDecelerate = kZoomDecelerate kDragStandardImage = kDragStandardTranslucency kDragDarkImage = kDragDarkTranslucency kDragDarkerImage = kDragDarkerTranslucency -kDragOpaqueImage = kDragOpaqueTranslucency +kDragOpaqueImage = kDragOpaqueTranslucency diff --git a/Lib/plat-mac/Carbon/Events.py b/Lib/plat-mac/Carbon/Events.py index 4853469..269f4f1 100644 --- a/Lib/plat-mac/Carbon/Events.py +++ b/Lib/plat-mac/Carbon/Events.py @@ -21,15 +21,15 @@ diskMask = 1 << diskEvt activMask = 1 << activateEvt highLevelEventMask = 0x0400 osMask = 1 << osEvt -everyEvent = 0xFFFF +everyEvent = 0xFFFF charCodeMask = 0x000000FF keyCodeMask = 0x0000FF00 adbAddrMask = 0x00FF0000 # osEvtMessageMask = (unsigned long)0xFF000000 mouseMovedMessage = 0x00FA suspendResumeMessage = 0x0001 -resumeFlag = 1 -convertClipboardFlag = 2 +resumeFlag = 1 +convertClipboardFlag = 2 activeFlagBit = 0 btnStateBit = 7 cmdKeyBit = 8 @@ -39,7 +39,7 @@ optionKeyBit = 11 controlKeyBit = 12 rightShiftKeyBit = 13 rightOptionKeyBit = 14 -rightControlKeyBit = 15 +rightControlKeyBit = 15 activeFlag = 1 << activeFlagBit btnState = 1 << btnStateBit cmdKey = 1 << cmdKeyBit @@ -87,7 +87,7 @@ kPencilUnicode = 0x270E kCheckUnicode = 0x2713 kDiamondUnicode = 0x25C6 kBulletUnicode = 0x2022 -kAppleLogoUnicode = 0xF8FF +kAppleLogoUnicode = 0xF8FF networkEvt = 10 driverEvt = 11 app1Evt = 12 diff --git a/Lib/plat-mac/Carbon/Files.py b/Lib/plat-mac/Carbon/Files.py index 54fe4b8..678bbc7 100644 --- a/Lib/plat-mac/Carbon/Files.py +++ b/Lib/plat-mac/Carbon/Files.py @@ -9,7 +9,7 @@ fsWrPerm = 0x02 fsRdWrPerm = 0x03 fsRdWrShPerm = 0x04 fsRdDenyPerm = 0x10 -fsWrDenyPerm = 0x20 +fsWrDenyPerm = 0x20 fsRtParID = 1 fsRtDirID = 2 fsAtMark = 0 @@ -27,7 +27,7 @@ forceReadBit = 6 forceReadMask = 0x0040 newLineBit = 7 newLineMask = 0x0080 -newLineCharMask = 0xFF00 +newLineCharMask = 0xFF00 fsSBPartialName = 1 fsSBFullName = 2 fsSBFlAttrib = 4 @@ -69,7 +69,7 @@ fsSBDrCrDatBit = 9 fsSBDrMdDatBit = 10 fsSBDrBkDatBit = 11 fsSBDrFndrInfoBit = 12 -fsSBDrParIDBit = 13 +fsSBDrParIDBit = 13 bLimitFCBs = 31 bLocalWList = 30 bNoMiniFndr = 29 @@ -106,19 +106,19 @@ bSupportsLongNames = 5 bSupportsMultiScriptNames = 6 bSupportsNamedForks = 7 bSupportsSubtreeIterators = 8 -bL2PCanMapFileBlocks = 9 +bL2PCanMapFileBlocks = 9 bParentModDateChanges = 10 -bAncestorModDateChanges = 11 +bAncestorModDateChanges = 11 bSupportsSymbolicLinks = 13 bIsAutoMounted = 14 -bAllowCDiDataHandler = 17 +bAllowCDiDataHandler = 17 kLargeIcon = 1 kLarge4BitIcon = 2 kLarge8BitIcon = 3 kSmallIcon = 4 kSmall4BitIcon = 5 kSmall8BitIcon = 6 -kicnsIconFamily = 239 +kicnsIconFamily = 239 kLargeIconSize = 256 kLarge4BitIconSize = 512 kLarge8BitIconSize = 1024 @@ -229,7 +229,7 @@ kioACAccessOwnerReadMask = 0x00000002 kioACAccessOwnerSearchBit = 0 kioACAccessOwnerSearchMask = 0x00000001 kfullPrivileges = 0x00070007 -kownerPrivileges = 0x00000007 +kownerPrivileges = 0x00000007 knoUser = 0 kadministratorUser = 1 knoGroup = 0 @@ -243,12 +243,12 @@ volMountInteractMask = 0x8000 volMountChangedBit = 14 volMountChangedMask = 0x4000 volMountFSReservedMask = 0x00FF -volMountSysReservedMask = 0xFF00 -kAFPExtendedFlagsAlternateAddressMask = 1 +volMountSysReservedMask = 0xFF00 +kAFPExtendedFlagsAlternateAddressMask = 1 kAFPTagTypeIP = 0x01 kAFPTagTypeIPPort = 0x02 kAFPTagTypeDDP = 0x03 -kAFPTagTypeDNS = 0x04 +kAFPTagTypeDNS = 0x04 kAFPTagLengthIP = 0x06 kAFPTagLengthIPPort = 0x08 kAFPTagLengthDDP = 0x06 @@ -276,7 +276,7 @@ kFSCatInfoUserAccess = 0x00080000 kFSCatInfoAllDates = 0x000003E0 kFSCatInfoGettableInfo = 0x0003FFFF kFSCatInfoSettableInfo = 0x00001FE3 -# kFSCatInfoReserved = (long)0xFFFC0000 +# kFSCatInfoReserved = (long)0xFFFC0000 kFSNodeLockedBit = 0 kFSNodeLockedMask = 0x0001 kFSNodeResOpenBit = 2 @@ -311,7 +311,7 @@ kFSAllocDefaultFlags = 0x0000 kFSAllocAllOrNothingMask = 0x0001 kFSAllocContiguousMask = 0x0002 kFSAllocNoRoundUpMask = 0x0004 -kFSAllocReservedMask = 0xFFF8 +kFSAllocReservedMask = 0xFFF8 kFSVolInfoNone = 0x0000 kFSVolInfoCreateDate = 0x0001 kFSVolInfoModDate = 0x0002 @@ -330,7 +330,7 @@ kFSVolInfoFlags = 0x2000 kFSVolInfoFSInfo = 0x4000 kFSVolInfoDriveInfo = 0x8000 kFSVolInfoGettableInfo = 0xFFFF -kFSVolInfoSettableInfo = 0x3004 +kFSVolInfoSettableInfo = 0x3004 kFSVolFlagDefaultVolumeBit = 5 kFSVolFlagDefaultVolumeMask = 0x0020 kFSVolFlagFilesOpenBit = 6 @@ -341,19 +341,19 @@ kFSVolFlagSoftwareLockedBit = 15 kFSVolFlagSoftwareLockedMask = 0x8000 kFNDirectoryModifiedMessage = 1 kFNNoImplicitAllSubscription = (1 << 0) -rAliasType = FOUR_CHAR_CODE('alis') +rAliasType = FOUR_CHAR_CODE('alis') kARMMountVol = 0x00000001 kARMNoUI = 0x00000002 kARMMultVols = 0x00000008 kARMSearch = 0x00000100 kARMSearchMore = 0x00000200 -kARMSearchRelFirst = 0x00000400 +kARMSearchRelFirst = 0x00000400 asiZoneName = -3 asiServerName = -2 asiVolumeName = -1 asiAliasName = 0 -asiParentName = 1 -kResolveAliasFileNoUI = 0x00000001 +asiParentName = 1 +kResolveAliasFileNoUI = 0x00000001 kClippingCreator = FOUR_CHAR_CODE('drag') kClippingPictureType = FOUR_CHAR_CODE('clpp') kClippingTextType = FOUR_CHAR_CODE('clpt') @@ -369,7 +369,7 @@ kInternetLocationAFP = FOUR_CHAR_CODE('ilaf') kInternetLocationAppleTalk = FOUR_CHAR_CODE('ilat') kInternetLocationNSL = FOUR_CHAR_CODE('ilns') kInternetLocationGeneric = FOUR_CHAR_CODE('ilge') -kCustomIconResource = -16455 +kCustomIconResource = -16455 kCustomBadgeResourceType = FOUR_CHAR_CODE('badg') kCustomBadgeResourceID = kCustomIconResource kCustomBadgeResourceVersion = 0 @@ -388,7 +388,7 @@ kContainerCDROMAliasType = FOUR_CHAR_CODE('cddr') kApplicationCPAliasType = FOUR_CHAR_CODE('acdp') kApplicationDAAliasType = FOUR_CHAR_CODE('addp') kPackageAliasType = FOUR_CHAR_CODE('fpka') -kAppPackageAliasType = FOUR_CHAR_CODE('fapa') +kAppPackageAliasType = FOUR_CHAR_CODE('fapa') kSystemFolderAliasType = FOUR_CHAR_CODE('fasy') kAppleMenuFolderAliasType = FOUR_CHAR_CODE('faam') kStartupFolderAliasType = FOUR_CHAR_CODE('fast') @@ -410,7 +410,7 @@ kIsStationery = 0x0800 kNameLocked = 0x1000 kHasBundle = 0x2000 kIsInvisible = 0x4000 -kIsAlias = 0x8000 +kIsAlias = 0x8000 fOnDesk = kIsOnDesk fHasBundle = kHasBundle fInvisible = kIsInvisible @@ -420,7 +420,7 @@ fDisk = 0 kIsStationary = kIsStationery kExtendedFlagsAreInvalid = 0x8000 kExtendedFlagHasCustomBadge = 0x0100 -kExtendedFlagHasRoutingInfo = 0x0004 +kExtendedFlagHasRoutingInfo = 0x0004 kFirstMagicBusyFiletype = FOUR_CHAR_CODE('bzy ') kLastMagicBusyFiletype = FOUR_CHAR_CODE('bzy?') kMagicBusyCreationDate = 0x4F3AFDB0 diff --git a/Lib/plat-mac/Carbon/Folders.py b/Lib/plat-mac/Carbon/Folders.py index f22b2ba..52cf158 100644 --- a/Lib/plat-mac/Carbon/Folders.py +++ b/Lib/plat-mac/Carbon/Folders.py @@ -9,7 +9,7 @@ kSystemDomain = -32766 kLocalDomain = -32765 kNetworkDomain = -32764 kUserDomain = -32763 -kClassicDomain = -32762 +kClassicDomain = -32762 kCreateFolder = true kDontCreateFolder = false kSystemFolderType = FOUR_CHAR_CODE('macs') @@ -28,7 +28,7 @@ kExtensionFolderType = FOUR_CHAR_CODE('extn') kFontsFolderType = FOUR_CHAR_CODE('font') kPreferencesFolderType = FOUR_CHAR_CODE('pref') kSystemPreferencesFolderType = FOUR_CHAR_CODE('sprf') -kTemporaryFolderType = FOUR_CHAR_CODE('temp') +kTemporaryFolderType = FOUR_CHAR_CODE('temp') kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD') kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD') kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD') @@ -86,7 +86,7 @@ kKeychainFolderType = FOUR_CHAR_CODE('kchn') kQuickTimeExtensionsFolderType = FOUR_CHAR_CODE('qtex') kDisplayExtensionsFolderType = FOUR_CHAR_CODE('dspl') kMultiprocessingFolderType = FOUR_CHAR_CODE('mpxf') -kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg') +kPrintingPlugInsFolderType = FOUR_CHAR_CODE('pplg') kDomainTopLevelFolderType = FOUR_CHAR_CODE('dtop') kDomainLibraryFolderType = FOUR_CHAR_CODE('dlib') kColorSyncFolderType = FOUR_CHAR_CODE('sync') @@ -127,15 +127,15 @@ kInstallerReceiptsFolderType = FOUR_CHAR_CODE('rcpt') kFileSystemSupportFolderType = FOUR_CHAR_CODE('fsys') kAppleShareSupportFolderType = FOUR_CHAR_CODE('shar') kAppleShareAuthenticationFolderType = FOUR_CHAR_CODE('auth') -kMIDIDriversFolderType = FOUR_CHAR_CODE('midi') +kMIDIDriversFolderType = FOUR_CHAR_CODE('midi') kLocalesFolderType = FOUR_CHAR_CODE('\xc4loc') -kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp') +kFindByContentPluginsFolderType = FOUR_CHAR_CODE('fbcp') kUsersFolderType = FOUR_CHAR_CODE('usrs') kCurrentUserFolderType = FOUR_CHAR_CODE('cusr') kCurrentUserRemoteFolderLocation = FOUR_CHAR_CODE('rusf') kCurrentUserRemoteFolderType = FOUR_CHAR_CODE('rusr') kSharedUserDataFolderType = FOUR_CHAR_CODE('sdat') -kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd') +kVolumeSettingsFolderType = FOUR_CHAR_CODE('vsfd') kAppleshareAutomountServerAliasesFolderType = FOUR_CHAR_CODE('srv\xc4') kPreMacOS91ApplicationsFolderType = FOUR_CHAR_CODE('\x8cpps') kPreMacOS91InstallerLogsFolderType = FOUR_CHAR_CODE('\x94lgf') @@ -145,7 +145,7 @@ kPreMacOS91AppleExtrasFolderType = FOUR_CHAR_CODE('\x8cex\xc4') kPreMacOS91MacOSReadMesFolderType = FOUR_CHAR_CODE('\xb5or\xc4') kPreMacOS91InternetFolderType = FOUR_CHAR_CODE('\x94nt\xc4') kPreMacOS91AutomountedServersFolderType = FOUR_CHAR_CODE('\xa7rv\xc4') -kPreMacOS91StationeryFolderType = FOUR_CHAR_CODE('\xbfdst') +kPreMacOS91StationeryFolderType = FOUR_CHAR_CODE('\xbfdst') kCreateFolderAtBoot = 0x00000002 kCreateFolderAtBootBit = 1 kFolderCreatedInvisible = 0x00000004 @@ -171,7 +171,7 @@ kRelativeFolder = FOUR_CHAR_CODE('relf') kSpecialFolder = FOUR_CHAR_CODE('spcf') kBlessedFolder = FOUR_CHAR_CODE('blsf') kRootFolder = FOUR_CHAR_CODE('rotf') -kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf') +kCurrentUserFolderLocation = FOUR_CHAR_CODE('cusf') kFindFolderRedirectionFlagUseDistinctUserFoldersBit = 0 kFindFolderRedirectionFlagUseGivenVRefAndDirIDAsUserFolderBit = 1 kFindFolderRedirectionFlagsUseGivenVRefNumAndDirIDAsRemoteUserFolderBit = 2 @@ -184,7 +184,7 @@ kFolderManagerNotificationMessagePreUserLogIn = FOUR_CHAR_CODE('logj') kFolderManagerNotificationMessageUserLogOut = FOUR_CHAR_CODE('log-') kFolderManagerNotificationMessagePostUserLogOut = FOUR_CHAR_CODE('logp') kFolderManagerNotificationDiscardCachedData = FOUR_CHAR_CODE('dche') -kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup') +kFolderManagerNotificationMessageLoginStartup = FOUR_CHAR_CODE('stup') kDoNotRemoveWhenCurrentApplicationQuitsBit = 0 -kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit +kDoNotRemoveWheCurrentApplicationQuitsBit = kDoNotRemoveWhenCurrentApplicationQuitsBit kStopIfAnyNotificationProcReturnsErrorBit = 31 diff --git a/Lib/plat-mac/Carbon/Icons.py b/Lib/plat-mac/Carbon/Icons.py index 1ed8d50..86dae63 100644 --- a/Lib/plat-mac/Carbon/Icons.py +++ b/Lib/plat-mac/Carbon/Icons.py @@ -254,7 +254,7 @@ kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil') kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt') kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf') kUserIDiskIcon = FOUR_CHAR_CODE('udsk') -kInternationResourcesIcon = kInternationalResourcesIcon +kInternationResourcesIcon = kInternationalResourcesIcon kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht') kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft') kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf') diff --git a/Lib/plat-mac/Carbon/LaunchServices.py b/Lib/plat-mac/Carbon/LaunchServices.py index 22bb421..daff446 100644 --- a/Lib/plat-mac/Carbon/LaunchServices.py +++ b/Lib/plat-mac/Carbon/LaunchServices.py @@ -20,10 +20,10 @@ kLSNotRegisteredErr = -10819 kLSAppDoesNotClaimTypeErr = -10820 kLSAppDoesNotSupportSchemeWarning = -10821 kLSServerCommunicationErr = -10822 -kLSCannotSetInfoErr = -10823 +kLSCannotSetInfoErr = -10823 kLSInitializeDefaults = 0x00000001 -kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo) -# kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF +kLSMinCatInfoBitmap = (kFSCatInfoNodeFlags | kFSCatInfoParentDirID | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo) +# kLSInvalidExtensionIndex = (unsigned long)0xFFFFFFFF kLSRequestExtension = 0x00000001 kLSRequestTypeCreator = 0x00000002 kLSRequestBasicFlagsOnly = 0x00000004 @@ -31,7 +31,7 @@ kLSRequestAppTypeFlags = 0x00000008 kLSRequestAllFlags = 0x00000010 kLSRequestIconAndKind = 0x00000020 kLSRequestExtensionFlagsOnly = 0x00000040 -# kLSRequestAllInfo = (unsigned long)0xFFFFFFFF +# kLSRequestAllInfo = (unsigned long)0xFFFFFFFF kLSItemInfoIsPlainFile = 0x00000001 kLSItemInfoIsPackage = 0x00000002 kLSItemInfoIsApplication = 0x00000004 @@ -45,16 +45,16 @@ kLSItemInfoAppPrefersNative = 0x00000200 kLSItemInfoAppPrefersClassic = 0x00000400 kLSItemInfoAppIsScriptable = 0x00000800 kLSItemInfoIsVolume = 0x00001000 -kLSItemInfoExtensionIsHidden = 0x00100000 +kLSItemInfoExtensionIsHidden = 0x00100000 kLSRolesNone = 0x00000001 kLSRolesViewer = 0x00000002 kLSRolesEditor = 0x00000004 -# kLSRolesAll = (unsigned long)0xFFFFFFFF +# kLSRolesAll = (unsigned long)0xFFFFFFFF kLSUnknownKindID = 0 # kLSUnknownType = 0 # kLSUnknownCreator = 0 kLSAcceptDefault = 0x00000001 -kLSAcceptAllowLoginUI = 0x00000002 +kLSAcceptAllowLoginUI = 0x00000002 kLSLaunchDefaults = 0x00000001 kLSLaunchAndPrint = 0x00000002 kLSLaunchReserved2 = 0x00000004 @@ -71,4 +71,4 @@ kLSLaunchStartClassic = 0x00020000 kLSLaunchInClassic = 0x00040000 kLSLaunchNewInstance = 0x00080000 kLSLaunchAndHide = 0x00100000 -kLSLaunchAndHideOthers = 0x00200000 +kLSLaunchAndHideOthers = 0x00200000 diff --git a/Lib/plat-mac/Carbon/Lists.py b/Lib/plat-mac/Carbon/Lists.py index 76518ba..723294c 100644 --- a/Lib/plat-mac/Carbon/Lists.py +++ b/Lib/plat-mac/Carbon/Lists.py @@ -4,7 +4,7 @@ def FOUR_CHAR_CODE(x): return x listNotifyNothing = FOUR_CHAR_CODE('nada') listNotifyClick = FOUR_CHAR_CODE('clik') listNotifyDoubleClick = FOUR_CHAR_CODE('dblc') -listNotifyPreClick = FOUR_CHAR_CODE('pclk') +listNotifyPreClick = FOUR_CHAR_CODE('pclk') lDrawingModeOffBit = 3 lDoVAutoscrollBit = 1 lDoHAutoscrollBit = 0 diff --git a/Lib/plat-mac/Carbon/MacHelp.py b/Lib/plat-mac/Carbon/MacHelp.py index a231a8d..06b9912 100644 --- a/Lib/plat-mac/Carbon/MacHelp.py +++ b/Lib/plat-mac/Carbon/MacHelp.py @@ -51,8 +51,8 @@ kHMContentProvided = 0 kHMContentNotProvided = 1 kHMContentNotProvidedDontPropagate = 2 kHMMinimumContentIndex = 0 -kHMMaximumContentIndex = 1 +kHMMaximumContentIndex = 1 errHMIllegalContentForMinimumState = -10980 -errHMIllegalContentForMaximumState = -10981 +errHMIllegalContentForMaximumState = -10981 kHMIllegalContentForMinimumState = errHMIllegalContentForMinimumState kHelpTagEventHandlerTag = FOUR_CHAR_CODE('hevt') diff --git a/Lib/plat-mac/Carbon/MacTextEditor.py b/Lib/plat-mac/Carbon/MacTextEditor.py index fcc6fd2..4609d8d 100644 --- a/Lib/plat-mac/Carbon/MacTextEditor.py +++ b/Lib/plat-mac/Carbon/MacTextEditor.py @@ -145,7 +145,7 @@ kTXNDropAction = 11 kTXNMoveAction = 12 kTXNFontFeatureAction = 13 kTXNFontVariationAction = 14 -kTXNUndoLastAction = 1024 +kTXNUndoLastAction = 1024 # kTXNClearThisControl = (long)0xFFFFFFFF # kTXNClearTheseFontFeatures = (long)0x80000000 kTXNReadWrite = false @@ -176,7 +176,7 @@ kTXNFlushLeft = 1 kTXNFlushRight = 2 kTXNCenter = 4 kTXNFullJust = 8 -kTXNForceFullJust = 16 +kTXNForceFullJust = 16 kScrollBarsAlwaysActive = true kScrollBarsSyncWithFocus = false # kTXNDontCareTypeSize = (long)0xFFFFFFFF @@ -192,7 +192,7 @@ kTXNSingleStylePerTextDocumentResType = FOUR_CHAR_CODE('MPSR') kTXNMultipleStylesPerTextDocumentResType = FOUR_CHAR_CODE('styl') kTXNShowStart = false kTXNShowEnd = true -kTXNDefaultFontName = 0 +kTXNDefaultFontName = 0 kTXNDefaultFontSize = 0x000C0000 kTXNDefaultFontStyle = normal kTXNQDFontNameAttribute = FOUR_CHAR_CODE('fntn') diff --git a/Lib/plat-mac/Carbon/MediaDescr.py b/Lib/plat-mac/Carbon/MediaDescr.py index acacfb1..254634b 100644 --- a/Lib/plat-mac/Carbon/MediaDescr.py +++ b/Lib/plat-mac/Carbon/MediaDescr.py @@ -4,58 +4,58 @@ import struct Error = 'MediaDescr.Error' class _MediaDescriptionCodec: - def __init__(self, trunc, size, names, fmt): - self.trunc = trunc - self.size = size - self.names = names - self.fmt = fmt + def __init__(self, trunc, size, names, fmt): + self.trunc = trunc + self.size = size + self.names = names + self.fmt = fmt - def decode(self, data): - if self.trunc: - data = data[:self.size] - values = struct.unpack(self.fmt, data) - if len(values) != len(self.names): - raise Error, ('Format length does not match number of names', descr) - rv = {} - for i in range(len(values)): - name = self.names[i] - value = values[i] - if type(name) == type(()): - name, cod, dec = name - value = dec(value) - rv[name] = value - return rv + def decode(self, data): + if self.trunc: + data = data[:self.size] + values = struct.unpack(self.fmt, data) + if len(values) != len(self.names): + raise Error, ('Format length does not match number of names', descr) + rv = {} + for i in range(len(values)): + name = self.names[i] + value = values[i] + if type(name) == type(()): + name, cod, dec = name + value = dec(value) + rv[name] = value + return rv - def encode(dict): - list = [self.fmt] - for name in self.names: - if type(name) == type(()): - name, cod, dec = name - else: - cod = dec = None - value = dict[name] - if cod: - value = cod(value) - list.append(value) - rv = struct.pack(*list) - return rv + def encode(dict): + list = [self.fmt] + for name in self.names: + if type(name) == type(()): + name, cod, dec = name + else: + cod = dec = None + value = dict[name] + if cod: + value = cod(value) + list.append(value) + rv = struct.pack(*list) + return rv # Helper functions def _tofixed(float): - hi = int(float) - lo = int(float*0x10000) & 0xffff - return (hi<<16)|lo + hi = int(float) + lo = int(float*0x10000) & 0xffff + return (hi<<16)|lo def _fromfixed(fixed): - hi = (fixed >> 16) & 0xffff - lo = (fixed & 0xffff) - return hi + (lo / float(0x10000)) + hi = (fixed >> 16) & 0xffff + lo = (fixed & 0xffff) + return hi + (lo / float(0x10000)) def _tostr31(str): - return chr(len(str)) + str + '\0'*(31-len(str)) + return chr(len(str)) + str + '\0'*(31-len(str)) def _fromstr31(str31): - return str31[1:1+ord(str31[0])] + return str31[1:1+ord(str31[0])] SampleDescription = _MediaDescriptionCodec( 1, # May be longer, truncate diff --git a/Lib/plat-mac/Carbon/Menus.py b/Lib/plat-mac/Carbon/Menus.py index abdde79..01affb0 100644 --- a/Lib/plat-mac/Carbon/Menus.py +++ b/Lib/plat-mac/Carbon/Menus.py @@ -1,7 +1,7 @@ # Generated from 'Menus.h' def FOUR_CHAR_CODE(x): return x -noMark = 0 +noMark = 0 kMenuDrawMsg = 0 kMenuSizeMsg = 2 kMenuPopUpMsg = 3 @@ -15,7 +15,7 @@ mChooseMsg = 1 mDrawItemMsg = 4 kMenuChooseMsg = 1 kMenuDrawItemMsg = 4 -kThemeSavvyMenuResponse = 0x7473 +kThemeSavvyMenuResponse = 0x7473 kMenuInitMsg = 8 kMenuDisposeMsg = 9 kMenuFindItemMsg = 10 @@ -26,14 +26,14 @@ hMenuCmd = 27 hierMenu = -1 kInsertHierarchicalMenu = -1 mctAllItems = -98 -mctLastIDIndic = -99 +mctLastIDIndic = -99 kMenuStdMenuProc = 63 kMenuStdMenuBarProc = 63 kMenuNoModifiers = 0 kMenuShiftModifier = (1 << 0) kMenuOptionModifier = (1 << 1) kMenuControlModifier = (1 << 2) -kMenuNoCommandModifier = (1 << 3) +kMenuNoCommandModifier = (1 << 3) kMenuNoIcon = 0 kMenuIconType = 1 kMenuShrinkIconType = 2 @@ -43,7 +43,7 @@ kMenuIconSuiteType = 5 kMenuIconRefType = 6 kMenuCGImageRefType = 7 kMenuSystemIconSelectorType = 8 -kMenuIconResourceType = 9 +kMenuIconResourceType = 9 kMenuNullGlyph = 0x00 kMenuTabRightGlyph = 0x02 kMenuTabLeftGlyph = 0x03 @@ -101,7 +101,7 @@ kMenuF12Glyph = 0x7A kMenuF13Glyph = 0x87 kMenuF14Glyph = 0x88 kMenuF15Glyph = 0x89 -kMenuControlISOGlyph = 0x8A +kMenuControlISOGlyph = 0x8A kMenuAttrExcludesMarkColumn = (1 << 0) kMenuAttrAutoDisable = (1 << 2) kMenuAttrUsePencilGlyph = (1 << 3) @@ -147,14 +147,14 @@ kMenuItemDataIndent = (1 << 19) kMenuItemDataCmdVirtualKey = (1 << 20) kMenuItemDataAllDataVersionOne = 0x000FFFFF kMenuItemDataAllDataVersionTwo = kMenuItemDataAllDataVersionOne | kMenuItemDataCmdVirtualKey -kMenuDefProcPtr = 0 -kMenuPropertyPersistent = 0x00000001 +kMenuDefProcPtr = 0 +kMenuPropertyPersistent = 0x00000001 kHierarchicalFontMenuOption = 0x00000001 gestaltContextualMenuAttr = FOUR_CHAR_CODE('cmnu') gestaltContextualMenuUnusedBit = 0 gestaltContextualMenuTrapAvailable = 1 gestaltContextualMenuHasAttributeAndModifierKeys = 2 -gestaltContextualMenuHasUnicodeSupport = 3 +gestaltContextualMenuHasUnicodeSupport = 3 kCMHelpItemNoHelp = 0 kCMHelpItemAppleGuide = 1 kCMHelpItemOtherHelp = 2 diff --git a/Lib/plat-mac/Carbon/OSAconst.py b/Lib/plat-mac/Carbon/OSAconst.py index ccce00a..3b64c24 100644 --- a/Lib/plat-mac/Carbon/OSAconst.py +++ b/Lib/plat-mac/Carbon/OSAconst.py @@ -18,10 +18,10 @@ typeOSADialectInfo = FOUR_CHAR_CODE('difo') keyOSADialectName = FOUR_CHAR_CODE('dnam') keyOSADialectCode = FOUR_CHAR_CODE('dcod') keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd') -keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd') +keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd') kOSANullScript = 0L kOSANullMode = 0 -kOSAModeNull = 0 +kOSAModeNull = 0 kOSASupportsCompiling = 0x0002 kOSASupportsGetSource = 0x0004 kOSASupportsAECoercion = 0x0008 @@ -130,4 +130,4 @@ keyProcedureName = FOUR_CHAR_CODE('dfnm') keyStatementRange = FOUR_CHAR_CODE('dfsr') keyLocalsNames = FOUR_CHAR_CODE('dfln') keyGlobalsNames = FOUR_CHAR_CODE('dfgn') -keyParamsNames = FOUR_CHAR_CODE('dfpn') +keyParamsNames = FOUR_CHAR_CODE('dfpn') diff --git a/Lib/plat-mac/Carbon/Qt.py b/Lib/plat-mac/Carbon/Qt.py index 23d44d2..590a92a 100644 --- a/Lib/plat-mac/Carbon/Qt.py +++ b/Lib/plat-mac/Carbon/Qt.py @@ -3,4 +3,3 @@ try: _ = AddFilePreview except: raise ImportError, "Old (2.3) _Qt.so module loaded in stead of new (2.4) _Qt.so" -
\ No newline at end of file diff --git a/Lib/plat-mac/Carbon/QuickDraw.py b/Lib/plat-mac/Carbon/QuickDraw.py index 9209a35..65c2f9a 100644 --- a/Lib/plat-mac/Carbon/QuickDraw.py +++ b/Lib/plat-mac/Carbon/QuickDraw.py @@ -2,15 +2,15 @@ def FOUR_CHAR_CODE(x): return x -normal = 0 -bold = 1 -italic = 2 -underline = 4 -outline = 8 -shadow = 0x10 -condense = 0x20 -extend = 0x40 -invalColReq = -1 +normal = 0 +bold = 1 +italic = 2 +underline = 4 +outline = 8 +shadow = 0x10 +condense = 0x20 +extend = 0x40 +invalColReq = -1 srcCopy = 0 srcOr = 1 srcXor = 2 @@ -68,7 +68,7 @@ picRParen = 1 clutType = 0 fixedType = 1 directType = 2 -gdDevType = 0 +gdDevType = 0 interlacedDevice = 2 hwMirroredDevice = 4 roundedDevice = 5 @@ -85,7 +85,7 @@ hiliteBit = 7 pHiliteBit = 0 defQDColors = 127 RGBDirect = 16 -baseAddr32 = 4 +baseAddr32 = 4 sysPatListID = 0 iBeamCursor = 1 crossCursor = 2 @@ -125,7 +125,7 @@ k32ARGBPixelFormat = 0x00000020 k1IndexedGrayPixelFormat = 0x00000021 k2IndexedGrayPixelFormat = 0x00000022 k4IndexedGrayPixelFormat = 0x00000024 -k8IndexedGrayPixelFormat = 0x00000028 +k8IndexedGrayPixelFormat = 0x00000028 k16LE555PixelFormat = FOUR_CHAR_CODE('L555') k16LE5551PixelFormat = FOUR_CHAR_CODE('5551') k16BE565PixelFormat = FOUR_CHAR_CODE('B565') @@ -141,7 +141,7 @@ kYUV411PixelFormat = FOUR_CHAR_CODE('Y411') kYVYU422PixelFormat = FOUR_CHAR_CODE('YVYU') kUYVY422PixelFormat = FOUR_CHAR_CODE('UYVY') kYUV211PixelFormat = FOUR_CHAR_CODE('Y211') -k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy') +k2vuyPixelFormat = FOUR_CHAR_CODE('2vuy') kCursorImageMajorVersion = 0x0001 kCursorImageMinorVersion = 0x0000 kQDParseRegionFromTop = (1 << 0) @@ -157,7 +157,7 @@ colorXorXFer = 52 noiseXFer = 53 customXFer = 54 kXFer1PixelAtATime = 0x00000001 -kXFerConvertPixelToRGB32 = 0x00000002 +kXFerConvertPixelToRGB32 = 0x00000002 kCursorComponentsVersion = 0x00010001 kCursorComponentType = FOUR_CHAR_CODE('curs') cursorDoesAnimate = 1L << 0 @@ -179,20 +179,20 @@ kCursorComponentLastReserved = 0x0050 def FOUR_CHAR_CODE(x): return x -normal = 0 -bold = 1 -italic = 2 -underline = 4 -outline = 8 -shadow = 0x10 -condense = 0x20 -extend = 0x40 +normal = 0 +bold = 1 +italic = 2 +underline = 4 +outline = 8 +shadow = 0x10 +condense = 0x20 +extend = 0x40 leftCaret = 0 rightCaret = -1 -kHilite = 1 +kHilite = 1 smLeftCaret = 0 smRightCaret = -1 -smHilite = 1 +smHilite = 1 onlyStyleRun = 0 leftStyleRun = 1 rightStyleRun = 2 @@ -200,17 +200,17 @@ middleStyleRun = 3 smOnlyStyleRun = 0 smLeftStyleRun = 1 smRightStyleRun = 2 -smMiddleStyleRun = 3 +smMiddleStyleRun = 3 truncEnd = 0 truncMiddle = 0x4000 smTruncEnd = 0 -smTruncMiddle = 0x4000 +smTruncMiddle = 0x4000 notTruncated = 0 truncated = 1 truncErr = -1 smNotTruncated = 0 smTruncated = 1 -smTruncErr = -1 +smTruncErr = -1 smBreakWord = 0 smBreakChar = 1 smBreakOverflow = 2 diff --git a/Lib/plat-mac/Carbon/QuickTime.py b/Lib/plat-mac/Carbon/QuickTime.py index 6ab0304..8fba58c 100644 --- a/Lib/plat-mac/Carbon/QuickTime.py +++ b/Lib/plat-mac/Carbon/QuickTime.py @@ -118,7 +118,7 @@ dfDropShadow = 1 << 12 dfAntiAlias = 1 << 13 dfKeyedText = 1 << 14 dfInverseHilite = 1 << 15 -dfTextColorHilite = 1 << 16 +dfTextColorHilite = 1 << 16 searchTextDontGoToFoundTime = 1L << 16 searchTextDontHiliteFoundText = 1L << 17 searchTextOneTrackOnly = 1L << 18 @@ -144,7 +144,7 @@ kTextKeyEntry = 18 kTextMouseDown = 19 kTextTextBox = 20 kTextEditState = 21 -kTextLength = 22 +kTextLength = 22 k3DMediaRendererEntry = FOUR_CHAR_CODE('rend') k3DMediaRendererName = FOUR_CHAR_CODE('name') k3DMediaRendererCode = FOUR_CHAR_CODE('rcod') @@ -295,7 +295,7 @@ kActionListPasteFromXML = 13315 kActionListSetMatchingFromXML = 13316 kActionListSetFromURL = 13317 kActionListExchangeLists = 13318 -kActionListServerQuery = 13319 +kActionListServerQuery = 13319 kOperandExpression = 1 kOperandConstant = 2 kOperandSubscribedToChannel = 3 @@ -430,7 +430,7 @@ kOperandFlashTrackVariable = 9216 kOperandStringLength = 10240 kOperandStringCompare = 10241 kOperandStringSubString = 10242 -kOperandStringConcat = 10243 +kOperandStringConcat = 10243 kFirstMovieAction = kActionMovieSetVolume kLastMovieAction = kActionMovieSetScale kFirstTrackAction = kActionTrackSetVolume @@ -477,7 +477,7 @@ kTargetSpriteName = FOUR_CHAR_CODE('spna') kTargetSpriteID = FOUR_CHAR_CODE('spid') kTargetSpriteIndex = FOUR_CHAR_CODE('spin') kTargetQD3DNamedObjectName = FOUR_CHAR_CODE('nana') -kTargetCurrentQTEventParams = FOUR_CHAR_CODE('evpa') +kTargetCurrentQTEventParams = FOUR_CHAR_CODE('evpa') kQTEventType = FOUR_CHAR_CODE('evnt') kAction = FOUR_CHAR_CODE('actn') kWhichAction = FOUR_CHAR_CODE('whic') @@ -508,7 +508,7 @@ kQTEventKey = FOUR_CHAR_CODE('key ') kQTEventMovieLoaded = FOUR_CHAR_CODE('load') kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') kQTEventListReceived = FOUR_CHAR_CODE('list') -kQTEventKeyUp = FOUR_CHAR_CODE('keyU') +kQTEventKeyUp = FOUR_CHAR_CODE('keyU') kActionFlagActionIsDelta = 1L << 1 kActionFlagParameterWrapsAround = 1L << 2 kActionFlagActionIsToggle = 1L << 3 @@ -574,12 +574,12 @@ callBackAtInterrupt = 0x8000 callBackAtDeferredTask = 0x4000 qtcbNeedsRateChanges = 1 qtcbNeedsTimeChanges = 2 -qtcbNeedsStartStopChanges = 4 +qtcbNeedsStartStopChanges = 4 keepInRam = 1 << 0 unkeepInRam = 1 << 1 flushFromRam = 1 << 2 loadForwardTrackEdits = 1 << 3 -loadBackwardTrackEdits = 1 << 4 +loadBackwardTrackEdits = 1 << 4 newMovieActive = 1 << 0 newMovieDontResolveDataRefs = 1 << 1 newMovieDontAskUnresolvedDataRefs = 1 << 2 @@ -593,7 +593,7 @@ trackUsageInMovie = 1 << 1 trackUsageInPreview = 1 << 2 trackUsageInPoster = 1 << 3 mediaSampleNotSync = 1 << 0 -mediaSampleShadowSync = 1 << 1 +mediaSampleShadowSync = 1 << 1 pasteInParallel = 1 << 0 showUserSettingsDialog = 1 << 1 movieToFileOnlyExport = 1 << 2 @@ -615,17 +615,17 @@ flattenDontInterleaveFlatten = 1L << 3 flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 flattenCompressMovieResource = 1L << 5 flattenForceMovieResourceBeforeMovieData = 1L << 6 -movieInDataForkResID = -1 +movieInDataForkResID = -1 mcTopLeftMovie = 1 << 0 mcScaleMovieToFit = 1 << 1 mcWithBadge = 1 << 2 mcNotVisible = 1 << 3 -mcWithFrame = 1 << 4 +mcWithFrame = 1 << 4 movieScrapDontZeroScrap = 1 << 0 movieScrapOnlyPutMovie = 1 << 1 dataRefSelfReference = 1 << 0 dataRefWasNotResolved = 1 << 1 -kMovieAnchorDataRefIsDefault = 1 << 0 +kMovieAnchorDataRefIsDefault = 1 << 0 hintsScrubMode = 1 << 0 hintsLoop = 1 << 1 hintsDontPurge = 1 << 2 @@ -667,11 +667,11 @@ kGetMovieImporterValidateToFind = 1L << 0 kGetMovieImporterAllowNewFile = 1L << 1 kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 -kGetMovieImporterAutoImportOnly = 1L << 10 +kGetMovieImporterAutoImportOnly = 1L << 10 kQTGetMIMETypeInfoIsQuickTimeMovieType = FOUR_CHAR_CODE('moov') -kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb') +kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb') kQTCopyUserDataReplace = FOUR_CHAR_CODE('rplc') -kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg') +kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg') kMovieLoadStateError = -1L kMovieLoadStateLoading = 1000 kMovieLoadStateLoaded = 2000 @@ -682,7 +682,7 @@ kQTDontUseDataToFindImporter = 1L << 0 kQTDontLookForMovieImporterIfGraphicsImporterFound = 1L << 1 kQTAllowOpeningStillImagesAsMovies = 1L << 2 kQTAllowImportersThatWouldCreateNewFile = 1L << 3 -kQTAllowAggressiveImporters = 1L << 4 +kQTAllowAggressiveImporters = 1L << 4 preloadAlways = 1L << 0 preloadOnlyIfEnabled = 1L << 1 fullScreenHideCursor = 1L << 0 @@ -693,13 +693,13 @@ movieExecuteWiredActionDontExecute = 1L << 0 kRefConNavigationNext = 0 kRefConNavigationPrevious = 1 kRefConPropertyCanHaveFocus = 1 -kRefConPropertyHasFocus = 2 +kRefConPropertyHasFocus = 2 kTrackFocusCanEditFlag = FOUR_CHAR_CODE('kedt') kTrackDefaultFocusFlags = FOUR_CHAR_CODE('kfoc') kTrackFocusDefaultRefcon = FOUR_CHAR_CODE('kref') kTrackFocusOn = 1 -kTrackHandlesTabs = 2 -kFlashTrackPropertyAcceptAllClicks = FOUR_CHAR_CODE('clik') +kTrackHandlesTabs = 2 +kFlashTrackPropertyAcceptAllClicks = FOUR_CHAR_CODE('clik') kBackgroundSpriteLayerNum = 32767 kSpritePropertyMatrix = 1 kSpritePropertyImageDescription = 2 @@ -746,7 +746,7 @@ kTweenRecordNoFlags = 0 kTweenRecordIsAtInterruptTime = 0x00000001 kEffectNameAtom = FOUR_CHAR_CODE('name') kEffectTypeAtom = FOUR_CHAR_CODE('type') -kEffectManufacturerAtom = FOUR_CHAR_CODE('manu') +kEffectManufacturerAtom = FOUR_CHAR_CODE('manu') pdActionConfirmDialog = 1 pdActionSetAppleMenu = 2 pdActionSetEditMenu = 3 @@ -781,20 +781,20 @@ pdActionCustomSetEditCallout = 31 pdActionCustomGetEnableValue = 32 pdActionCustomSetSampleTime = 33 pdActionCustomGetValue = 34 -pdActionCustomDoEditCommand = 35 +pdActionCustomDoEditCommand = 35 pdSampleTimeDisplayOptionsNone = 0x00000000 pdActionFocusOff = 0 pdActionFocusFirst = 1 pdActionFocusLast = 2 pdActionFocusForward = 3 -pdActionFocusBackward = 4 -elOptionsIncludeNoneInList = 0x00000001 +pdActionFocusBackward = 4 +elOptionsIncludeNoneInList = 0x00000001 pdOptionsCollectOneValue = 0x00000001 pdOptionsAllowOptionalInterpolations = 0x00000002 pdOptionsModalDialogBox = 0x00000004 pdOptionsEditCurrentEffectOnly = 0x00000008 -pdOptionsHidePreview = 0x00000010 -effectIsRealtime = 0 +pdOptionsHidePreview = 0x00000010 +effectIsRealtime = 0 kAccessKeyAtomType = FOUR_CHAR_CODE('acky') kAccessKeySystemFlag = 1L << 0 ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') @@ -818,14 +818,14 @@ kQTParseTextHREFBaseURL = FOUR_CHAR_CODE('burl') kQTParseTextHREFClickPoint = FOUR_CHAR_CODE('clik') kQTParseTextHREFUseAltDelim = FOUR_CHAR_CODE('altd') kQTParseTextHREFDelimiter = FOUR_CHAR_CODE('delm') -kQTParseTextHREFRecomposeHREF = FOUR_CHAR_CODE('rhrf') +kQTParseTextHREFRecomposeHREF = FOUR_CHAR_CODE('rhrf') kQTParseTextHREFURL = FOUR_CHAR_CODE('url ') kQTParseTextHREFTarget = FOUR_CHAR_CODE('targ') kQTParseTextHREFChapter = FOUR_CHAR_CODE('chap') kQTParseTextHREFIsAutoHREF = FOUR_CHAR_CODE('auto') kQTParseTextHREFIsServerMap = FOUR_CHAR_CODE('smap') kQTParseTextHREFHREF = FOUR_CHAR_CODE('href') -kQTParseTextHREFEMBEDArgs = FOUR_CHAR_CODE('mbed') +kQTParseTextHREFEMBEDArgs = FOUR_CHAR_CODE('mbed') kTrackReferenceChapterList = FOUR_CHAR_CODE('chap') kTrackReferenceTimeCode = FOUR_CHAR_CODE('tmcd') kTrackReferenceModifier = FOUR_CHAR_CODE('ssrc') @@ -920,16 +920,16 @@ kQTRestrictionEditDontCut = (1L << 1) kQTRestrictionEditDontPaste = (1L << 2) kQTRestrictionEditDontClear = (1L << 3) kQTRestrictionEditDontModify = (1L << 4) -kQTRestrictionEditDontExtract = (1L << 5) +kQTRestrictionEditDontExtract = (1L << 5) videoFlagDontLeanAhead = 1L << 0 txtProcDefaultDisplay = 0 txtProcDontDisplay = 1 -txtProcDoDisplay = 2 +txtProcDoDisplay = 2 findTextEdgeOK = 1 << 0 findTextCaseSensitive = 1 << 1 findTextReverseSearch = 1 << 2 findTextWrapAround = 1 << 3 -findTextUseOffset = 1 << 4 +findTextUseOffset = 1 << 4 dropShadowOffsetType = FOUR_CHAR_CODE('drpo') dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') spriteHitTestBounds = 1L << 0 @@ -937,7 +937,7 @@ spriteHitTestImage = 1L << 1 spriteHitTestInvisibleSprites = 1L << 2 spriteHitTestIsClick = 1L << 3 spriteHitTestLocInDisplayCoordinates = 1L << 4 -spriteHitTestTreatAllSpritesAsHitTestable = 1L << 5 +spriteHitTestTreatAllSpritesAsHitTestable = 1L << 5 kSpriteAtomType = FOUR_CHAR_CODE('sprt') kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') kSpriteImageAtomType = FOUR_CHAR_CODE('imag') @@ -974,7 +974,7 @@ kMovieMediaRegionAtom = FOUR_CHAR_CODE('regi') kMovieMediaSlaveTrackDuration = FOUR_CHAR_CODE('sltr') kMovieMediaEnableFrameStepping = FOUR_CHAR_CODE('enfs') kMovieMediaBackgroundColor = FOUR_CHAR_CODE('bkcl') -kMovieMediaPrerollTime = FOUR_CHAR_CODE('prer') +kMovieMediaPrerollTime = FOUR_CHAR_CODE('prer') kMovieMediaFitNone = 0 kMovieMediaFitScroll = FOUR_CHAR_CODE('scro') kMovieMediaFitClipIfNecessary = FOUR_CHAR_CODE('hidd') @@ -992,9 +992,9 @@ kMoviePropertyTimeScale = FOUR_CHAR_CODE('tims') kMoviePropertyTime = FOUR_CHAR_CODE('timv') kMoviePropertyNaturalBounds = FOUR_CHAR_CODE('natb') kMoviePropertyMatrix = FOUR_CHAR_CODE('mtrx') -kMoviePropertyTrackList = FOUR_CHAR_CODE('tlst') +kMoviePropertyTrackList = FOUR_CHAR_CODE('tlst') kTrackPropertyMediaType = FOUR_CHAR_CODE('mtyp') -kTrackPropertyInstantiation = FOUR_CHAR_CODE('inst') +kTrackPropertyInstantiation = FOUR_CHAR_CODE('inst') MovieControllerComponentType = FOUR_CHAR_CODE('play') kMovieControllerQTVRFlag = 1 << 0 kMovieControllerDontDisplayToUser = 1 << 1 @@ -1074,7 +1074,7 @@ mcActionAppMessageReceived = 85 mcActionEvaluateExpressionWithType = 89 mcActionGetMovieName = 90 mcActionGetMovieID = 91 -mcActionGetMovieActive = 92 +mcActionGetMovieActive = 92 mcFlagSuppressMovieFrame = 1 << 0 mcFlagSuppressStepButtons = 1 << 1 mcFlagSuppressSpeakerButton = 1 << 2 @@ -1114,7 +1114,7 @@ kQTAppMessageSoftwareChanged = 1 kQTAppMessageWindowCloseRequested = 3 kQTAppMessageExitFullScreenRequested = 4 kQTAppMessageDisplayChannels = 5 -kQTAppMessageEnterFullScreenRequested = 6 +kQTAppMessageEnterFullScreenRequested = 6 kFetchAsBooleanPtr = 1 kFetchAsShortPtr = 2 kFetchAsLongPtr = 3 @@ -1324,7 +1324,7 @@ k4444YpCbCrA8CodecType = FOUR_CHAR_CODE('v408') k422YpCbCr16CodecType = FOUR_CHAR_CODE('v216') k422YpCbCr10CodecType = FOUR_CHAR_CODE('v210') k444YpCbCr10CodecType = FOUR_CHAR_CODE('v410') -k4444YpCbCrA8RCodecType = FOUR_CHAR_CODE('r408') +k4444YpCbCrA8RCodecType = FOUR_CHAR_CODE('r408') kBlurImageFilterType = FOUR_CHAR_CODE('blur') kSharpenImageFilterType = FOUR_CHAR_CODE('shrp') kEdgeDetectImageFilterType = FOUR_CHAR_CODE('edge') @@ -1359,10 +1359,10 @@ k64ARGBPixelFormat = FOUR_CHAR_CODE('b64a') k48RGBPixelFormat = FOUR_CHAR_CODE('b48r') k32AlphaGrayPixelFormat = FOUR_CHAR_CODE('b32a') k16GrayPixelFormat = FOUR_CHAR_CODE('b16g') -k422YpCbCr8PixelFormat = FOUR_CHAR_CODE('2vuy') +k422YpCbCr8PixelFormat = FOUR_CHAR_CODE('2vuy') k4444YpCbCrA8PixelFormat = FOUR_CHAR_CODE('v408') -k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408') -kYUV420PixelFormat = FOUR_CHAR_CODE('y420') +k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408') +kYUV420PixelFormat = FOUR_CHAR_CODE('y420') codecInfoDoes1 = (1L << 0) codecInfoDoes2 = (1L << 1) codecInfoDoes4 = (1L << 2) @@ -1386,7 +1386,7 @@ codecInfoDoesBlend = (1L << 19) codecInfoDoesWarp = (1L << 20) codecInfoDoesRecompress = (1L << 21) codecInfoDoesSpool = (1L << 22) -codecInfoDoesRateConstrain = (1L << 23) +codecInfoDoesRateConstrain = (1L << 23) codecInfoDepth1 = (1L << 0) codecInfoDepth2 = (1L << 1) codecInfoDepth4 = (1L << 2) @@ -1400,7 +1400,7 @@ codecInfoDepth36 = (1L << 9) codecInfoDepth40 = (1L << 10) codecInfoStoresClut = (1L << 11) codecInfoDoesLossless = (1L << 12) -codecInfoSequenceSensitive = (1L << 13) +codecInfoSequenceSensitive = (1L << 13) codecFlagUseImageBuffer = (1L << 0) codecFlagUseScreenBuffer = (1L << 1) codecFlagUpdatePrevious = (1L << 2) @@ -1416,7 +1416,7 @@ codecFlagDontUseNewImageBuffer = (1L << 10) codecFlagInterlaceUpdate = (1L << 11) codecFlagCatchUpDiff = (1L << 12) codecFlagSupportDisable = (1L << 13) -codecFlagReenable = (1L << 14) +codecFlagReenable = (1L << 14) codecFlagOutUpdateOnNextIdle = (1L << 9) codecFlagOutUpdateOnDataSourceChange = (1L << 10) codecFlagSequenceSensitive = (1L << 11) @@ -1426,21 +1426,21 @@ codecFlagUsedNewImageBuffer = (1L << 14) codecFlagUsedImageBuffer = (1L << 15) codecMinimumDataSize = 32768L compressorComponentType = FOUR_CHAR_CODE('imco') -decompressorComponentType = FOUR_CHAR_CODE('imdc') +decompressorComponentType = FOUR_CHAR_CODE('imdc') codecLosslessQuality = 0x00000400 codecMaxQuality = 0x000003FF codecMinQuality = 0x00000000 codecLowQuality = 0x00000100 codecNormalQuality = 0x00000200 codecHighQuality = 0x00000300 -codecLockBitsShieldCursor = (1 << 0) +codecLockBitsShieldCursor = (1 << 0) codecCompletionSource = (1 << 0) codecCompletionDest = (1 << 1) codecCompletionDontUnshield = (1 << 2) codecCompletionWentOffscreen = (1 << 3) codecCompletionUnlockBits = (1 << 4) codecCompletionForceChainFlush = (1 << 5) -codecCompletionDropped = (1 << 6) +codecCompletionDropped = (1 << 6) codecProgressOpen = 0 codecProgressUpdatePercent = 1 codecProgressClose = 2 @@ -1473,14 +1473,14 @@ codecDSequenceFlushInsteadOfDirtying = (1L << 8) codecDSequenceEnableSubPixelPositioning = (1L << 9) kICMSequenceTaskWeight = FOUR_CHAR_CODE('twei') kICMSequenceTaskName = FOUR_CHAR_CODE('tnam') -kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt') +kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt') kImageDescriptionSampleFormat = FOUR_CHAR_CODE('idfm') kImageDescriptionClassicAtomFormat = FOUR_CHAR_CODE('atom') kImageDescriptionQTAtomFormat = FOUR_CHAR_CODE('qtat') kImageDescriptionEffectDataFormat = FOUR_CHAR_CODE('fxat') kImageDescriptionPrivateDataFormat = FOUR_CHAR_CODE('priv') kImageDescriptionAlternateCodec = FOUR_CHAR_CODE('subs') -kImageDescriptionColorSpace = FOUR_CHAR_CODE('cspc') +kImageDescriptionColorSpace = FOUR_CHAR_CODE('cspc') sfpItemPreviewAreaUser = 11 sfpItemPreviewStaticText = 12 sfpItemPreviewDividerUser = 13 @@ -1500,14 +1500,14 @@ kICMTempThenAppMemory = 1L << 12 kICMAppThenTempMemory = 1L << 13 kQTUsePlatformDefaultGammaLevel = 0 kQTUseSourceGammaLevel = -1L -kQTCCIR601VideoGammaLevel = 0x00023333 +kQTCCIR601VideoGammaLevel = 0x00023333 identityMatrixType = 0x00 translateMatrixType = 0x01 scaleMatrixType = 0x02 scaleTranslateMatrixType = 0x03 linearMatrixType = 0x04 linearTranslateMatrixType = 0x05 -perspectiveMatrixType = 0x06 +perspectiveMatrixType = 0x06 GraphicsImporterComponentType = FOUR_CHAR_CODE('grip') graphicsImporterUsesImageDecompressor = 1L << 23 quickTimeImageFileImageDescriptionAtom = FOUR_CHAR_CODE('idsc') @@ -1530,12 +1530,12 @@ kQTPhotoshopLayerOpacity = FOUR_CHAR_CODE('lopa') kQTPhotoshopLayerClipping = FOUR_CHAR_CODE('lclp') kQTPhotoshopLayerFlags = FOUR_CHAR_CODE('lflg') kQTPhotoshopLayerName = FOUR_CHAR_CODE('\xa9lnm') -kQTPhotoshopLayerUnicodeName = FOUR_CHAR_CODE('luni') +kQTPhotoshopLayerUnicodeName = FOUR_CHAR_CODE('luni') kQTIndexedImageType = FOUR_CHAR_CODE('nth?') kQTIndexedImageIsThumbnail = FOUR_CHAR_CODE('n=th') kQTIndexedImageIsLayer = FOUR_CHAR_CODE('n=ly') kQTIndexedImageIsPage = FOUR_CHAR_CODE('n=pg') -kQTIndexedImageIsMultiResolution = FOUR_CHAR_CODE('n=rs') +kQTIndexedImageIsMultiResolution = FOUR_CHAR_CODE('n=rs') kQTTIFFUserDataPrefix = 0x74690000 kQTTIFFExifUserDataPrefix = 0x65780000 kQTTIFFExifGPSUserDataPrefix = 0x67700000 @@ -1548,14 +1548,14 @@ kQTTIFFUserDataWhitePoint = 0x7469013E kQTTIFFUserDataPrimaryChromaticities = 0x7469013F kQTTIFFUserDataTransferRange = 0x74690156 kQTTIFFUserDataYCbCrPositioning = 0x74690213 -kQTTIFFUserDataReferenceBlackWhite = 0x74690214 +kQTTIFFUserDataReferenceBlackWhite = 0x74690214 kQTTIFFUserDataModelPixelScale = 0x7469830E kQTTIFFUserDataModelTransformation = 0x746985D8 kQTTIFFUserDataModelTiepoint = 0x74698482 kQTTIFFUserDataGeoKeyDirectory = 0x746987AF kQTTIFFUserDataGeoDoubleParams = 0x746987B0 kQTTIFFUserDataGeoAsciiParams = 0x746987B1 -kQTTIFFUserDataIntergraphMatrix = 0x74698480 +kQTTIFFUserDataIntergraphMatrix = 0x74698480 kQTExifUserDataExifVersion = 0x65789000 kQTExifUserDataFlashPixVersion = 0x6578A000 kQTExifUserDataColorSpace = 0x6578A001 @@ -1594,7 +1594,7 @@ kQTExifUserDataSubjectLocation = 0x6578A214 kQTExifUserDataExposureIndex = 0x6578A215 kQTExifUserDataSensingMethod = 0x6578A217 kQTExifUserDataFileSource = 0x6578A300 -kQTExifUserDataSceneType = 0x6578A301 +kQTExifUserDataSceneType = 0x6578A301 kQTExifUserDataGPSVersionID = 0x06770000 kQTExifUserDataGPSLatitudeRef = 0x06770001 kQTExifUserDataGPSLatitude = 0x06770002 @@ -1621,7 +1621,7 @@ kQTExifUserDataGPSDestLongitude = 0x06770016 kQTExifUserDataGPSDestBearingRef = 0x06770017 kQTExifUserDataGPSDestBearing = 0x06770018 kQTExifUserDataGPSDestDistanceRef = 0x06770019 -kQTExifUserDataGPSDestDistance = 0x0677001A +kQTExifUserDataGPSDestDistance = 0x0677001A GraphicsExporterComponentType = FOUR_CHAR_CODE('grex') kBaseGraphicsExporterSubType = FOUR_CHAR_CODE('base') graphicsExporterIsBaseExporter = 1L << 0 @@ -1638,7 +1638,7 @@ kQTMetaData = FOUR_CHAR_CODE('meta') kQTTIFFCompressionMethod = FOUR_CHAR_CODE('tifc') kQTTIFFCompression_None = 1 kQTTIFFCompression_PackBits = 32773L -kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife') +kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife') kQTPNGFilterPreference = FOUR_CHAR_CODE('pngf') kQTPNGFilterBestForColorType = FOUR_CHAR_CODE('bflt') kQTPNGFilterNone = 0 @@ -1795,10 +1795,10 @@ clockComponentType = FOUR_CHAR_CODE('clok') systemTickClock = FOUR_CHAR_CODE('tick') systemSecondClock = FOUR_CHAR_CODE('seco') systemMillisecondClock = FOUR_CHAR_CODE('mill') -systemMicrosecondClock = FOUR_CHAR_CODE('micr') +systemMicrosecondClock = FOUR_CHAR_CODE('micr') kClockRateIsLinear = 1 kClockImplementsCallBacks = 2 -kClockCanHandleIntermittentSound = 4 +kClockCanHandleIntermittentSound = 4 StandardCompressionType = FOUR_CHAR_CODE('scdi') StandardCompressionSubType = FOUR_CHAR_CODE('imag') StandardCompressionSubTypeSound = FOUR_CHAR_CODE('soun') @@ -1861,21 +1861,21 @@ scCodecManufacturerType = FOUR_CHAR_CODE('cmfr') scSoundVBRCompressionOK = FOUR_CHAR_CODE('cvbr') scSoundInputSampleRateType = FOUR_CHAR_CODE('ssir') scSoundSampleRateChangeOK = FOUR_CHAR_CODE('rcok') -scAvailableCompressionListType = FOUR_CHAR_CODE('avai') +scAvailableCompressionListType = FOUR_CHAR_CODE('avai') scGetCompression = 1 scShowMotionSettings = 1L << 0 scSettingsChangedItem = -1 scCompressFlagIgnoreIdenticalFrames = 1 kQTSettingsVideo = FOUR_CHAR_CODE('vide') kQTSettingsSound = FOUR_CHAR_CODE('soun') -kQTSettingsComponentVersion = FOUR_CHAR_CODE('vers') +kQTSettingsComponentVersion = FOUR_CHAR_CODE('vers') TweenComponentType = FOUR_CHAR_CODE('twen') TCSourceRefNameType = FOUR_CHAR_CODE('name') tcDropFrame = 1 << 0 tc24HourMax = 1 << 1 tcNegTimesOK = 1 << 2 tcCounter = 1 << 3 -tctNegFlag = 0x80 +tctNegFlag = 0x80 tcdfShowTimeCode = 1 << 0 MovieImportType = FOUR_CHAR_CODE('eat ') MovieExportType = FOUR_CHAR_CODE('spit') @@ -1938,7 +1938,7 @@ kQTMediaConfigUseAppByDefault = (1L << 28) kQTMediaConfigUsePluginByDefault = (1L << 29) kQTMediaConfigDefaultsMask = (kQTMediaConfigUseAppByDefault | kQTMediaConfigUsePluginByDefault) kQTMediaConfigDefaultsShift = 12 -kQTMediaConfigHasFileHasQTAtoms = (1L << 30) +kQTMediaConfigHasFileHasQTAtoms = (1L << 30) kQTMediaConfigStreamGroupID = FOUR_CHAR_CODE('strm') kQTMediaConfigInteractiveGroupID = FOUR_CHAR_CODE('intr') kQTMediaConfigVideoGroupID = FOUR_CHAR_CODE('eyes') @@ -1950,7 +1950,7 @@ kQTMediaConfigMiscGroupID = FOUR_CHAR_CODE('misc') kQTMediaInfoNetGroup = FOUR_CHAR_CODE('net ') kQTMediaInfoWinGroup = FOUR_CHAR_CODE('win ') kQTMediaInfoMacGroup = FOUR_CHAR_CODE('mac ') -kQTMediaInfoMiscGroup = 0x3F3F3F3F +kQTMediaInfoMiscGroup = 0x3F3F3F3F kMimeInfoMimeTypeTag = FOUR_CHAR_CODE('mime') kMimeInfoFileExtensionTag = FOUR_CHAR_CODE('ext ') kMimeInfoDescriptionTag = FOUR_CHAR_CODE('desc') @@ -2008,7 +2008,7 @@ kQTSettingsTime = FOUR_CHAR_CODE('time') kQTSettingsTimeDuration = FOUR_CHAR_CODE('dura') kQTSettingsAudioCDTrack = FOUR_CHAR_CODE('trak') kQTSettingsAudioCDTrackRateShift = FOUR_CHAR_CODE('rshf') -kQTSettingsDVExportDVFormat = FOUR_CHAR_CODE('dvcf') +kQTSettingsDVExportDVFormat = FOUR_CHAR_CODE('dvcf') kQTPresetsListResourceType = FOUR_CHAR_CODE('stg#') kQTPresetsPlatformListResourceType = FOUR_CHAR_CODE('stgp') kQTPresetInfoIsDivider = 1 @@ -2021,9 +2021,9 @@ movieExportWidth = FOUR_CHAR_CODE('wdth') movieExportHeight = FOUR_CHAR_CODE('hegt') movieExportDuration = FOUR_CHAR_CODE('dura') movieExportVideoFilter = FOUR_CHAR_CODE('iflt') -movieExportTimeScale = FOUR_CHAR_CODE('tmsc') -kQTBrowserInfoCanUseSystemFolderPlugin = (1L << 0) -kQTPreFlightOpenComponent = (1L << 1) +movieExportTimeScale = FOUR_CHAR_CODE('tmsc') +kQTBrowserInfoCanUseSystemFolderPlugin = (1L << 0) +kQTPreFlightOpenComponent = (1L << 1) pnotComponentWantsEvents = 1 pnotComponentNeedsNoCache = 2 ShowFilePreviewComponentType = FOUR_CHAR_CODE('pnot') @@ -2047,29 +2047,29 @@ kDataRefExtensionMacOSFileType = FOUR_CHAR_CODE('ftyp') kDataRefExtensionInitializationData = FOUR_CHAR_CODE('data') kDataRefExtensionQuickTimeMediaType = FOUR_CHAR_CODE('mtyp') kDataHChokeToMovieDataRate = 1 << 0 -kDataHChokeToParam = 1 << 1 +kDataHChokeToParam = 1 << 1 kDataHExtendedSchedule = FOUR_CHAR_CODE('xtnd') kDataHInfoFlagNeverStreams = 1 << 0 kDataHInfoFlagCanUpdateDataRefs = 1 << 1 -kDataHInfoFlagNeedsNetworkBandwidth = 1 << 2 +kDataHInfoFlagNeedsNetworkBandwidth = 1 << 2 kDataHFileTypeMacOSFileType = FOUR_CHAR_CODE('ftyp') kDataHFileTypeExtension = FOUR_CHAR_CODE('fext') kDataHFileTypeMIME = FOUR_CHAR_CODE('mime') kDataHCreateFileButDontCreateResFile = (1L << 0) -kDataHMovieUsageDoAppendMDAT = 1L << 0 +kDataHMovieUsageDoAppendMDAT = 1L << 0 kDataHTempUseSameDirectory = 1L << 0 kDataHTempUseSameVolume = 1L << 1 kDataHTempCreateFile = 1L << 2 -kDataHTempOpenFile = 1L << 3 -kDataHGetDataRateInfiniteRate = 0x7FFFFFFF -kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0 +kDataHTempOpenFile = 1L << 3 +kDataHGetDataRateInfiniteRate = 0x7FFFFFFF +kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0 videoDigitizerComponentType = FOUR_CHAR_CODE('vdig') vdigInterfaceRev = 2 ntscIn = 0 currentIn = 0 palIn = 1 secamIn = 2 -ntscReallyIn = 3 +ntscReallyIn = 3 compositeIn = 0 sVideoIn = 1 rgbComponentIn = 2 @@ -2081,16 +2081,16 @@ sdiIn = 7 vdPlayThruOff = 0 vdPlayThruOn = 1 vdDigitizerBW = 0 -vdDigitizerRGB = 1 +vdDigitizerRGB = 1 vdBroadcastMode = 0 -vdVTRMode = 1 +vdVTRMode = 1 vdUseAnyField = 0 vdUseOddField = 1 -vdUseEvenField = 2 +vdUseEvenField = 2 vdTypeBasic = 0 vdTypeAlpha = 1 vdTypeMask = 2 -vdTypeKey = 3 +vdTypeKey = 3 digiInDoesNTSC = 1L << 0 digiInDoesPAL = 1L << 1 digiInDoesSECAM = 1L << 2 @@ -2101,7 +2101,7 @@ digiInDoesComponent = 1L << 10 digiInVTR_Broadcast = 1L << 11 digiInDoesColor = 1L << 12 digiInDoesBW = 1L << 13 -digiInSignalLock = 1L << 31 +digiInSignalLock = 1L << 31 digiOutDoes1 = 1L << 0 digiOutDoes2 = 1L << 1 digiOutDoes4 = 1L << 2 @@ -2132,7 +2132,7 @@ digiOutDoesCompress = 1L << 27 digiOutDoesCompressOnly = 1L << 28 digiOutDoesPlayThruDuringCompress = 1L << 29 digiOutDoesCompressPartiallyVisible = 1L << 30 -digiOutDoesNotNeedCopyOfCompressData = 1L << 31 +digiOutDoesNotNeedCopyOfCompressData = 1L << 31 dmaDepth1 = 1 dmaDepth2 = 2 dmaDepth4 = 4 @@ -2144,7 +2144,7 @@ dmaDepth4Gray = 128 dmaDepth8Gray = 256 kVDIGControlledFrameRate = -1 vdDeviceFlagShowInputsAsDevices = (1 << 0) -vdDeviceFlagHideDevice = (1 << 1) +vdDeviceFlagHideDevice = (1 << 1) vdFlagCaptureStarting = (1 << 0) vdFlagCaptureStopping = (1 << 1) vdFlagCaptureIsForPreview = (1 << 2) @@ -2152,7 +2152,7 @@ vdFlagCaptureIsForRecord = (1 << 3) vdFlagCaptureLowLatency = (1 << 4) vdFlagCaptureAlwaysUseTimeBase = (1 << 5) vdFlagCaptureSetSettingsBegin = (1 << 6) -vdFlagCaptureSetSettingsEnd = (1 << 7) +vdFlagCaptureSetSettingsEnd = (1 << 7) xmlParseComponentType = FOUR_CHAR_CODE('pars') xmlParseComponentSubType = FOUR_CHAR_CODE('xml ') xmlIdentifierInvalid = 0 @@ -2164,7 +2164,7 @@ elementFlagAlwaysSelfContained = 1L << 0 elementFlagPreserveWhiteSpace = 1L << 1 xmlParseFlagAllowUppercase = 1L << 0 xmlParseFlagAllowUnquotedAttributeValues = 1L << 1 -xmlParseFlagEventParseOnly = 1L << 2 +xmlParseFlagEventParseOnly = 1L << 2 attributeValueKindCharString = 0 attributeValueKindInteger = 1L << 0 attributeValueKindPercent = 1L << 1 @@ -2195,7 +2195,7 @@ seqGrabRecord = 1 seqGrabPreview = 2 seqGrabPlayDuringRecord = 4 seqGrabLowLatencyCapture = 8 -seqGrabAlwaysUseTimeBase = 16 +seqGrabAlwaysUseTimeBase = 16 seqGrabHasBounds = 1 seqGrabHasVolume = 2 seqGrabHasDiscreteSamples = 4 @@ -2227,9 +2227,9 @@ channelPlayFast = 1 channelPlayHighQuality = 2 channelPlayAllData = 4 sgSetSettingsBegin = (1 << 0) -sgSetSettingsEnd = (1 << 1) +sgSetSettingsEnd = (1 << 1) kSGSmallestDITLSize = -1 -kSGLargestDITLSize = -2 +kSGLargestDITLSize = -2 sgChannelAtom = FOUR_CHAR_CODE('chan') sgChannelSettingsAtom = FOUR_CHAR_CODE('ctom') sgChannelDescription = FOUR_CHAR_CODE('cdsc') @@ -2277,7 +2277,7 @@ kQTVOName = FOUR_CHAR_CODE('name') kQTVODecompressors = FOUR_CHAR_CODE('deco') kQTVODecompressorType = FOUR_CHAR_CODE('dety') kQTVODecompressorContinuous = FOUR_CHAR_CODE('cont') -kQTVODecompressorComponent = FOUR_CHAR_CODE('cmpt') +kQTVODecompressorComponent = FOUR_CHAR_CODE('cmpt') kClockGetTimeSelect = 0x0001 kClockNewCallBackSelect = 0x0002 kClockDisposeCallBackSelect = 0x0003 @@ -2804,7 +2804,7 @@ forceUpdateNewBuffer = 1 << 1 mHitTestBounds = 1L << 0 mHitTestImage = 1L << 1 mHitTestInvisible = 1L << 2 -mHitTestIsClick = 1L << 3 +mHitTestIsClick = 1L << 3 mOpaque = 1L << 0 mInvisible = 1L << 1 kMediaQTIdleFrequencySelector = FOUR_CHAR_CODE('idfq') @@ -2815,7 +2815,7 @@ kMediaVideoParamSharpness = 4 kMediaVideoParamSaturation = 5 kMediaVideoParamBlackLevel = 6 kMediaVideoParamWhiteLevel = 7 -kMHInfoEncodedFrameRate = FOUR_CHAR_CODE('orat') +kMHInfoEncodedFrameRate = FOUR_CHAR_CODE('orat') kEmptyPurgableChunksOverAllowance = 1 kCallComponentExecuteWiredActionSelect = -9 kMediaSetChunkManagementFlagsSelect = 0x0415 @@ -2937,7 +2937,7 @@ kaiLibraryDescType = FOUR_CHAR_CODE('ldsc') kInstKnobMissingUnknown = 0 kInstKnobMissingDefault = (1 << 0) kMusicLoopTypeNormal = 0 -kMusicLoopTypePalindrome = 1 +kMusicLoopTypePalindrome = 1 instSamplePreProcessFlag = 1 << 0 kQTMIDIComponentType = FOUR_CHAR_CODE('midi') kOMSComponentSubType = FOUR_CHAR_CODE('OMS ') @@ -2946,18 +2946,18 @@ kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr') kOSXMIDIComponentSubType = FOUR_CHAR_CODE('osxm') kMusicPacketPortLost = 1 kMusicPacketPortFound = 2 -kMusicPacketTimeGap = 3 +kMusicPacketTimeGap = 3 kAppleSysexID = 0x11 kAppleSysexCmdSampleSize = 0x0001 kAppleSysexCmdSampleBreak = 0x0002 kAppleSysexCmdAtomicInstrument = 0x0010 -kAppleSysexCmdDeveloper = 0x7F00 +kAppleSysexCmdDeveloper = 0x7F00 kSynthesizerConnectionFMS = 1 kSynthesizerConnectionMMgr = 2 kSynthesizerConnectionOMS = 4 kSynthesizerConnectionQT = 8 kSynthesizerConnectionOSXMIDI = 16 -kSynthesizerConnectionUnavailable = 256 +kSynthesizerConnectionUnavailable = 256 kMusicComponentType = FOUR_CHAR_CODE('musi') kInstrumentComponentType = FOUR_CHAR_CODE('inst') kSoftSynthComponentSubType = FOUR_CHAR_CODE('ss ') @@ -2976,7 +2976,7 @@ kSynthesizerSlowSetPart = 1 << 10 kSynthesizerOffline = 1 << 12 kSynthesizerGM = 1 << 14 kSynthesizerDLS = 1 << 15 -kSynthesizerSoundLocalization = 1 << 16 +kSynthesizerSoundLocalization = 1 << 16 kControllerModulationWheel = 1 kControllerBreath = 2 kControllerFoot = 4 @@ -3081,8 +3081,8 @@ kQTMSKnobReverbThresholdID = 0x0200003E kQTMSKnobVolumeAttackVelScalingID = 0x0200003F kQTMSKnobLastIDPlus1 = 0x02000040 kControllerMaximum = 0x00007FFF -# kControllerMinimum = (long)0xFFFF8000 -kVoiceCountDynamic = -1 +# kControllerMinimum = (long)0xFFFF8000 +kVoiceCountDynamic = -1 kFirstGMInstrument = 0x00000001 kLastGMInstrument = 0x00000080 kFirstGSInstrument = 0x00000081 @@ -3116,9 +3116,9 @@ kKnobTypeSetting = 6 << 12 kKnobTypeMilliseconds = 7 << 12 kKnobTypePercentage = 8 << 12 kKnobTypeHertz = 9 << 12 -kKnobTypeButton = 10 << 12 +kKnobTypeButton = 10 << 12 kUnknownKnobValue = 0x7FFFFFFF -kDefaultKnobValue = 0x7FFFFFFE +kDefaultKnobValue = 0x7FFFFFFE notImplementedMusicErr = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))) cantSendToSynthesizerErr = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))) cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))) @@ -3142,13 +3142,13 @@ kGetAtomicInstNoSamples = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOrig kGetAtomicInstNoKnobList = 1 << 2 kGetAtomicInstNoInstrumentInfo = 1 << 3 kGetAtomicInstOriginalKnobList = 1 << 4 -kGetAtomicInstAllKnobs = 1 << 5 +kGetAtomicInstAllKnobs = 1 << 5 kSetAtomicInstKeepOriginalInstrument = 1 << 0 kSetAtomicInstShareAcrossParts = 1 << 1 kSetAtomicInstCallerTosses = 1 << 2 kSetAtomicInstCallerGuarantees = 1 << 3 kSetAtomicInstInterruptSafe = 1 << 4 -kSetAtomicInstDontPreprocess = 1 << 7 +kSetAtomicInstDontPreprocess = 1 << 7 kInstrumentNamesModifiable = 1 kInstrumentNamesBoth = 2 kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene') @@ -3196,13 +3196,13 @@ kGenericMusicCallParts = 1 << 5 kGenericMusicCallInstrument = 1 << 6 kGenericMusicCallNumber = 1 << 7 kGenericMusicCallROMInstrument = 1 << 8 -kGenericMusicAllDefaults = 1 << 9 +kGenericMusicAllDefaults = 1 << 9 kGetInstrumentInfoNoBuiltIn = 1 << 0 kGetInstrumentInfoMidiUserInst = 1 << 1 kGetInstrumentInfoNoIText = 1 << 2 kNoteRequestNoGM = 1 kNoteRequestNoSynthType = 2 -kNoteRequestSynthMustMatch = 4 +kNoteRequestSynthMustMatch = 4 kNoteRequestSpecifyMIDIChannel = 0x80 kPickDontMix = 1 kPickSameSynth = 2 @@ -3210,11 +3210,11 @@ kPickUserInsts = 4 kPickEditAllowEdit = 8 kPickEditAllowPick = 16 kPickEditSynthGlobal = 32 -kPickEditControllers = 64 +kPickEditControllers = 64 kNoteAllocatorComponentType = FOUR_CHAR_CODE('nota') kNADummyOneSelect = 29 kNADummyTwoSelect = 30 -kTuneQueueDepth = 8 +kTuneQueueDepth = 8 kTunePlayerComponentType = FOUR_CHAR_CODE('tune') kTuneStartNow = 1 kTuneDontClipNotes = 2 @@ -3227,9 +3227,9 @@ kTuneStartNewMaster = 16384 kTuneStopFade = 1 kTuneStopSustain = 2 kTuneStopInstant = 4 -kTuneStopReleaseChannels = 8 +kTuneStopReleaseChannels = 8 kTuneMixMute = 1 -kTuneMixSolo = 2 +kTuneMixSolo = 2 kRestEventType = 0x00000000 kNoteEventType = 0x00000001 kControlEventType = 0x00000002 @@ -3347,10 +3347,10 @@ kGeneralEventMIDIChannel = 8 kGeneralEventPartChange = 9 kGeneralEventNoOp = 10 kGeneralEventUsedNotes = 11 -kGeneralEventPartMix = 12 +kGeneralEventPartMix = 12 kMarkerEventEnd = 0 kMarkerEventBeat = 1 -kMarkerEventTempo = 2 +kMarkerEventTempo = 2 kCurrentlyNativeEndian = 1 kCurrentlyNotNativeEndian = 2 kQTMIDIGetMIDIPortsSelect = 0x0001 diff --git a/Lib/plat-mac/Carbon/Resources.py b/Lib/plat-mac/Carbon/Resources.py index 8030396..2cd8761 100644 --- a/Lib/plat-mac/Carbon/Resources.py +++ b/Lib/plat-mac/Carbon/Resources.py @@ -8,7 +8,7 @@ resPreload = 4 resChanged = 2 mapReadOnly = 128 mapCompact = 64 -mapChanged = 32 +mapChanged = 32 resSysRefBit = 7 resSysHeapBit = 6 resPurgeableBit = 5 @@ -18,10 +18,10 @@ resPreloadBit = 2 resChangedBit = 1 mapReadOnlyBit = 7 mapCompactBit = 6 -mapChangedBit = 5 +mapChangedBit = 5 kResFileNotOpened = -1 -kSystemResFile = 0 +kSystemResFile = 0 kRsrcChainBelowSystemMap = 0 kRsrcChainBelowApplicationMap = 1 kRsrcChainAboveApplicationMap = 2 -kRsrcChainAboveAllMaps = 4 +kRsrcChainAboveAllMaps = 4 diff --git a/Lib/plat-mac/Carbon/Sound.py b/Lib/plat-mac/Carbon/Sound.py index ffe9efa..0e7b2fb 100644 --- a/Lib/plat-mac/Carbon/Sound.py +++ b/Lib/plat-mac/Carbon/Sound.py @@ -1,8 +1,8 @@ # Generated from 'Sound.h' def FOUR_CHAR_CODE(x): return x -soundListRsrc = FOUR_CHAR_CODE('snd ') -kSimpleBeepID = 1 +soundListRsrc = FOUR_CHAR_CODE('snd ') +kSimpleBeepID = 1 # rate48khz = (long)0xBB800000 # rate44khz = (long)0xAC440000 rate32khz = 0x7D000000 @@ -11,21 +11,21 @@ rate22khz = 0x56EE8BA3 rate16khz = 0x3E800000 rate11khz = 0x2B7745D1 rate11025hz = 0x2B110000 -rate8khz = 0x1F400000 -sampledSynth = 5 +rate8khz = 0x1F400000 +sampledSynth = 5 squareWaveSynth = 1 waveTableSynth = 3 MACE3snthID = 11 MACE6snthID = 13 -kMiddleC = 60 +kMiddleC = 60 kNoVolume = 0 -kFullVolume = 0x0100 +kFullVolume = 0x0100 stdQLength = 128 dataOffsetFlag = 0x8000 -kUseOptionalOutputDevice = -1 +kUseOptionalOutputDevice = -1 notCompressed = 0 fixedCompression = -1 -variableCompression = -2 +variableCompression = -2 twoToOne = 1 eightToThree = 2 threeToOne = 3 @@ -35,17 +35,17 @@ threeToOnePacketSize = 16 stateBlockSize = 64 leftOverBlockSize = 32 firstSoundFormat = 0x0001 -secondSoundFormat = 0x0002 +secondSoundFormat = 0x0002 dbBufferReady = 0x00000001 -dbLastBuffer = 0x00000004 +dbLastBuffer = 0x00000004 sysBeepDisable = 0x0000 sysBeepEnable = (1 << 0) -sysBeepSynchronous = (1 << 1) +sysBeepSynchronous = (1 << 1) unitTypeNoSelection = 0xFFFF unitTypeSeconds = 0x0000 stdSH = 0x00 extSH = 0xFF -cmpSH = 0xFE +cmpSH = 0xFE nullCmd = 0 quietCmd = 3 flushCmd = 4 @@ -84,7 +84,7 @@ continueCmd = 83 doubleBufferCmd = 84 getRateCmd = 85 sizeCmd = 90 -convertCmd = 91 +convertCmd = 91 waveInitChannelMask = 0x07 waveInitChannel0 = 0x04 waveInitChannel1 = 0x05 @@ -93,7 +93,7 @@ waveInitChannel3 = 0x07 initChan0 = waveInitChannel0 initChan1 = waveInitChannel1 initChan2 = waveInitChannel2 -initChan3 = waveInitChannel3 +initChan3 = waveInitChannel3 outsideCmpSH = 0 insideCmpSH = 1 aceSuccess = 0 @@ -102,7 +102,7 @@ aceNilBlock = 2 aceBadComp = 3 aceBadEncode = 4 aceBadDest = 5 -aceBadCmd = 6 +aceBadCmd = 6 initChanLeft = 0x0002 initChanRight = 0x0003 initNoInterp = 0x0004 @@ -114,7 +114,7 @@ initMACE6 = 0x0400 initPanMask = 0x0003 initSRateMask = 0x0030 initStereoMask = 0x00C0 -initCompMask = 0xFF00 +initCompMask = 0xFF00 siActiveChannels = FOUR_CHAR_CODE('chac') siActiveLevels = FOUR_CHAR_CODE('lmac') siAGCOnOff = FOUR_CHAR_CODE('agc ') @@ -200,11 +200,11 @@ siVoxStopInfo = FOUR_CHAR_CODE('voxs') siWideStereo = FOUR_CHAR_CODE('wide') siSupportedExtendedFlags = FOUR_CHAR_CODE('exfl') siRateConverterRollOffSlope = FOUR_CHAR_CODE('rcdb') -siOutputLatency = FOUR_CHAR_CODE('olte') +siOutputLatency = FOUR_CHAR_CODE('olte') siCloseDriver = FOUR_CHAR_CODE('clos') siInitializeDriver = FOUR_CHAR_CODE('init') siPauseRecording = FOUR_CHAR_CODE('paus') -siUserInterruptProc = FOUR_CHAR_CODE('user') +siUserInterruptProc = FOUR_CHAR_CODE('user') # kInvalidSource = (long)0xFFFFFFFF kNoSource = FOUR_CHAR_CODE('none') kCDSource = FOUR_CHAR_CODE('cd ') @@ -219,7 +219,7 @@ kModemSource = FOUR_CHAR_CODE('modm') kPCCardSource = FOUR_CHAR_CODE('pcm ') kZoomVideoSource = FOUR_CHAR_CODE('zvpc') kDVDSource = FOUR_CHAR_CODE('dvda') -kMicrophoneArray = FOUR_CHAR_CODE('mica') +kMicrophoneArray = FOUR_CHAR_CODE('mica') kNoSoundComponentType = FOUR_CHAR_CODE('****') kSoundComponentType = FOUR_CHAR_CODE('sift') kSoundComponentPPCType = FOUR_CHAR_CODE('nift') @@ -287,7 +287,7 @@ kOffsetBinary = k8BitOffsetBinaryFormat kTwosComplement = k16BitBigEndianFormat kLittleEndianFormat = k16BitLittleEndianFormat kMPEGLayer3Format = 0x6D730055 -kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3') +kFullMPEGLay3Format = FOUR_CHAR_CODE('.mp3') k16BitNativeEndianFormat = k16BitLittleEndianFormat k16BitNonNativeEndianFormat = k16BitBigEndianFormat k16BitNativeEndianFormat = k16BitBigEndianFormat @@ -323,8 +323,8 @@ kNonPagingMixer = (1 << 10) kSoundConverterMixer = (1 << 11) kPagingMixer = (1 << 12) kVMAwareMixer = (1 << 13) -kExtendedSoundData = (1 << 14) -kBestQuality = (1 << 0) +kExtendedSoundData = (1 << 14) +kBestQuality = (1 << 0) kInputMask = 0x000000FF kOutputMask = 0x0000FF00 kOutputShift = 8 @@ -337,7 +337,7 @@ kAudioTerminatorAtomType = 0 kAVDisplayHeadphoneRemove = 0 kAVDisplayHeadphoneInsert = 1 kAVDisplayPlainTalkRemove = 2 -kAVDisplayPlainTalkInsert = 3 +kAVDisplayPlainTalkInsert = 3 audioAllChannels = 0 audioLeftChannel = 1 audioRightChannel = 2 @@ -345,21 +345,21 @@ audioUnmuted = 0 audioMuted = 1 audioDoesMono = (1L << 0) audioDoesStereo = (1L << 1) -audioDoesIndependentChannels = (1L << 2) +audioDoesIndependentChannels = (1L << 2) siCDQuality = FOUR_CHAR_CODE('cd ') siBestQuality = FOUR_CHAR_CODE('best') siBetterQuality = FOUR_CHAR_CODE('betr') siGoodQuality = FOUR_CHAR_CODE('good') -siNoneQuality = FOUR_CHAR_CODE('none') +siNoneQuality = FOUR_CHAR_CODE('none') siDeviceIsConnected = 1 siDeviceNotConnected = 0 siDontKnowIfConnected = -1 siReadPermission = 0 -siWritePermission = 1 +siWritePermission = 1 kSoundConverterDidntFillBuffer = (1 << 0) -kSoundConverterHasLeftOverData = (1 << 1) +kSoundConverterHasLeftOverData = (1 << 1) kExtendedSoundSampleCountNotValid = 1L << 0 -kExtendedSoundBufferSizeValid = 1L << 1 +kExtendedSoundBufferSizeValid = 1L << 1 kScheduledSoundDoScheduled = 1 << 0 kScheduledSoundDoCallBack = 1 << 1 kScheduledSoundExtendedHdr = 1 << 2 diff --git a/Lib/plat-mac/Carbon/TextEdit.py b/Lib/plat-mac/Carbon/TextEdit.py index eb5fb92..176795a 100644 --- a/Lib/plat-mac/Carbon/TextEdit.py +++ b/Lib/plat-mac/Carbon/TextEdit.py @@ -7,26 +7,26 @@ teForceLeft = -2 teFlushDefault = 0 teCenter = 1 teFlushRight = -1 -teFlushLeft = -2 +teFlushLeft = -2 fontBit = 0 faceBit = 1 sizeBit = 2 clrBit = 3 addSizeBit = 4 -toggleBit = 5 +toggleBit = 5 doFont = 1 doFace = 2 doSize = 4 doColor = 8 doAll = 15 addSize = 16 -doToggle = 32 +doToggle = 32 EOLHook = 0 DRAWHook = 4 WIDTHHook = 8 HITTESTHook = 12 nWIDTHHook = 24 -TextWidthHook = 28 +TextWidthHook = 28 intEOLHook = 0 intDrawHook = 1 intWidthHook = 2 @@ -34,24 +34,24 @@ intHitTestHook = 3 intNWidthHook = 6 intTextWidthHook = 7 intInlineInputTSMTEPreUpdateHook = 8 -intInlineInputTSMTEPostUpdateHook = 9 +intInlineInputTSMTEPostUpdateHook = 9 teFAutoScroll = 0 teFTextBuffering = 1 teFOutlineHilite = 2 teFInlineInput = 3 teFUseWhiteBackground = 4 teFUseInlineInput = 5 -teFInlineInputAutoScroll = 6 -teFIdleWithEventLoopTimer = 7 +teFInlineInputAutoScroll = 6 +teFIdleWithEventLoopTimer = 7 teBitClear = 0 teBitSet = 1 -teBitTest = -1 +teBitTest = -1 teWordSelect = 4 teWordDrag = 8 teFromFind = 12 -teFromRecal = 16 +teFromRecal = 16 teFind = 0 teHighlight = 1 teDraw = -1 -teCaret = -2 -teFUseTextServices = 4 +teCaret = -2 +teFUseTextServices = 4 diff --git a/Lib/plat-mac/Carbon/Windows.py b/Lib/plat-mac/Carbon/Windows.py index af8eaf2..b09d537 100644 --- a/Lib/plat-mac/Carbon/Windows.py +++ b/Lib/plat-mac/Carbon/Windows.py @@ -44,7 +44,7 @@ kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseB kWindowDefProcType = FOUR_CHAR_CODE('WDEF') kStandardWindowDefinition = 0 kRoundWindowDefinition = 1 -kFloatingWindowDefinition = 124 +kFloatingWindowDefinition = 124 kDocumentWindowVariantCode = 0 kModalDialogVariantCode = 1 kPlainDialogVariantCode = 2 @@ -109,7 +109,7 @@ kWindowFloatSideHorizZoomGrowProc = 1083 kWindowFloatSideFullZoomProc = 1085 kWindowFloatSideFullZoomGrowProc = 1087 kWindowSheetProc = 1088 -kWindowSheetAlertProc = 1120 +kWindowSheetAlertProc = 1120 kWindowSimpleProc = 1104 kWindowSimpleFrameProc = 1105 kWindowNoPosition = 0x0000 @@ -145,7 +145,7 @@ kWindowStructureRgn = 32 kWindowContentRgn = 33 kWindowUpdateRgn = 34 kWindowOpaqueRgn = 35 -kWindowGlobalPortRgn = 40 +kWindowGlobalPortRgn = 40 dialogKind = 2 userKind = 8 kDialogWindowKind = 2 @@ -163,7 +163,7 @@ inZoomOut = 8 inCollapseBox = 11 inProxyIcon = 12 inToolbarButton = 13 -inStructure = 15 +inStructure = 15 wNoHit = 0 wInContent = 1 wInDrag = 2 @@ -174,7 +174,7 @@ wInZoomOut = 6 wInCollapseBox = 9 wInProxyIcon = 10 wInToolbarButton = 11 -wInStructure = 13 +wInStructure = 13 kWindowMsgDraw = 0 kWindowMsgHitTest = 1 kWindowMsgCalculateShape = 2 @@ -189,8 +189,8 @@ kWindowMsgModified = 10 kWindowMsgDrawInCurrentPort = 11 kWindowMsgSetupProxyDragImage = 12 kWindowMsgStateChanged = 13 -kWindowMsgMeasureTitle = 14 -kWindowMsgGetGrowImageRegion = 19 +kWindowMsgMeasureTitle = 14 +kWindowMsgGetGrowImageRegion = 19 wDraw = 0 wHit = 1 wCalcRgns = 2 @@ -214,7 +214,7 @@ kWindowCanMeasureTitle = (1 << 11) kWindowWantsDisposeAtProcessDeath = (1 << 12) kWindowSupportsGetGrowImageRegion = (1 << 13) kWindowDefSupportsColorGrafPort = 0x40000002 -kWindowIsOpaque = (1 << 14) +kWindowIsOpaque = (1 << 14) kWindowSupportsSetGrowImageRegion = (1 << 13) deskPatID = 16 wContentColor = 0 @@ -228,10 +228,10 @@ kWindowDefinitionVersionTwo = 2 kWindowIsCollapsedState = (1 << 0L) kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') -kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') +kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') kWindowDefProcPtr = 0 kWindowDefObjectClass = 1 -kWindowDefProcID = 2 +kWindowDefProcID = 2 kWindowModalityNone = 0 kWindowModalitySystemModal = 1 kWindowModalityAppModal = 2 @@ -252,7 +252,7 @@ kWindowGroupContentsVisible = 1 << 2 kWindowPaintProcOptionsNone = 0 kScrollWindowNoOptions = 0 kScrollWindowInvalidate = (1L << 0) -kScrollWindowEraseToPortBackground = (1L << 1) +kScrollWindowEraseToPortBackground = (1L << 1) kWindowMenuIncludeRotate = 1 << 0 kWindowZoomTransitionEffect = 1 kWindowSheetTransitionEffect = 2 @@ -273,7 +273,7 @@ kWindowLatentVisibleFullScreen = 1 << 2 kWindowLatentVisibleAppHidden = 1 << 3 kWindowLatentVisibleCollapsedOwner = 1 << 4 kWindowLatentVisibleCollapsedGroup = 1 << 5 -kWindowPropertyPersistent = 0x00000001 +kWindowPropertyPersistent = 0x00000001 kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether diff --git a/Lib/plat-mac/Carbon/__init__.py b/Lib/plat-mac/Carbon/__init__.py index d0cfec3..8018c18 100644 --- a/Lib/plat-mac/Carbon/__init__.py +++ b/Lib/plat-mac/Carbon/__init__.py @@ -1,4 +1,4 @@ # Filter out warnings about signed/unsigned constants import warnings warnings.filterwarnings("ignore", "", FutureWarning, ".*Controls") -warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor")
\ No newline at end of file +warnings.filterwarnings("ignore", "", FutureWarning, ".*MacTextEditor") diff --git a/Lib/plat-mac/EasyDialogs.py b/Lib/plat-mac/EasyDialogs.py index 13df7f3..c622d30 100644 --- a/Lib/plat-mac/EasyDialogs.py +++ b/Lib/plat-mac/EasyDialogs.py @@ -373,22 +373,22 @@ ARGV_CMDLINE_DATA=14 ## MacOS.HandleEvent(ev) ## def _setmenu(control, items): - mhandle = control.GetControlData_Handle(Controls.kControlMenuPart, - Controls.kControlPopupButtonMenuHandleTag) - menu = Menu.as_Menu(mhandle) - for item in items: - if type(item) == type(()): - label = item[0] - else: - label = item - if label[-1] == '=' or label[-1] == ':': - label = label[:-1] - menu.AppendMenu(label) + mhandle = control.GetControlData_Handle(Controls.kControlMenuPart, + Controls.kControlPopupButtonMenuHandleTag) + menu = Menu.as_Menu(mhandle) + for item in items: + if type(item) == type(()): + label = item[0] + else: + label = item + if label[-1] == '=' or label[-1] == ':': + label = label[:-1] + menu.AppendMenu(label) ## mhandle, mid = menu.getpopupinfo() ## control.SetControlData_Handle(Controls.kControlMenuPart, ## Controls.kControlPopupButtonMenuHandleTag, mhandle) - control.SetControlMinimum(1) - control.SetControlMaximum(len(items)+1) + control.SetControlMinimum(1) + control.SetControlMaximum(len(items)+1) def _selectoption(d, optionlist, idx): if idx < 0 or idx >= len(optionlist): @@ -836,4 +836,3 @@ if __name__ == '__main__': test() except KeyboardInterrupt: Message("Operation Canceled.") - diff --git a/Lib/plat-mac/FrameWork.py b/Lib/plat-mac/FrameWork.py index 7242704..0a8c1b8 100644 --- a/Lib/plat-mac/FrameWork.py +++ b/Lib/plat-mac/FrameWork.py @@ -635,7 +635,7 @@ class Menu: if self._parent: self._parent.menu.DisableMenuItem(self._parent_item) if self.bar and self.bar.parent: - self.bar.parent.needmenubarredraw = 1 + self.bar.parent.needmenubarredraw = 1 class PopupMenu(Menu): def __init__(self, bar): diff --git a/Lib/plat-mac/MiniAEFrame.py b/Lib/plat-mac/MiniAEFrame.py index 3c5ed9a..98247cb 100644 --- a/Lib/plat-mac/MiniAEFrame.py +++ b/Lib/plat-mac/MiniAEFrame.py @@ -59,9 +59,9 @@ class MiniApplication: self.quitting = 1 def dooneevent(self, mask = everyEvent, timeout = 60*60): - got, event = Evt.WaitNextEvent(mask, timeout) - if got: - self.lowlevelhandler(event) + got, event = Evt.WaitNextEvent(mask, timeout) + if got: + self.lowlevelhandler(event) def lowlevelhandler(self, event): what, message, when, where, modifiers = event diff --git a/Lib/plat-mac/PixMapWrapper.py b/Lib/plat-mac/PixMapWrapper.py index a2d13fe..7edbac2 100644 --- a/Lib/plat-mac/PixMapWrapper.py +++ b/Lib/plat-mac/PixMapWrapper.py @@ -1,5 +1,5 @@ """PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque -QuickDraw PixMap data structure in a handy Python class. Also provides +QuickDraw PixMap data structure in a handy Python class. Also provides methods to convert to/from pixel data (from, e.g., the img module) or a Python Imaging Library Image object. @@ -77,7 +77,7 @@ class PixMapWrapper: 2, 5, # cmpCount, cmpSize, 0, 0, 0) # planeBytes, pmTable, pmReserved self.__dict__['_pm'] = Qd.RawBitMap(self._header) - + def _stuff(self, element, bytes): offset = _pmElemOffset[element] fmt = _pmElemFormat[element] @@ -85,7 +85,7 @@ class PixMapWrapper: + struct.pack(fmt, bytes) \ + self._header[offset + struct.calcsize(fmt):] self.__dict__['_pm'] = None - + def _unstuff(self, element): offset = _pmElemOffset[element] fmt = _pmElemFormat[element] @@ -113,7 +113,7 @@ class PixMapWrapper: # any other pm attribute -- just stuff self._stuff(attr, val) else: - self.__dict__[attr] = val + self.__dict__[attr] = val def __getattr__(self, attr): if attr == 'rowBytes': @@ -133,9 +133,9 @@ class PixMapWrapper: # any other pm attribute -- just unstuff return self._unstuff(attr) else: - return self.__dict__[attr] + return self.__dict__[attr] + - def PixMap(self): "Return a QuickDraw PixMap corresponding to this data." if not self.__dict__['_pm']: @@ -143,7 +143,7 @@ class PixMapWrapper: return self.__dict__['_pm'] def blit(self, x1=0,y1=0,x2=None,y2=None, port=None): - """Draw this pixmap into the given (default current) grafport.""" + """Draw this pixmap into the given (default current) grafport.""" src = self.bounds dest = [x1,y1,x2,y2] if x2 == None: @@ -153,7 +153,7 @@ class PixMapWrapper: if not port: port = Qd.GetPort() Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest), QuickDraw.srcCopy, None) - + def fromstring(self,s,width,height,format=imgformat.macrgb): """Stuff this pixmap with raw pixel data from a string. Supply width, height, and one of the imgformat specifiers.""" @@ -188,7 +188,7 @@ class PixMapWrapper: """Initialize this PixMap from a PIL Image object.""" # We need data in ARGB format; PIL can't currently do that, # but it can do RGBA, which we can use by inserting one null - # up frontpm = + # up frontpm = if im.mode != 'RGBA': im = im.convert('RGBA') data = chr(0) + im.tostring() self.fromstring(data, im.size[0], im.size[1]) @@ -212,4 +212,3 @@ def test(): pm.fromImage( Image.open(path) ) pm.blit(20,20) return pm - diff --git a/Lib/plat-mac/aepack.py b/Lib/plat-mac/aepack.py index 22dfd21..529a0a4 100644 --- a/Lib/plat-mac/aepack.py +++ b/Lib/plat-mac/aepack.py @@ -74,16 +74,16 @@ def packkey(ae, key, value): def pack(x, forcetype = None): """Pack a python object into an AE descriptor""" - + if forcetype: if type(x) is StringType: return AE.AECreateDesc(forcetype, x) else: return pack(x).AECoerceDesc(forcetype) - + if x == None: return AE.AECreateDesc('null', '') - + if isinstance(x, AEDescType): return x if isinstance(x, FSSType): @@ -128,11 +128,11 @@ def pack(x, forcetype = None): def unpack(desc, formodulename=""): """Unpack an AE descriptor to a python object""" t = desc.type - + if unpacker_coercions.has_key(t): desc = desc.AECoerceDesc(unpacker_coercions[t]) t = desc.type # This is a guess by Jack.... - + if t == typeAEList: l = [] for i in range(desc.AECountItems()): @@ -248,7 +248,7 @@ def unpack(desc, formodulename=""): record = desc.AECoerceDesc('reco') return mklogical(unpack(record, formodulename)) return mkunknown(desc.type, desc.data) - + def coerce(data, egdata): """Coerce a python object to another type using the AE coercers""" pdata = pack(data) @@ -311,10 +311,10 @@ def mklogical(dict): def mkstyledtext(dict): return aetypes.StyledText(dict['ksty'], dict['ktxt']) - + def mkaetext(dict): return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText]) - + def mkinsertionloc(dict): return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition]) @@ -355,7 +355,7 @@ def mkobjectfrommodule(dict, modulename): assert issubclass(classtype, ObjectSpecifier) newobj.__class__ = classtype return newobj - + def mktype(typecode, modulename=None): if modulename: module = __import__(modulename) diff --git a/Lib/plat-mac/aetools.py b/Lib/plat-mac/aetools.py index 347b523..79f3978 100644 --- a/Lib/plat-mac/aetools.py +++ b/Lib/plat-mac/aetools.py @@ -113,7 +113,7 @@ def keysubst(arguments, keydict): arguments[keydict[k]] = v elif k != '----' and k not in ok: raise TypeError, 'Unknown keyword argument: %s'%k - + def enumsubst(arguments, key, edict): """Substitute a single enum keyword argument, if it occurs""" if not arguments.has_key(key) or edict is None: @@ -124,7 +124,7 @@ def enumsubst(arguments, key, edict): arguments[key] = Enum(edict[v]) elif not v in ok: raise TypeError, 'Unknown enumerator: %s'%v - + def decodeerror(arguments): """Create the 'best' argument for a raise MacOS.Error""" errn = arguments['errn'] @@ -137,7 +137,7 @@ def decodeerror(arguments): err_a3 = arguments['erob'] else: err_a3 = None - + return (err_a1, err_a2, err_a3) class TalkTo: @@ -146,7 +146,7 @@ class TalkTo: _moduleName = None # Can be overridden by subclasses _elemdict = {} # Can be overridden by subclasses _propdict = {} # Can be overridden by subclasses - + __eventloop_initialized = 0 def __ensure_WMAvailable(klass): if klass.__eventloop_initialized: return 1 @@ -156,10 +156,10 @@ class TalkTo: Evt.WaitNextEvent(0,0) return 1 __ensure_WMAvailable = classmethod(__ensure_WMAvailable) - + def __init__(self, signature=None, start=0, timeout=0): """Create a communication channel with a particular application. - + Addressing the application is done by specifying either a 4-byte signature, an AEDesc or an object that will __aepack__ to an AEDesc. @@ -184,7 +184,7 @@ class TalkTo: self.send_timeout = AppleEvents.kAEDefaultTimeout if start: self._start() - + def _start(self): """Start the application, if it is not running yet""" try: @@ -199,19 +199,19 @@ class TalkTo: else: break time.sleep(1) - + def start(self): """Deprecated, used _start()""" self._start() - + def newevent(self, code, subcode, parameters = {}, attributes = {}): """Create a complete structure for an apple event""" - + event = AE.AECreateAppleEvent(code, subcode, self.target, AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID) packevent(event, parameters, attributes) return event - + def sendevent(self, event): """Send a pre-created appleevent, await the reply and unpack it""" if not self.__ensure_WMAvailable(): @@ -220,11 +220,11 @@ class TalkTo: self.send_timeout) parameters, attributes = unpackevent(reply, self._moduleName) return reply, parameters, attributes - + def send(self, code, subcode, parameters = {}, attributes = {}): """Send an appleevent given code/subcode/pars/attrs and unpack the reply""" return self.sendevent(self.newevent(code, subcode, parameters, attributes)) - + # # The following events are somehow "standard" and don't seem to appear in any # suite... @@ -256,9 +256,9 @@ class TalkTo: if as: item.__class__ = as return item - + get = _get - + _argmap_set = { 'to' : 'data', } @@ -283,12 +283,12 @@ class TalkTo: # XXXX Optionally decode result if _arguments.has_key('----'): return _arguments['----'] - + set = _set # Magic glue to allow suite-generated classes to function somewhat # like the "application" class in OSA. - + def __getattr__(self, name): if self._elemdict.has_key(name): cls = self._elemdict[name] @@ -297,7 +297,7 @@ class TalkTo: cls = self._propdict[name] return cls() raise AttributeError, name - + # Tiny Finder class, for local use only class _miniFinder(TalkTo): @@ -321,7 +321,7 @@ class _miniFinder(TalkTo): if _arguments.has_key('----'): return _arguments['----'] #pass - + _finder = _miniFinder('MACS') def _launch(appfile): @@ -332,12 +332,12 @@ def _launch(appfile): class _application_file(ComponentItem): """application file - An application's file on disk""" want = 'appf' - + _application_file._propdict = { } _application_file._elemdict = { } - + # Test program # XXXX Should test more, really... diff --git a/Lib/plat-mac/aetypes.py b/Lib/plat-mac/aetypes.py index b9386f3..c60b39c 100644 --- a/Lib/plat-mac/aetypes.py +++ b/Lib/plat-mac/aetypes.py @@ -12,7 +12,7 @@ import string def pack(*args, **kwargs): from aepack import pack return pack( *args, **kwargs) - + def nice(s): """'nice' representation of an object""" if type(s) is StringType: return repr(s) @@ -20,29 +20,29 @@ def nice(s): class Unknown: """An uninterpreted AE object""" - + def __init__(self, type, data): self.type = type self.data = data - + def __repr__(self): return "Unknown(%r, %r)" % (self.type, self.data) - + def __aepack__(self): return pack(self.data, self.type) class Enum: """An AE enumeration value""" - + def __init__(self, enum): self.enum = "%-4.4s" % str(enum) - + def __repr__(self): return "Enum(%r)" % (self.enum,) - + def __str__(self): return string.strip(self.enum) - + def __aepack__(self): return pack(self.enum, typeEnumeration) @@ -58,36 +58,36 @@ class InsertionLoc: def __init__(self, of, pos): self.of = of self.pos = pos - + def __repr__(self): return "InsertionLoc(%r, %r)" % (self.of, self.pos) - + def __aepack__(self): rec = {'kobj': self.of, 'kpos': self.pos} return pack(rec, forcetype='insl') - + # Convenience functions for dsp: def beginning(of): return InsertionLoc(of, Enum('bgng')) - + def end(of): return InsertionLoc(of, Enum('end ')) class Boolean: """An AE boolean value""" - + def __init__(self, bool): self.bool = (not not bool) - + def __repr__(self): return "Boolean(%r)" % (self.bool,) - + def __str__(self): if self.bool: return "True" else: return "False" - + def __aepack__(self): return pack(struct.pack('b', self.bool), 'bool') @@ -100,16 +100,16 @@ def mkboolean(bool): class Type: """An AE 4-char typename object""" - + def __init__(self, type): self.type = "%-4.4s" % str(type) - + def __repr__(self): return "Type(%r)" % (self.type,) - + def __str__(self): return string.strip(self.type) - + def __aepack__(self): return pack(self.type, typeType) @@ -123,16 +123,16 @@ def mktype(type): class Keyword: """An AE 4-char keyword object""" - + def __init__(self, keyword): self.keyword = "%-4.4s" % str(keyword) - + def __repr__(self): return "Keyword(%r)" % `self.keyword` - + def __str__(self): return string.strip(self.keyword) - + def __aepack__(self): return pack(self.keyword, typeKeyword) @@ -141,17 +141,17 @@ def IsKeyword(x): class Range: """An AE range object""" - + def __init__(self, start, stop): self.start = start self.stop = stop - + def __repr__(self): return "Range(%r, %r)" % (self.start, self.stop) - + def __str__(self): return "%s thru %s" % (nice(self.start), nice(self.stop)) - + def __aepack__(self): return pack({'star': self.start, 'stop': self.stop}, 'rang') @@ -160,18 +160,18 @@ def IsRange(x): class Comparison: """An AE Comparison""" - + def __init__(self, obj1, relo, obj2): self.obj1 = obj1 self.relo = "%-4.4s" % str(relo) self.obj2 = obj2 - + def __repr__(self): return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2) - + def __str__(self): return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2)) - + def __aepack__(self): return pack({'obj1': self.obj1, 'relo': mkenum(self.relo), @@ -180,48 +180,48 @@ class Comparison: def IsComparison(x): return isinstance(x, Comparison) - + class NComparison(Comparison): # The class attribute 'relo' must be set in a subclass - + def __init__(self, obj1, obj2): Comparison.__init__(obj1, self.relo, obj2) class Ordinal: """An AE Ordinal""" - + def __init__(self, abso): # self.obj1 = obj1 self.abso = "%-4.4s" % str(abso) - + def __repr__(self): return "Ordinal(%r)" % (self.abso,) - + def __str__(self): return "%s" % (string.strip(self.abso)) - + def __aepack__(self): return pack(self.abso, 'abso') def IsOrdinal(x): return isinstance(x, Ordinal) - + class NOrdinal(Ordinal): # The class attribute 'abso' must be set in a subclass - + def __init__(self): Ordinal.__init__(self, self.abso) class Logical: """An AE logical expression object""" - + def __init__(self, logc, term): self.logc = "%-4.4s" % str(logc) self.term = term - + def __repr__(self): return "Logical(%r, %r)" % (self.logc, self.term) - + def __str__(self): if type(self.term) == ListType and len(self.term) == 2: return "%s %s %s" % (nice(self.term[0]), @@ -229,7 +229,7 @@ class Logical: nice(self.term[1])) else: return "%s(%s)" % (string.strip(self.logc), nice(self.term)) - + def __aepack__(self): return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi') @@ -238,17 +238,17 @@ def IsLogical(x): class StyledText: """An AE object respresenting text in a certain style""" - + def __init__(self, style, text): self.style = style self.text = text - + def __repr__(self): return "StyledText(%r, %r)" % (self.style, self.text) - + def __str__(self): return self.text - + def __aepack__(self): return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT') @@ -257,18 +257,18 @@ def IsStyledText(x): class AEText: """An AE text object with style, script and language specified""" - + def __init__(self, script, style, text): self.script = script self.style = style self.text = text - + def __repr__(self): return "AEText(%r, %r, %r)" % (self.script, self.style, self.text) - + def __str__(self): return self.text - + def __aepack__(self): return pack({keyAEScriptTag: self.script, keyAEStyles: self.style, keyAEText: self.text}, typeAEText) @@ -278,18 +278,18 @@ def IsAEText(x): class IntlText: """A text object with script and language specified""" - + def __init__(self, script, language, text): self.script = script self.language = language self.text = text - + def __repr__(self): return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text) - + def __str__(self): return self.text - + def __aepack__(self): return pack(struct.pack('hh', self.script, self.language)+self.text, typeIntlText) @@ -299,17 +299,17 @@ def IsIntlText(x): class IntlWritingCode: """An object representing script and language""" - + def __init__(self, script, language): self.script = script self.language = language - + def __repr__(self): return "IntlWritingCode(%r, %r)" % (self.script, self.language) - + def __str__(self): return "script system %d, language %d"%(self.script, self.language) - + def __aepack__(self): return pack(struct.pack('hh', self.script, self.language), typeIntlWritingCode) @@ -319,17 +319,17 @@ def IsIntlWritingCode(x): class QDPoint: """A point""" - + def __init__(self, v, h): self.v = v self.h = h - + def __repr__(self): return "QDPoint(%r, %r)" % (self.v, self.h) - + def __str__(self): return "(%d, %d)"%(self.v, self.h) - + def __aepack__(self): return pack(struct.pack('hh', self.v, self.h), typeQDPoint) @@ -339,19 +339,19 @@ def IsQDPoint(x): class QDRectangle: """A rectangle""" - + def __init__(self, v0, h0, v1, h1): self.v0 = v0 self.h0 = h0 self.v1 = v1 self.h1 = h1 - + def __repr__(self): return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1) - + def __str__(self): return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1) - + def __aepack__(self): return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1), typeQDRectangle) @@ -361,18 +361,18 @@ def IsQDRectangle(x): class RGBColor: """An RGB color""" - + def __init__(self, r, g, b): self.r = r self.g = g self.b = b - + def __repr__(self): return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b) - + def __str__(self): return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b) - + def __aepack__(self): return pack(struct.pack('hhh', self.r, self.g, self.b), typeRGBColor) @@ -381,36 +381,36 @@ def IsRGBColor(x): return isinstance(x, RGBColor) class ObjectSpecifier: - + """A class for constructing and manipulation AE object specifiers in python. - + An object specifier is actually a record with four fields: - + key type description --- ---- ----------- - + 'want' type 4-char class code of thing we want, e.g. word, paragraph or property - + 'form' enum how we specify which 'want' thing(s) we want, e.g. by index, by range, by name, or by property specifier - + 'seld' any which thing(s) we want, e.g. its index, its name, or its property specifier - + 'from' object the object in which it is contained, or null, meaning look for it in the application - + Note that we don't call this class plain "Object", since that name is likely to be used by the application. """ - + def __init__(self, want, form, seld, fr = None): self.want = want self.form = form self.seld = seld self.fr = fr - + def __repr__(self): s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld) if self.fr: @@ -418,7 +418,7 @@ class ObjectSpecifier: else: s = s + ")" return s - + def __aepack__(self): return pack({'want': mktype(self.want), 'form': mkenum(self.form), @@ -441,7 +441,7 @@ class Property(ObjectSpecifier): return "Property(%r, %r)" % (self.seld.type, self.fr) else: return "Property(%r)" % (self.seld.type,) - + def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) @@ -460,7 +460,7 @@ class NProperty(ObjectSpecifier): #except: # self.want = 'prop' self.want = 'prop' - ObjectSpecifier.__init__(self, self.want, 'prop', + ObjectSpecifier.__init__(self, self.want, 'prop', mktype(self.which), fr) def __repr__(self): @@ -470,7 +470,7 @@ class NProperty(ObjectSpecifier): if self.want != 'prop': rv = rv + ", want=%r" % (self.want,) return rv + ")" - + def __str__(self): if self.fr: return "Property %s of %s" % (str(self.seld), str(self.fr)) @@ -479,7 +479,7 @@ class NProperty(ObjectSpecifier): class SelectableItem(ObjectSpecifier): - + def __init__(self, want, seld, fr = None): t = type(seld) if t == StringType: @@ -506,12 +506,12 @@ class ComponentItem(SelectableItem): _elemdict = {} def __init__(self, which, fr = None): SelectableItem.__init__(self, self.want, which, fr) - + def __repr__(self): if not self.fr: return "%s(%r)" % (self.__class__.__name__, self.seld) return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr) - + def __str__(self): seld = self.seld if type(seld) == StringType: @@ -528,7 +528,7 @@ class ComponentItem(SelectableItem): s = "%s %s" % (self.__class__.__name__, ss) if self.fr: s = s + " of %s" % str(self.fr) return s - + def __getattr__(self, name): if self._elemdict.has_key(name): cls = self._elemdict[name] @@ -537,19 +537,19 @@ class ComponentItem(SelectableItem): cls = self._propdict[name] return cls(self) raise AttributeError, name - - + + class DelayedComponentItem: def __init__(self, compclass, fr): self.compclass = compclass self.fr = fr - + def __call__(self, which): return self.compclass(which, self.fr) - + def __repr__(self): return "%s(???, %r)" % (self.__class__.__name__, self.fr) - + def __str__(self): return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr)) @@ -566,4 +566,3 @@ exec template % ("Window", 'cwin') exec template % ("Document", 'docu') exec template % ("File", 'file') exec template % ("InsertionPoint", 'cins') - diff --git a/Lib/plat-mac/applesingle.py b/Lib/plat-mac/applesingle.py index adbce0c..7bbe8af 100644 --- a/Lib/plat-mac/applesingle.py +++ b/Lib/plat-mac/applesingle.py @@ -78,7 +78,7 @@ class AppleSingle(object): self.datafork = data elif restype == AS_RESOURCEFORK: self.resourcefork = data - + def tofile(self, path, resonly=False): outfile = open(path, 'wb') data = False @@ -99,15 +99,15 @@ class AppleSingle(object): fp = MacOS.openrf(path, '*wb') fp.write(self.resourcefork) fp.close() - + def decode(infile, outpath, resonly=False, verbose=False): """decode(infile, outpath [, resonly=False, verbose=False]) Creates a decoded file from an AppleSingle encoded file. - If resonly is True, then it will create a regular file at + If resonly is True, then it will create a regular file at outpath containing only the resource fork from infile. Otherwise it will create an AppleDouble file at outpath - with the data and resource forks from infile. On platforms + with the data and resource forks from infile. On platforms without the MacOS module, it will create inpath and inpath+'.rsrc' with the data and resource forks respectively. @@ -121,7 +121,7 @@ def decode(infile, outpath, resonly=False, verbose=False): as = AppleSingle(infile, verbose=verbose) as.tofile(outpath, resonly=resonly) - + def _test(): if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4: print 'Usage: applesingle.py [-r] applesinglefile decodedfile' @@ -132,6 +132,6 @@ def _test(): else: resonly = False decode(sys.argv[1], sys.argv[2], resonly=resonly) - + if __name__ == '__main__': _test() diff --git a/Lib/plat-mac/appletrawmain.py b/Lib/plat-mac/appletrawmain.py index 88259c1..1be9187 100644 --- a/Lib/plat-mac/appletrawmain.py +++ b/Lib/plat-mac/appletrawmain.py @@ -23,7 +23,7 @@ else: _dir = os.path.split(sys.argv[0])[0] # # Add the Resources directory to the path. This is where files installed -# by BuildApplet.py with the --extra option show up, and if those files are +# by BuildApplet.py with the --extra option show up, and if those files are # modules this sys.path modification is necessary to be able to import them. # sys.path.insert(0, _dir) diff --git a/Lib/plat-mac/bgenlocations.py b/Lib/plat-mac/bgenlocations.py index 19e1f02..e7fa354 100644 --- a/Lib/plat-mac/bgenlocations.py +++ b/Lib/plat-mac/bgenlocations.py @@ -31,13 +31,13 @@ TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon" # Creator for C files: CREATOR="CWIE" -# The previous definitions can be overriden by creating a module -# bgenlocationscustomize.py and putting it in site-packages (or anywere else +# The previous definitions can be overriden by creating a module +# bgenlocationscustomize.py and putting it in site-packages (or anywere else # on sys.path, actually) try: - from bgenlocationscustomize import * + from bgenlocationscustomize import * except ImportError: - pass + pass if not os.path.exists(BGENDIR): raise Error, "Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR @@ -45,7 +45,7 @@ if not os.path.exists(INCLUDEDIR): raise Error, "Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR if not os.path.exists(TOOLBOXDIR): raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR - + # Sigh, due to the way these are used make sure they end with : or /. if BGENDIR[-1] != os.sep: BGENDIR = BGENDIR + os.sep @@ -53,4 +53,3 @@ if INCLUDEDIR[-1] != os.sep: INCLUDEDIR = INCLUDEDIR + os.sep if TOOLBOXDIR[-1] != os.sep: TOOLBOXDIR = TOOLBOXDIR + os.sep - diff --git a/Lib/plat-mac/buildtools.py b/Lib/plat-mac/buildtools.py index 365772a..17e4076 100644 --- a/Lib/plat-mac/buildtools.py +++ b/Lib/plat-mac/buildtools.py @@ -58,10 +58,10 @@ def findtemplate(template=None): raise BuildError, "Template %r not found on sys.path" % (template,) file = file.as_pathname() return file - -def process(template, filename, destname, copy_codefragment=0, + +def process(template, filename, destname, copy_codefragment=0, rsrcname=None, others=[], raw=0, progress="default"): - + if progress == "default": progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120) progress.label("Compiling...") @@ -72,7 +72,7 @@ def process(template, filename, destname, copy_codefragment=0, raise BuildError, "BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename # Read the source and compile it # (there's no point overwriting the destination if it has a syntax error) - + fp = open(filename, 'rU') text = fp.read() fp.close() @@ -82,17 +82,17 @@ def process(template, filename, destname, copy_codefragment=0, raise BuildError, "Syntax error in script %s: %s" % (filename, arg) except EOFError: raise BuildError, "End-of-file in script %s" % (filename,) - + # Set the destination file name. Note that basename # does contain the whole filepath, only a .py is stripped. - + if string.lower(filename[-3:]) == ".py": basename = filename[:-3] if MacOS.runtimemodel != 'macho' and not destname: destname = basename else: basename = filename - + if not destname: if MacOS.runtimemodel == 'macho': destname = basename + '.app' @@ -100,16 +100,16 @@ def process(template, filename, destname, copy_codefragment=0, destname = basename + '.applet' if not rsrcname: rsrcname = basename + '.rsrc' - + # Try removing the output file. This fails in MachO, but it should # do any harm. try: os.remove(destname) except os.error: pass - process_common(template, progress, code, rsrcname, destname, 0, + process_common(template, progress, code, rsrcname, destname, 0, copy_codefragment, raw, others, filename) - + def update(template, filename, output): if MacOS.runtimemodel == 'macho': @@ -120,7 +120,7 @@ def update(template, filename, output): progress = None if not output: output = filename + ' (updated)' - + # Try removing the output file try: os.remove(output) @@ -129,7 +129,7 @@ def update(template, filename, output): process_common(template, progress, None, filename, output, 1, 1) -def process_common(template, progress, code, rsrcname, destname, is_update, +def process_common(template, progress, code, rsrcname, destname, is_update, copy_codefragment, raw=0, others=[], filename=None): if MacOS.runtimemodel == 'macho': return process_common_macho(template, progress, code, rsrcname, destname, @@ -139,12 +139,12 @@ def process_common(template, progress, code, rsrcname, destname, is_update, # Create FSSpecs for the various files template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1) template = template_fsr.as_pathname() - + # Copy data (not resources, yet) from the template if progress: progress.label("Copy data fork...") progress.set(10) - + if copy_codefragment: tmpl = open(template, "rb") dest = open(destname, "wb") @@ -155,9 +155,9 @@ def process_common(template, progress, code, rsrcname, destname, is_update, tmpl.close() del dest del tmpl - + # Open the output resource fork - + if progress: progress.label("Copy resources...") progress.set(20) @@ -167,7 +167,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update, destdir, destfile = os.path.split(destname) Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME) output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) - + # Copy the resources from the target specific resource template, if any typesfound, ownertype = [], None try: @@ -183,27 +183,27 @@ def process_common(template, progress, code, rsrcname, destname, is_update, skip_oldfile = [] typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress) Res.CloseResFile(input) - + # Check which resource-types we should not copy from the template skiptypes = [] if 'vers' in typesfound: skiptypes.append('vers') if 'SIZE' in typesfound: skiptypes.append('SIZE') - if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', + if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] if not copy_codefragment: skiptypes.append('cfrg') ## skipowner = (ownertype <> None) - + # Copy the resources from the template - + input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ) dummy, tmplowner = copyres(input, output, skiptypes, 1, progress) - + Res.CloseResFile(input) ## if ownertype == None: ## raise BuildError, "No owner resource found in either resource file or template" # Make sure we're manipulating the output resource file now - + Res.UseResFile(output) if ownertype == None: @@ -213,27 +213,27 @@ def process_common(template, progress, code, rsrcname, destname, is_update, newres = Res.Resource('\0') newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource") ownertype = DEFAULT_APPLET_CREATOR - + if code: # Delete any existing 'PYC ' resource named __main__ - + try: res = Res.Get1NamedResource(RESTYPE, RESNAME) res.RemoveResource() except Res.Error: pass - + # Create the raw data for the resource from the code object if progress: progress.label("Write PYC resource...") progress.set(120) - + data = marshal.dumps(code) del code data = (MAGIC + '\0\0\0\0') + data - + # Create the resource and write it - + id = 0 while id < 128: id = Res.Unique1ID(RESTYPE) @@ -244,11 +244,11 @@ def process_common(template, progress, code, rsrcname, destname, is_update, res.SetResAttrs(attrs) res.WriteResource() res.ReleaseResource() - + # Close the output file - + Res.CloseResFile(output) - + # Now set the creator, type and bundle bit of the destination. # Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+) dest_fss = Carbon.File.FSSpec(destname) @@ -258,13 +258,13 @@ def process_common(template, progress, code, rsrcname, destname, is_update, dest_finfo.Flags = dest_finfo.Flags | Carbon.Files.kHasBundle | Carbon.Files.kIsShared dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited dest_fss.FSpSetFInfo(dest_finfo) - + macostools.touched(destname) if progress: progress.label("Done.") progress.inc(0) -def process_common_macho(template, progress, code, rsrcname, destname, is_update, +def process_common_macho(template, progress, code, rsrcname, destname, is_update, raw=0, others=[], filename=None): # Check that we have a filename if filename is None: @@ -304,7 +304,7 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update builder.name = shortname if rsrcname: realrsrcname = macresource.resource_pathname(rsrcname) - builder.files.append((realrsrcname, + builder.files.append((realrsrcname, os.path.join('Contents/Resources', os.path.basename(rsrcname)))) for o in others: if type(o) == str: @@ -320,10 +320,10 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update builder.argv_emulation = 1 builder.setup() builder.build() - if progress: + if progress: progress.label('Done.') progress.inc(0) - + ## macostools.touched(dest_fss) # Copy resources between two resource file descriptors. @@ -406,7 +406,7 @@ def copyapptree(srctree, dsttree, exceptlist=[], progress=None): progress.label('Copy '+this) progress.inc(0) shutil.copy2(srcpath, dstpath) - + def writepycfile(codeobject, cfile): import marshal fc = open(cfile, 'wb') @@ -417,4 +417,3 @@ def writepycfile(codeobject, cfile): fc.seek(0, 0) fc.write(MAGIC) fc.close() - diff --git a/Lib/plat-mac/cfmfile.py b/Lib/plat-mac/cfmfile.py index 317046a..fd1a3e8 100644 --- a/Lib/plat-mac/cfmfile.py +++ b/Lib/plat-mac/cfmfile.py @@ -18,19 +18,19 @@ error = "cfm.error" BUFSIZE = 0x80000 def mergecfmfiles(srclist, dst, architecture = 'fat'): - """Merge all files in srclist into a new file dst. - + """Merge all files in srclist into a new file dst. + If architecture is given, only code fragments of that type will be used: "pwpc" for PPC, "m68k" for cfm68k. This does not work for "classic" 68k code, since it does not use code fragments to begin with. If architecture is None, all fragments will be used, enabling FAT binaries. """ - + srclist = list(srclist) for i in range(len(srclist)): srclist[i] = Carbon.File.pathname(srclist[i]) dst = Carbon.File.pathname(dst) - + dstfile = open(dst, "wb") rf = Res.FSpOpenResFile(dst, 3) try: @@ -43,9 +43,9 @@ def mergecfmfiles(srclist, dst, architecture = 'fat'): if frag.architecture == 'm68k' and architecture == 'pwpc': continue dstcfrg.append(frag) - + frag.copydata(dstfile) - + cfrgres = Res.Resource(dstcfrg.build()) Res.UseResFile(rf) cfrgres.AddResource('cfrg', 0, "") @@ -55,7 +55,7 @@ def mergecfmfiles(srclist, dst, architecture = 'fat'): class CfrgResource: - + def __init__(self, path = None): self.version = 1 self.fragments = [] @@ -74,43 +74,43 @@ class CfrgResource: Res.UseResFile(currentresref) self.parse(data) if self.version <> 1: - raise error, "unknown 'cfrg' resource format" - + raise error, "unknown 'cfrg' resource format" + def parse(self, data): - (res1, res2, self.version, - res3, res4, res5, res6, + (res1, res2, self.version, + res3, res4, res5, res6, self.memberCount) = struct.unpack("8l", data[:32]) data = data[32:] while data: frag = FragmentDescriptor(self.path, data) data = data[frag.memberSize:] self.fragments.append(frag) - + def build(self): self.memberCount = len(self.fragments) data = struct.pack("8l", 0, 0, self.version, 0, 0, 0, 0, self.memberCount) for frag in self.fragments: data = data + frag.build() return data - + def append(self, frag): self.fragments.append(frag) class FragmentDescriptor: - + def __init__(self, path, data = None): self.path = path if data is not None: self.parse(data) - + def parse(self, data): self.architecture = data[:4] - ( self.updatelevel, - self.currentVersion, - self.oldDefVersion, + ( self.updatelevel, + self.currentVersion, + self.oldDefVersion, self.stacksize, - self.applibdir, + self.applibdir, self.fragtype, self.where, self.offset, @@ -119,15 +119,15 @@ class FragmentDescriptor: self.memberSize,) = struct.unpack("4lhBB4lh", data[4:42]) pname = data[42:self.memberSize] self.name = pname[1:1+ord(pname[0])] - + def build(self): data = self.architecture data = data + struct.pack("4lhBB4l", - self.updatelevel, - self.currentVersion, - self.oldDefVersion, + self.updatelevel, + self.currentVersion, + self.oldDefVersion, self.stacksize, - self.applibdir, + self.applibdir, self.fragtype, self.where, self.offset, @@ -141,7 +141,7 @@ class FragmentDescriptor: data = data + self.name data = data + '\000' * (self.memberSize - len(data)) return data - + def getfragment(self): if self.where <> 1: raise error, "can't read fragment, unsupported location" @@ -153,7 +153,7 @@ class FragmentDescriptor: frag = f.read() f.close() return frag - + def copydata(self, outfile): if self.where <> 1: raise error, "can't read fragment, unsupported location" @@ -161,17 +161,17 @@ class FragmentDescriptor: if self.length == 0: infile.seek(0, 2) self.length = infile.tell() - + # Position input file and record new offset from output file infile.seek(self.offset) - + # pad to 16 byte boundaries offset = outfile.tell() if offset % 16: offset = offset + 16 - (offset % 16) outfile.seek(offset) self.offset = offset - + l = self.length while l: if l > BUFSIZE: @@ -181,4 +181,3 @@ class FragmentDescriptor: outfile.write(infile.read(l)) l = 0 infile.close() - diff --git a/Lib/plat-mac/findertools.py b/Lib/plat-mac/findertools.py index b3223bd..54b1bde 100644 --- a/Lib/plat-mac/findertools.py +++ b/Lib/plat-mac/findertools.py @@ -34,22 +34,22 @@ def _getfinder(): global _finder_talker if not _finder_talker: _finder_talker = Finder.Finder() - _finder_talker.send_flags = ( _finder_talker.send_flags | + _finder_talker.send_flags = ( _finder_talker.send_flags | AppleEvents.kAECanInteract | AppleEvents.kAECanSwitchLayer) return _finder_talker - + def launch(file): """Open a file thru the finder. Specify file by name or fsspec""" finder = _getfinder() fss = Carbon.File.FSSpec(file) return finder.open(fss) - + def Print(file): """Print a file thru the finder. Specify file by name or fsspec""" finder = _getfinder() fss = Carbon.File.FSSpec(file) return finder._print(fss) - + def copy(src, dstdir): """Copy a file to a folder""" finder = _getfinder() @@ -73,17 +73,17 @@ def move(src, dstdir): src_fss = Carbon.File.FSSpec(src) dst_fss = Carbon.File.FSSpec(dstdir) return finder.move(src_fss, to=dst_fss) - + def sleep(): """Put the mac to sleep""" finder = _getfinder() finder.sleep() - + def shutdown(): """Shut the mac down""" finder = _getfinder() finder.shut_down() - + def restart(): """Restart the mac""" finder = _getfinder() @@ -100,16 +100,16 @@ def reveal(file): fsr = Carbon.File.FSRef(file) file_alias = fsr.FSNewAliasMinimal() return finder.reveal(file_alias) - + def select(file): """select a file in the finder. Specify file by name, fsref or fsspec.""" finder = _getfinder() fsr = Carbon.File.FSRef(file) file_alias = fsr.FSNewAliasMinimal() return finder.select(file_alias) - + def update(file): - """Update the display of the specified object(s) to match + """Update the display of the specified object(s) to match their on-disk representation. Specify file by name, fsref or fsspec.""" finder = _getfinder() fsr = Carbon.File.FSRef(file) @@ -129,7 +129,7 @@ def comment(object, comment=None): return _getcomment(object_alias) else: return _setcomment(object_alias, comment) - + def _setcomment(object_alias, comment): finder = _getfinder() args = {} @@ -219,11 +219,11 @@ def isactiveprocess(processname): if n == processname: return 1 return 0 - + def processinfo(processname): """Return an object with all process properties as attributes for processname. MacOS9""" p = _process() - + if processname == "Finder": p.partition = None p.used = None @@ -238,7 +238,7 @@ def processinfo(processname): p.accepthighlevel = _processproperty(processname, 'revt') #Is the process high-level event aware (accepts open application, open document, print document, and quit)? p.hasscripting = _processproperty(processname, 'hscr') #Does the process have a scripting terminology, i.e., can it be scripted? return p - + def _processproperty(processname, property): """return the partition size and memory used for processname""" finder = _getfinder() @@ -256,7 +256,7 @@ def _processproperty(processname, property): #--------------------------------------------------- # Mess around with Finder windows. - + def openwindow(object): """Open a Finder window for object, Specify object by name or fsspec.""" finder = _getfinder() @@ -271,7 +271,7 @@ def openwindow(object): _reply, args, attrs = finder.send(_code, _subcode, args, attrs) if args.has_key('errn'): raise Error, aetools.decodeerror(args) - + def closewindow(object): """Close a Finder window for folder, Specify by path.""" finder = _getfinder() @@ -295,7 +295,7 @@ def location(object, pos=None): if not pos: return _getlocation(object_alias) return _setlocation(object_alias, pos) - + def _setlocation(object_alias, (x, y)): """_setlocation: Set the location of the icon for the object.""" finder = _getfinder() @@ -309,7 +309,7 @@ def _setlocation(object_alias, (x, y)): if args.has_key('errn'): raise Error, aetools.decodeerror(args) return (x,y) - + def _getlocation(object_alias): """_getlocation: get the location of the icon for the object.""" finder = _getfinder() @@ -334,7 +334,7 @@ def label(object, index=None): if index < 0 or index > 7: index = 0 return _setlabel(object_alias, index) - + def _getlabel(object_alias): """label: Get the label for the object.""" finder = _getfinder() @@ -378,7 +378,7 @@ def windowview(folder, view=None): if view == None: return _getwindowview(folder_alias) return _setwindowview(folder_alias, view) - + def _setwindowview(folder_alias, view=0): """set the windowview""" attrs = {} @@ -390,13 +390,13 @@ def _setwindowview(folder_alias, view=0): else: _v = aetypes.Type('iimg') finder = _getfinder() - aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'), + aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'), form = 'alis', seld = folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), + aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), form = 'prop', seld = aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), + aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), form = 'prop', seld = aetypes.Type('pvew'), fr=aeobj_1) - aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), + aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), form = 'prop', seld = _v, fr=None) _code = 'core' _subcode = 'setd' @@ -437,7 +437,7 @@ def windowsize(folder, size=None): if not size: return _getwindowsize(folder_alias) return _setwindowsize(folder_alias, size) - + def _setwindowsize(folder_alias, (w, h)): """Set the size of a Finder window for folder to (w, h)""" finder = _getfinder() @@ -448,9 +448,9 @@ def _setwindowsize(folder_alias, (w, h)): aevar00 = [w, h] aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1) args['----'] = aeobj_2 args["data"] = aevar00 @@ -458,17 +458,17 @@ def _setwindowsize(folder_alias, (w, h)): if args.has_key('errn'): raise Error, aetools.decodeerror(args) return (w, h) - + def _getwindowsize(folder_alias): """Set the size of a Finder window for folder to (w, h)""" finder = _getfinder() args = {} attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), + aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_1) args['----'] = aeobj_2 _reply, args, attrs = finder.send('core', 'getd', args, attrs) @@ -488,17 +488,17 @@ def windowposition(folder, pos=None): # pos might be a QDPoint object as returned by _getwindowposition pos = (pos.h, pos.v) return _setwindowposition(folder_alias, pos) - + def _setwindowposition(folder_alias, (x, y)): """Set the size of a Finder window for folder to (w, h).""" finder = _getfinder() args = {} attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), + aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('posn'), fr=aeobj_1) args['----'] = aeobj_2 args["data"] = [x, y] @@ -513,11 +513,11 @@ def _getwindowposition(folder_alias): finder = _getfinder() args = {} attrs = {} - aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), + aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) - aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0) - aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1) args['----'] = aeobj_2 _reply, args, attrs = finder.send('core', 'getd', args, attrs) @@ -536,15 +536,15 @@ def icon(object, icondata=None): if icondata == None: return _geticon(object_alias) return _seticon(object_alias, icondata) - + def _geticon(object_alias): """get the icondata for object. Binary data of some sort.""" finder = _getfinder() args = {} attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), + aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00) args['----'] = aeobj_01 _reply, args, attrs = finder.send("core", "getd", args, attrs) @@ -558,9 +558,9 @@ def _seticon(object_alias, icondata): finder = _getfinder() args = {} attrs = {} - aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), + aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), form="alis", seld=object_alias, fr=None) - aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), + aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00) args['----'] = aeobj_01 args["data"] = icondata @@ -573,7 +573,7 @@ def _seticon(object_alias, icondata): #--------------------------------------------------- # Volumes and servers. - + def mountvolume(volume, server=None, username=None, password=None): """mount a volume, local or on a server on AppleTalk. Note: mounting a ASIP server requires a different operation. @@ -598,7 +598,7 @@ def mountvolume(volume, server=None, username=None, password=None): def unmountvolume(volume): """unmount a volume that's on the desktop""" putaway(volume) - + def putaway(object): """puth the object away, whereever it came from.""" finder = _getfinder() @@ -675,7 +675,7 @@ def filesharing(): if args['----'] == 1: status = 0 return status - + def movetotrash(path): """move the object to the trash""" fss = Carbon.File.FSSpec(path) @@ -766,7 +766,7 @@ def _test2(): # set the soundvolume in a simple way print '\tSystem beep volume' for i in range(0, 7): - volumelevel(i) + volumelevel(i) MacOS.SysBeep() # Finder's windows, file location, file attributes @@ -805,7 +805,7 @@ def _test2(): print '\t', comment(f) # print the Finder comment this file has s = 'This is a comment no one reads!' comment(f, s) # set the Finder comment - + def _test3(): print 'MacOS9 or better specific functions' # processes @@ -813,7 +813,7 @@ def _test3(): print 'Return a list of current active processes:' for p in pr: print '\t', p - + # get attributes of the first process in the list print 'Attributes of the first process in the list:' pinfo = processinfo(pr[0][0]) @@ -829,4 +829,3 @@ if __name__ == '__main__': _test() _test2() _test3() - diff --git a/Lib/plat-mac/gensuitemodule.py b/Lib/plat-mac/gensuitemodule.py index ab3c070..87132c5 100644 --- a/Lib/plat-mac/gensuitemodule.py +++ b/Lib/plat-mac/gensuitemodule.py @@ -31,7 +31,7 @@ DEFAULT_USER_PACKAGEFOLDER=distutils.sysconfig.get_python_lib() def usage(): sys.stderr.write("Usage: %s [opts] application-or-resource-file\n" % sys.argv[0]) sys.stderr.write("""Options: ---output pkgdir Pathname of the output package (short: -o) +--output pkgdir Pathname of the output package (short: -o) --resource Parse resource file in stead of launching application (-r) --base package Use another base package in stead of default StdSuites (-b) --edit old=new Edit suite names, use empty new to skip a suite (-e) @@ -49,7 +49,7 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.GetoptError: usage() - + process_func = processfile basepkgname = 'StdSuites' output = None @@ -57,7 +57,7 @@ def main(): creatorsignature = None dump = None verbose = None - + for o, a in opts: if o in ('-r', '--resource'): process_func = processfile_fromresource @@ -79,19 +79,19 @@ def main(): dump = sys.stdout if o in ('-v', '--verbose'): verbose = sys.stderr - - + + if output and len(args) > 1: sys.stderr.write("%s: cannot specify --output with multiple inputs\n" % sys.argv[0]) sys.exit(1) - + for filename in args: - process_func(filename, output=output, basepkgname=basepkgname, + process_func(filename, output=output, basepkgname=basepkgname, edit_modnames=edit_modnames, creatorsignature=creatorsignature, dump=dump, verbose=verbose) else: main_interactive() - + def main_interactive(interact=0, basepkgname='StdSuites'): if interact: # Ask for save-filename for each module @@ -119,7 +119,7 @@ def main_interactive(interact=0, basepkgname='StdSuites'): print "Retry, manually parsing resources" processfile_fromresource(filename, edit_modnames=edit_modnames, basepkgname=basepkgname, verbose=sys.stderr) - + def is_scriptable(application): """Return true if the application is scriptable""" if os.path.isdir(application): @@ -141,7 +141,7 @@ def is_scriptable(application): UseResFile(currf) return n_terminology > 0 -def processfile_fromresource(fullname, output=None, basepkgname=None, +def processfile_fromresource(fullname, output=None, basepkgname=None, edit_modnames=None, creatorsignature=None, dump=None, verbose=None): """Process all resources in a single file""" if not is_scriptable(fullname) and verbose: @@ -159,7 +159,7 @@ def processfile_fromresource(fullname, output=None, basepkgname=None, for i in range(Count1Resources('aeut')): res = Get1IndResource('aeut', 1+i) resources.append(res) - if verbose: + if verbose: print >>verbose, "\nLISTING aete+aeut RESOURCES IN", repr(fullname) aetelist = [] for res in resources: @@ -176,11 +176,11 @@ def processfile_fromresource(fullname, output=None, basepkgname=None, UseResFile(cur) if dump: dumpaetelist(aetelist, dump) - compileaetelist(aetelist, fullname, output=output, + compileaetelist(aetelist, fullname, output=output, basepkgname=basepkgname, edit_modnames=edit_modnames, creatorsignature=creatorsignature, verbose=verbose) -def processfile(fullname, output=None, basepkgname=None, +def processfile(fullname, output=None, basepkgname=None, edit_modnames=None, creatorsignature=None, dump=None, verbose=None): """Ask an application for its terminology and process that""" @@ -204,7 +204,7 @@ def processfile(fullname, output=None, basepkgname=None, if verbose: print >>verbose, "Launched", fullname raw = aetools.unpack(aedescobj) - if not raw: + if not raw: if verbose: print >>verbose, 'Unpack returned empty value:', raw return @@ -218,9 +218,9 @@ def processfile(fullname, output=None, basepkgname=None, dumpaetelist([aete], dump) return compileaete(aete, None, fullname, output=output, basepkgname=basepkgname, - creatorsignature=creatorsignature, edit_modnames=edit_modnames, + creatorsignature=creatorsignature, edit_modnames=edit_modnames, verbose=verbose) - + def getappterminology(fullname, verbose=None): """Get application terminology by sending an AppleEvent""" # First check that we actually can send AppleEvents @@ -251,19 +251,19 @@ def getappterminology(fullname, verbose=None): #reply2 = talker.send("ascr", "gdut") # Now pick the bits out of the return that we need. return reply[1]['----'], cr - -def compileaetelist(aetelist, fullname, output=None, basepkgname=None, + +def compileaetelist(aetelist, fullname, output=None, basepkgname=None, edit_modnames=None, creatorsignature=None, verbose=None): for aete, resinfo in aetelist: - compileaete(aete, resinfo, fullname, output=output, + compileaete(aete, resinfo, fullname, output=output, basepkgname=basepkgname, edit_modnames=edit_modnames, creatorsignature=creatorsignature, verbose=verbose) def dumpaetelist(aetelist, output): import pprint pprint.pprint(aetelist, output) - + def decode(data, verbose=None): """Decode a resource into a python data structure""" f = StringIO.StringIO(data) @@ -427,7 +427,7 @@ getaete = [ (getlist, "suites", getsuite) ] -def compileaete(aete, resinfo, fname, output=None, basepkgname=None, +def compileaete(aete, resinfo, fname, output=None, basepkgname=None, edit_modnames=None, creatorsignature=None, verbose=None): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete @@ -500,7 +500,7 @@ def compileaete(aete, resinfo, fname, output=None, basepkgname=None, fp.write("}\n\n") for code, modname in suitelist: fp.write("from %s import *\n"%modname) - + # Generate property dicts and element dicts for all types declared in this module fp.write("\ndef getbaseclasses(v):\n") fp.write(" if not getattr(v, '_propdict', None):\n") @@ -534,7 +534,7 @@ def compileaete(aete, resinfo, fname, output=None, basepkgname=None, application_class = v fp.write("}\n") - + if suitelist: fp.write("\n\nclass %s(%s_Events"%(packagename, suitelist[0][1])) for code, modname in suitelist[1:]: @@ -554,22 +554,22 @@ class SuiteCompiler: self.edit_modnames = edit_modnames self.output = output self.verbose = verbose - + # Set by precompilesuite self.pathname = None self.modname = None - + # Set by compilesuite self.fp = None self.basemodule = None self.enumsneeded = {} - + def precompilesuite(self): """Parse a single suite without generating the output. This step is needed so we can resolve recursive references by suites to enums/comps/etc declared in other suites""" [name, desc, code, level, version, events, classes, comps, enums] = self.suite - + modname = identify(name) if len(modname) > 28: modname = modname[:27] @@ -586,9 +586,9 @@ class SuiteCompiler: self.pathname = None if not self.pathname: return None, None, None - + self.modname = os.path.splitext(os.path.split(self.pathname)[1])[0] - + if self.basepackage and self.basepackage._code_to_module.has_key(code): # We are an extension of a baseclass (usually an application extending # Standard_Suite or so). Import everything from our base module @@ -596,11 +596,11 @@ class SuiteCompiler: else: # We are not an extension. basemodule = None - + self.enumsneeded = {} for event in events: self.findenumsinevent(event) - + objc = ObjectCompiler(None, self.modname, basemodule, interact=(self.edit_modnames is None), verbose=self.verbose) for cls in classes: @@ -611,16 +611,16 @@ class SuiteCompiler: objc.compilecomparison(comp) for enum in enums: objc.compileenumeration(enum) - + for enum in self.enumsneeded.keys(): objc.checkforenum(enum) - + objc.dumpindex() - + precompinfo = objc.getprecompinfo(self.modname) - + return code, self.modname, precompinfo - + def compilesuite(self, major, minor, language, script, fname, precompinfo): """Generate code for a single suite""" [name, desc, code, level, version, events, classes, comps, enums] = self.suite @@ -637,22 +637,22 @@ class SuiteCompiler: # This is a synonym, the other one is better return 1 return 0 - + events.sort() classes.sort(class_sorter) comps.sort() enums.sort() - + self.fp = fp = open(self.pathname, 'w') MacOS.SetCreatorAndType(self.pathname, 'Pyth', 'TEXT') - + fp.write('"""Suite %s: %s\n' % (ascii(name), ascii(desc))) fp.write("Level %d, version %d\n\n" % (level, version)) fp.write("Generated from %s\n"%ascii(fname)) fp.write("AETE/AEUT resource version %d/%d, language %d, script %d\n" % \ (major, minor, language, script)) fp.write('"""\n\n') - + fp.write('import aetools\n') fp.write('import MacOS\n\n') fp.write("_code = %r\n\n"% (code,)) @@ -670,14 +670,14 @@ class SuiteCompiler: basemodule = None self.basemodule = basemodule self.compileclassheader() - + self.enumsneeded = {} if events: for event in events: self.compileevent(event) else: fp.write(" pass\n\n") - + objc = ObjectCompiler(fp, self.modname, basemodule, precompinfo, interact=(self.edit_modnames is None), verbose=self.verbose) for cls in classes: @@ -688,12 +688,12 @@ class SuiteCompiler: objc.compilecomparison(comp) for enum in enums: objc.compileenumeration(enum) - + for enum in self.enumsneeded.keys(): objc.checkforenum(enum) - + objc.dumpindex() - + def compileclassheader(self): """Generate class boilerplate""" classname = '%s_Events'%self.modname @@ -703,7 +703,7 @@ class SuiteCompiler: self.fp.write("class %s(%s):\n\n"%(classname, baseclassname)) else: self.fp.write("class %s:\n\n"%classname) - + def compileevent(self, event): """Generate code for a single event""" [name, desc, code, subcode, returns, accepts, arguments] = event @@ -717,13 +717,13 @@ class SuiteCompiler: for a in arguments: fp.write(" %r : %r,\n"%(identify(a[0]), a[1])) fp.write(" }\n\n") - + # # Generate function header # has_arg = (not is_null(accepts)) opt_arg = (has_arg and is_optional(accepts)) - + fp.write(" def %s(self, "%funcname) if has_arg: if not opt_arg: @@ -803,7 +803,7 @@ class SuiteCompiler: fp.write(" # XXXX Should do enum remapping here...\n") fp.write(" return _arguments['----']\n") fp.write("\n") - + def findenumsinevent(self, event): """Find all enums for a single event""" [name, desc, code, subcode, returns, accepts, arguments] = event @@ -812,7 +812,7 @@ class SuiteCompiler: ename = a[2][0] if ename <> '****': self.enumsneeded[ename] = 1 - + # # This class stores the code<->name translations for a single module. It is used # to keep the information while we're compiling the module, but we also keep these objects @@ -821,7 +821,7 @@ class SuiteCompiler: # hand. # class CodeNameMapper: - + def __init__(self, interact=1, verbose=None): self.code2name = { "property" : {}, @@ -839,21 +839,21 @@ class CodeNameMapper: self.star_imported = 0 self.can_interact = interact self.verbose = verbose - + def addnamecode(self, type, name, code): self.name2code[type][name] = code if not self.code2name[type].has_key(code): self.code2name[type][code] = name - + def hasname(self, name): for dict in self.name2code.values(): if dict.has_key(name): return True return False - + def hascode(self, type, code): return self.code2name[type].has_key(code) - + def findcodename(self, type, code): if not self.hascode(type, code): return None, None, None @@ -863,10 +863,10 @@ class CodeNameMapper: else: qualname = name return name, qualname, self.modulename - + def getall(self, type): return self.code2name[type].items() - + def addmodule(self, module, name, star_imported): self.modulename = name self.star_imported = star_imported @@ -878,14 +878,14 @@ class CodeNameMapper: self.addnamecode('enum', '_Enum_'+identify(code), code) for code, name in module._compdeclarations.items(): self.addnamecode('comparison', name, code) - + def prepareforexport(self, name=None): if not self.modulename: self.modulename = name return self - + class ObjectCompiler: - def __init__(self, fp, modname, basesuite, othernamemappers=None, interact=1, + def __init__(self, fp, modname, basesuite, othernamemappers=None, interact=1, verbose=None): self.fp = fp self.verbose = verbose @@ -901,7 +901,7 @@ class ObjectCompiler: basemapper = CodeNameMapper(self.can_interact, self.verbose) basemapper.addmodule(basesuite, '', 1) self.namemappers.append(basemapper) - + def getprecompinfo(self, modname): list = [] for mapper in self.namemappers: @@ -909,7 +909,7 @@ class ObjectCompiler: if emapper: list.append(emapper) return list - + def findcodename(self, type, code): while 1: # First try: check whether we already know about this code. @@ -935,7 +935,7 @@ class ObjectCompiler: mapper = CodeNameMapper(self.can_interact, self.verbose) mapper.addmodule(m, m.__name__, 0) self.namemappers.append(mapper) - + def hasname(self, name): for mapper in self.othernamemappers: if mapper.hasname(name) and mapper.modulename != self.modulename: @@ -943,7 +943,7 @@ class ObjectCompiler: print >>self.verbose, "Duplicate Python identifier:", name, self.modulename, mapper.modulename return True return False - + def askdefinitionmodule(self, type, code): if not self.can_interact: if self.verbose: @@ -958,7 +958,7 @@ class ObjectCompiler: m = __import__(modname) self.fp.write("import %s\n"%modname) return m - + def compileclass(self, cls): [name, code, desc, properties, elements] = cls pname = identify(name) @@ -980,7 +980,7 @@ class ObjectCompiler: elements.sort() for elem in elements: self.compileelement(elem) - + def compileproperty(self, prop, is_application_class=False): [name, code, what] = prop if code == 'c@#!': @@ -1003,7 +1003,7 @@ class ObjectCompiler: self.namemappers[0].addnamecode('property', pname, code) if is_application_class and self.fp: self.fp.write("%s = _Prop_%s()\n" % (pname, pname)) - + def compileelement(self, elem): [code, keyform] = elem if self.fp: @@ -1056,10 +1056,10 @@ class ObjectCompiler: self.fp.write("# XXXX %s element %r not found!!\n"%(cname, ecode)) else: elist.append((name, ename)) - + plist.sort() elist.sort() - + if self.fp: self.fp.write("%s._privpropdict = {\n"%cname) for n in plist: @@ -1069,7 +1069,7 @@ class ObjectCompiler: for n, fulln in elist: self.fp.write(" '%s' : %s,\n"%(n, fulln)) self.fp.write("}\n") - + def compilecomparison(self, comp): [name, code, comment] = comp iname = identify(name) @@ -1077,7 +1077,7 @@ class ObjectCompiler: if self.fp: self.fp.write("class %s(aetools.NComparison):\n" % iname) self.fp.write(' """%s - %s """\n' % (ascii(name), ascii(comment))) - + def compileenumeration(self, enum): [code, items] = enum name = "_Enum_%s" % identify(code) @@ -1088,11 +1088,11 @@ class ObjectCompiler: self.fp.write("}\n\n") self.namemappers[0].addnamecode('enum', name, code) return code - + def compileenumerator(self, item): [name, code, desc] = item self.fp.write(" %r : %r,\t# %s\n" % (identify(name), code, ascii(desc))) - + def checkforenum(self, enum): """This enum code is used by an event. Make sure it's available""" name, fullname, module = self.findcodename('enum', enum) @@ -1103,33 +1103,33 @@ class ObjectCompiler: if module: if self.fp: self.fp.write("from %s import %s\n"%(module, name)) - + def dumpindex(self): if not self.fp: return self.fp.write("\n#\n# Indices of types declared in this module\n#\n") - + self.fp.write("_classdeclarations = {\n") classlist = self.namemappers[0].getall('class') classlist.sort() for k, v in classlist: self.fp.write(" %r : %s,\n" % (k, v)) self.fp.write("}\n") - + self.fp.write("\n_propdeclarations = {\n") proplist = self.namemappers[0].getall('property') proplist.sort() for k, v in proplist: self.fp.write(" %r : _Prop_%s,\n" % (k, v)) self.fp.write("}\n") - + self.fp.write("\n_compdeclarations = {\n") complist = self.namemappers[0].getall('comparison') complist.sort() for k, v in complist: self.fp.write(" %r : %s,\n" % (k, v)) self.fp.write("}\n") - + self.fp.write("\n_enumdeclarations = {\n") enumlist = self.namemappers[0].getall('enum') enumlist.sort() @@ -1140,16 +1140,16 @@ class ObjectCompiler: def compiledata(data): [type, description, flags] = data return "%r -- %r %s" % (type, description, compiledataflags(flags)) - + def is_null(data): return data[0] == 'null' - + def is_optional(data): return (data[2] & 0x8000) - + def is_enum(data): return (data[2] & 0x2000) - + def getdatadoc(data): [type, descr, flags] = data if descr: @@ -1170,7 +1170,7 @@ def compiledataflags(flags): else: bits.append(repr(i)) return '[%s]' % string.join(bits) - + def ascii(str): """Return a string with all non-ascii characters hex-encoded""" if type(str) != type(''): @@ -1182,7 +1182,7 @@ def ascii(str): else: rv = rv + '\\' + 'x%02.2x' % ord(c) return rv - + def identify(str): """Turn any string into an identifier: - replace space by _ diff --git a/Lib/plat-mac/ic.py b/Lib/plat-mac/ic.py index 3236805..6575336 100644 --- a/Lib/plat-mac/ic.py +++ b/Lib/plat-mac/ic.py @@ -38,7 +38,7 @@ class ICOpaqueData: return "ICOpaqueData(%r)"%(self.data,) _ICOpaqueDataType=type(ICOpaqueData('')) - + def _decode_default(data, key): if len(data) == 0: return data @@ -46,8 +46,8 @@ def _decode_default(data, key): # Assume Pstring return data[1:] return ICOpaqueData(data) - - + + def _decode_multistr(data, key): numstr = ord(data[0]) << 8 | ord(data[1]) rv = [] @@ -58,54 +58,54 @@ def _decode_multistr(data, key): rv.append(str) ptr = ptr + strlen + 1 return rv - + def _decode_fontrecord(data, key): size = ord(data[0]) << 8 | ord(data[1]) face = ord(data[2]) namelen = ord(data[4]) return size, face, data[5:5+namelen] - + def _decode_boolean(data, key): return ord(data[0]) - + def _decode_text(data, key): return data - + def _decode_charset(data, key): return data[:256], data[256:] - + def _decode_appspec(data, key): namelen = ord(data[4]) return data[0:4], data[5:5+namelen] def _code_default(data, key): return chr(len(data)) + data - + def _code_multistr(data, key): numstr = len(data) rv = chr((numstr>>8) & 0xff) + chr(numstr & 0xff) for i in data: rv = rv + _code_default(i) return rv - + def _code_fontrecord(data, key): size, face, name = data return chr((size>>8) & 0xff) + chr(size & 0xff) + chr(face & 0xff) + \ chr(0) + _code_default(name) - + def _code_boolean(data, key): print 'XXXX boolean:', repr(data) return chr(data) - + def _code_text(data, key): return data - + def _code_charset(data, key): return data[0] + data[1] - + def _code_appspec(data, key): return data[0] + _code_default(data[1]) - + _decoder_table = { "ArchieAll" : (_decode_multistr , _code_multistr), "UMichAll" : (_decode_multistr , _code_multistr), @@ -118,7 +118,7 @@ _decoder_table = { "Plan" : (_decode_text , _code_text), "MailHeaders" : (_decode_text , _code_text), "NewsHeaders" : (_decode_text , _code_text), -# "Mapping" +# "Mapping" "CharacterSet" : (_decode_charset , _code_charset), "Helper\245" : (_decode_appspec , _code_appspec), # "Services" : (_decode_services, ????), @@ -156,7 +156,7 @@ def _code(data, key): else: coder = _code_default return coder(data, key) - + class IC: def __init__(self, signature='Pyth', ic=None): if ic: @@ -166,7 +166,7 @@ class IC: if hasattr(self.ic, 'ICFindConfigFile'): self.ic.ICFindConfigFile() self.h = Res.Resource('') - + def keys(self): rv = [] self.ic.ICBegin(icReadOnlyPerm) @@ -175,32 +175,32 @@ class IC: rv.append(self.ic.ICGetIndPref(i+1)) self.ic.ICEnd() return rv - + def has_key(self, key): return self.__contains__(key) - + def __contains__(self, key): try: dummy = self.ic.ICFindPrefHandle(key, self.h) except icglue.error: return 0 return 1 - + def __getitem__(self, key): attr = self.ic.ICFindPrefHandle(key, self.h) return _decode(self.h.data, key) - + def __setitem__(self, key, value): value = _code(value, key) self.ic.ICSetPref(key, ICattr_no_change, value) - + def launchurl(self, url, hint=""): # Work around a bug in ICLaunchURL: file:/foo does # not work but file:///foo does. if url[:6] == 'file:/' and url[6] != '/': url = 'file:///' + url[6:] self.ic.ICLaunchURL(hint, url, 0, len(url)) - + def parseurl(self, data, start=None, end=None, hint=""): if start == None: selStart = 0 @@ -211,21 +211,21 @@ class IC: selEnd = end selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h) return self.h.data, selStart, selEnd - + def mapfile(self, file): if type(file) != type(''): file = file.as_tuple()[2] return self.ic.ICMapFilename(file) - + def maptypecreator(self, type, creator, filename=""): return self.ic.ICMapTypeCreator(type, creator, filename) - + def settypecreator(self, file): file = Carbon.File.pathname(file) record = self.mapfile(os.path.split(file)[1]) MacOS.SetCreatorAndType(file, record[2], record[1]) macostools.touched(fss) - + # Convenience routines _dft_ic = None @@ -233,27 +233,27 @@ def launchurl(url, hint=""): global _dft_ic if _dft_ic == None: _dft_ic = IC() return _dft_ic.launchurl(url, hint) - + def parseurl(data, start=None, end=None, hint=""): global _dft_ic if _dft_ic == None: _dft_ic = IC() return _dft_ic.parseurl(data, start, end, hint) - + def mapfile(filename): global _dft_ic if _dft_ic == None: _dft_ic = IC() return _dft_ic.mapfile(filename) - + def maptypecreator(type, creator, filename=""): global _dft_ic if _dft_ic == None: _dft_ic = IC() return _dft_ic.maptypecreator(type, creator, filename) - + def settypecreator(file): global _dft_ic if _dft_ic == None: _dft_ic = IC() return _dft_ic.settypecreator(file) - + def _test(): ic = IC() for k in ic.keys(): @@ -263,7 +263,6 @@ def _test(): v = '????' print k, '\t', v sys.exit(1) - + if __name__ == '__main__': _test() - diff --git a/Lib/plat-mac/icopen.py b/Lib/plat-mac/icopen.py index 99e866e..eea6083 100644 --- a/Lib/plat-mac/icopen.py +++ b/Lib/plat-mac/icopen.py @@ -42,18 +42,18 @@ import __builtin__ _builtin_open = globals().get('_builtin_open', __builtin__.open) def _open_with_typer(*args): - file = _builtin_open(*args) - filename = args[0] - mode = 'r' - if args[1:]: - mode = args[1] - if mode[0] == 'w': - from ic import error, settypecreator - try: - settypecreator(filename) - except error: - pass - return file + file = _builtin_open(*args) + filename = args[0] + mode = 'r' + if args[1:]: + mode = args[1] + if mode[0] == 'w': + from ic import error, settypecreator + try: + settypecreator(filename) + except error: + pass + return file __builtin__.open = _open_with_typer diff --git a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py index 033703c..0fd562b 100644 --- a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py +++ b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py @@ -580,44 +580,44 @@ text_document._privelemdict = { 'text' : Standard_Suite.text, } _Enum_DKND = { - 'project' : 'PRJD', # a project document - 'editor_document' : 'EDIT', # an editor document - 'message' : 'MSSG', # a message document - 'file_compare' : 'COMP', # a file compare document - 'catalog_document' : 'CTLG', # a browser catalog - 'class_browser' : 'BROW', # a class browser document - 'single_class_browser' : '1BRW', # a single class browser document - 'symbol_browser' : 'SYMB', # a symbol browser document - 'class_hierarchy' : 'HIER', # a class hierarchy document - 'single_class_hierarchy' : '1HIR', # a single class hierarchy document - 'project_inspector' : 'INSP', # a project inspector - 'ToolServer_worksheet' : 'TOOL', # the ToolServer worksheet - 'build_progress_document' : 'PRGS', # the build progress window + 'project' : 'PRJD', # a project document + 'editor_document' : 'EDIT', # an editor document + 'message' : 'MSSG', # a message document + 'file_compare' : 'COMP', # a file compare document + 'catalog_document' : 'CTLG', # a browser catalog + 'class_browser' : 'BROW', # a class browser document + 'single_class_browser' : '1BRW', # a single class browser document + 'symbol_browser' : 'SYMB', # a symbol browser document + 'class_hierarchy' : 'HIER', # a class hierarchy document + 'single_class_hierarchy' : '1HIR', # a single class hierarchy document + 'project_inspector' : 'INSP', # a project inspector + 'ToolServer_worksheet' : 'TOOL', # the ToolServer worksheet + 'build_progress_document' : 'PRGS', # the build progress window } _Enum_FTYP = { - 'library_file' : 'LIBF', # a library file - 'project_file' : 'PRJF', # a project file - 'resource_file' : 'RESF', # a resource file - 'text_file' : 'TXTF', # a text file - 'unknown_file' : 'UNKN', # unknown file type + 'library_file' : 'LIBF', # a library file + 'project_file' : 'PRJF', # a project file + 'resource_file' : 'RESF', # a resource file + 'text_file' : 'TXTF', # a text file + 'unknown_file' : 'UNKN', # unknown file type } _Enum_Inte = { - 'never_interact' : 'eNvr', # never allow user interactions - 'interact_with_self' : 'eInS', # allow user interaction only when an AppleEvent is sent from within CodeWarrior - 'interact_with_local' : 'eInL', # allow user interaction when AppleEvents are sent from applications on the same machine (default) - 'interact_with_all' : 'eInA', # allow user interaction from both local and remote AppleEvents + 'never_interact' : 'eNvr', # never allow user interactions + 'interact_with_self' : 'eInS', # allow user interaction only when an AppleEvent is sent from within CodeWarrior + 'interact_with_local' : 'eInL', # allow user interaction when AppleEvents are sent from applications on the same machine (default) + 'interact_with_all' : 'eInA', # allow user interaction from both local and remote AppleEvents } _Enum_PERM = { - 'read_write' : 'RdWr', # the file is open with read/write permission - 'read_only' : 'Read', # the file is open with read/only permission - 'checked_out_read_write' : 'CkRW', # the file is checked out with read/write permission - 'checked_out_read_only' : 'CkRO', # the file is checked out with read/only permission - 'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission - 'locked' : 'Lock', # the file is locked on disk - 'none' : 'LNNO', # the file is new + 'read_write' : 'RdWr', # the file is open with read/write permission + 'read_only' : 'Read', # the file is open with read/only permission + 'checked_out_read_write' : 'CkRW', # the file is checked out with read/write permission + 'checked_out_read_only' : 'CkRO', # the file is checked out with read/only permission + 'checked_out_read_modify' : 'CkRM', # the file is checked out with read/modify permission + 'locked' : 'Lock', # the file is locked on disk + 'none' : 'LNNO', # the file is new } diff --git a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py index 3beb089..909cdc0 100644 --- a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py @@ -2025,110 +2025,110 @@ Font._privpropdict = { Font._privelemdict = { } _Enum_Acce = { - 'public' : 'Publ', # - 'protected' : 'Prot', # - 'private' : 'Priv', # + 'public' : 'Publ', # + 'protected' : 'Prot', # + 'private' : 'Priv', # } _Enum_BXbr = { - 'Always_Build' : 'BXb1', # Always build the target before running. - 'Ask_Build' : 'BXb2', # Ask before building the target when running. - 'Never_Build' : 'BXb3', # Never before building the target before running. + 'Always_Build' : 'BXb1', # Always build the target before running. + 'Ask_Build' : 'BXb2', # Ask before building the target when running. + 'Never_Build' : 'BXb3', # Never before building the target before running. } _Enum_DbSA = { - 'No_Action' : 'DSA1', # Don\xd5t do anything to non-debug windows - 'Hide_Windows' : 'DSA2', # Hide non-debugging windows - 'Collapse_Windows' : 'DSA3', # Collapse non-debugging windows - 'Close_Windows' : 'DSA4', # Close non-debugging windows + 'No_Action' : 'DSA1', # Don\xd5t do anything to non-debug windows + 'Hide_Windows' : 'DSA2', # Hide non-debugging windows + 'Collapse_Windows' : 'DSA3', # Collapse non-debugging windows + 'Close_Windows' : 'DSA4', # Close non-debugging windows } _Enum_DgBL = { - 'Always' : 'DgB0', # Always build before debugging. - 'Never' : 'DgB1', # Never build before debugging. - 'Ask' : 'DgB2', # Ask about building before debugging. + 'Always' : 'DgB0', # Always build before debugging. + 'Never' : 'DgB1', # Never build before debugging. + 'Ask' : 'DgB2', # Ask about building before debugging. } _Enum_ErrT = { - 'information' : 'ErIn', # - 'compiler_warning' : 'ErCW', # - 'compiler_error' : 'ErCE', # - 'definition' : 'ErDf', # - 'linker_warning' : 'ErLW', # - 'linker_error' : 'ErLE', # - 'find_result' : 'ErFn', # - 'generic_error' : 'ErGn', # + 'information' : 'ErIn', # + 'compiler_warning' : 'ErCW', # + 'compiler_error' : 'ErCE', # + 'definition' : 'ErDf', # + 'linker_warning' : 'ErLW', # + 'linker_error' : 'ErLE', # + 'find_result' : 'ErFn', # + 'generic_error' : 'ErGn', # } _Enum_Inte = { - 'never_interact' : 'eNvr', # Never allow user interactions - 'interact_with_self' : 'eInS', # Allow user interaction only when an AppleEvent is sent from within CodeWarrior - 'interact_with_local' : 'eInL', # Allow user interaction when AppleEvents are sent from applications on the same machine (default) - 'interact_with_all' : 'eInA', # Allow user interaction from both local and remote AppleEvents + 'never_interact' : 'eNvr', # Never allow user interactions + 'interact_with_self' : 'eInS', # Allow user interaction only when an AppleEvent is sent from within CodeWarrior + 'interact_with_local' : 'eInL', # Allow user interaction when AppleEvents are sent from applications on the same machine (default) + 'interact_with_all' : 'eInA', # Allow user interaction from both local and remote AppleEvents } _Enum_Lang = { - 'C' : 'LC ', # - 'C_2b__2b_' : 'LC++', # - 'Pascal' : 'LP ', # - 'Object_Pascal' : 'LP++', # - 'Java' : 'LJav', # - 'Assembler' : 'LAsm', # - 'Unknown' : 'L? ', # + 'C' : 'LC ', # + 'C_2b__2b_' : 'LC++', # + 'Pascal' : 'LP ', # + 'Object_Pascal' : 'LP++', # + 'Java' : 'LJav', # + 'Assembler' : 'LAsm', # + 'Unknown' : 'L? ', # } _Enum_PPrm = { - 'absolute' : 'Abso', # An absolute path name, including volume name. - 'project_relative' : 'PRel', # A path relative to the current project\xd5s folder. - 'shell_relative' : 'SRel', # A path relative to the CodeWarrior\xaa folder. - 'system_relative' : 'YRel', # A path relative to the system folder - 'root_relative' : 'RRel', # + 'absolute' : 'Abso', # An absolute path name, including volume name. + 'project_relative' : 'PRel', # A path relative to the current project\xd5s folder. + 'shell_relative' : 'SRel', # A path relative to the CodeWarrior\xaa folder. + 'system_relative' : 'YRel', # A path relative to the system folder + 'root_relative' : 'RRel', # } _Enum_PXdg = { - 'Diagnose_None' : 'PXd1', # No Plugin Diagnostics. - 'Diagnose_Errors' : 'PXd2', # Plugin Diagnostics for errors only. - 'Diagnose_All' : 'PXd3', # Plugin Diagnostics for everything. + 'Diagnose_None' : 'PXd1', # No Plugin Diagnostics. + 'Diagnose_Errors' : 'PXd2', # Plugin Diagnostics for errors only. + 'Diagnose_All' : 'PXd3', # Plugin Diagnostics for everything. } _Enum_PthF = { - 'Generic_Path' : 'PFGn', # - 'MacOS_Path' : 'PFMc', # MacOS path using colon as separator - 'Windows_Path' : 'PFWn', # Windows path using backslash as separator - 'Unix_Path' : 'PFUx', # Unix path using slash as separator + 'Generic_Path' : 'PFGn', # + 'MacOS_Path' : 'PFMc', # MacOS path using colon as separator + 'Windows_Path' : 'PFWn', # Windows path using backslash as separator + 'Unix_Path' : 'PFUx', # Unix path using slash as separator } _Enum_RefP = { - 'Think_Reference' : 'DanR', # - 'QuickView' : 'ALTV', # + 'Think_Reference' : 'DanR', # + 'QuickView' : 'ALTV', # } _Enum_STKd = { - 'Absolute_Path' : 'STK0', # The \xd2path\xd3 property is an absolute path to the location of the source tree. - 'Registry_Key' : 'STK1', # The \xd2path\xd3 property is the name of a registry key that contains the path to the root. - 'Environment_Variable' : 'STK2', # The \xd2path\xd3 property is the name of an environment variable that contains the path to the root. + 'Absolute_Path' : 'STK0', # The \xd2path\xd3 property is an absolute path to the location of the source tree. + 'Registry_Key' : 'STK1', # The \xd2path\xd3 property is the name of a registry key that contains the path to the root. + 'Environment_Variable' : 'STK2', # The \xd2path\xd3 property is the name of an environment variable that contains the path to the root. } _Enum_SrcT = { - 'source' : 'FTxt', # A source file (.c, .cp, .p, etc). - 'unknown' : 'FUnk', # An unknown file type. + 'source' : 'FTxt', # A source file (.c, .cp, .p, etc). + 'unknown' : 'FUnk', # An unknown file type. } _Enum_TmpB = { - 'User_Specified' : 'Usrs', # Use user specified symbols when setting temporary breakpoints on program launch. - 'Default' : 'Dflt', # Use system default symbols when setting temporary breakpoints on program launch. + 'User_Specified' : 'Usrs', # Use user specified symbols when setting temporary breakpoints on program launch. + 'Default' : 'Dflt', # Use system default symbols when setting temporary breakpoints on program launch. } _Enum_TxtF = { - 'MacOS' : 'TxF0', # MacOS text format - 'DOS' : 'TxF1', # DOS text format - 'Unix' : 'TxF2', # Unix text format + 'MacOS' : 'TxF0', # MacOS text format + 'DOS' : 'TxF1', # DOS text format + 'Unix' : 'TxF2', # Unix text format } _Enum_savo = { - 'yes' : 'yes ', # Save changes - 'no' : 'no ', # Do not save changes - 'ask' : 'ask ', # Ask the user whether to save + 'yes' : 'yes ', # Save changes + 'no' : 'no ', # Do not save changes + 'ask' : 'ask ', # Ask the user whether to save } diff --git a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Required.py b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Required.py index a2c0de8..b0749e8 100644 --- a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Required.py +++ b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Required.py @@ -40,8 +40,8 @@ class Required_Events(Required_Suite_Events): return _arguments['----'] _Enum_Conv = { - 'yes' : 'yes ', # Convert the project if necessary on open - 'no' : 'no ', # Do not convert the project if needed on open + 'yes' : 'yes ', # Convert the project if necessary on open + 'no' : 'no ', # Do not convert the project if needed on open } diff --git a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py index 43ae404..5ef7ca9 100644 --- a/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/CodeWarrior/__init__.py @@ -187,4 +187,3 @@ class CodeWarrior(CodeWarrior_suite_Events, _signature = 'CWIE' _moduleName = 'CodeWarrior' - diff --git a/Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py b/Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py index e023acd..0a985d1 100644 --- a/Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Explorer/Required_Suite.py @@ -73,7 +73,7 @@ class Required_Suite_Events(Required_Suite_Events): return _arguments['----'] def run(self, _no_object=None, _attributes={}, **_arguments): - """run: + """run: Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'aevt' diff --git a/Lib/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py b/Lib/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py index af68e25..7ead98a 100644 --- a/Lib/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Explorer/Standard_Suite.py @@ -17,7 +17,7 @@ class Standard_Suite_Events: } def get(self, _object, _attributes={}, **_arguments): - """get: + """get: Required argument: an AE object reference Keyword argument as: undocumented, typecode 'type' Keyword argument _attributes: AppleEvent attribute dictionary diff --git a/Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py b/Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py index a05d795..ff808eb 100644 --- a/Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py @@ -84,7 +84,7 @@ class Web_Browser_Suite_Events: """GetWindowInfo: Returns a window info record (URL/Title) for the specified window. Required argument: Window Identifier of the window Keyword argument _attributes: AppleEvent attribute dictionary - Returns: + Returns: """ _code = 'WWW!' _subcode = 'WNFO' diff --git a/Lib/plat-mac/lib-scriptpackages/Finder/Enumerations.py b/Lib/plat-mac/lib-scriptpackages/Finder/Enumerations.py index 38336cc..558d7ff 100644 --- a/Lib/plat-mac/lib-scriptpackages/Finder/Enumerations.py +++ b/Lib/plat-mac/lib-scriptpackages/Finder/Enumerations.py @@ -16,106 +16,106 @@ class Enumerations_Events(Type_Names_Suite_Events): pass _Enum_earr = { - 'not_arranged' : 'narr', # - 'snap_to_grid' : 'grda', # - 'arranged_by_name' : 'nama', # - 'arranged_by_modification_date' : 'mdta', # - 'arranged_by_creation_date' : 'cdta', # - 'arranged_by_size' : 'siza', # - 'arranged_by_kind' : 'kina', # - 'arranged_by_label' : 'laba', # + 'not_arranged' : 'narr', # + 'snap_to_grid' : 'grda', # + 'arranged_by_name' : 'nama', # + 'arranged_by_modification_date' : 'mdta', # + 'arranged_by_creation_date' : 'cdta', # + 'arranged_by_size' : 'siza', # + 'arranged_by_kind' : 'kina', # + 'arranged_by_label' : 'laba', # } _Enum_ecvw = { - 'icon_view' : 'icnv', # - 'list_view' : 'lsvw', # - 'column_view' : 'clvw', # + 'icon_view' : 'icnv', # + 'list_view' : 'lsvw', # + 'column_view' : 'clvw', # } _Enum_edfm = { - 'Mac_OS_format' : 'dfhf', # - 'Mac_OS_Extended_format' : 'dfh+', # - 'UFS_format' : 'dfuf', # - 'NFS_format' : 'dfnf', # - 'audio_format' : 'dfau', # - 'ProDOS_format' : 'dfpr', # - 'MS_2d_DOS_format' : 'dfms', # - 'ISO_9660_format' : 'df96', # - 'High_Sierra_format' : 'dfhs', # - 'QuickTake_format' : 'dfqt', # - 'Apple_Photo_format' : 'dfph', # - 'AppleShare_format' : 'dfas', # - 'UDF_format' : 'dfud', # - 'WebDAV_format' : 'dfwd', # - 'FTP_format' : 'dfft', # - 'Packet_2d_written_UDF_format' : 'dfpu', # - 'unknown_format' : 'df??', # + 'Mac_OS_format' : 'dfhf', # + 'Mac_OS_Extended_format' : 'dfh+', # + 'UFS_format' : 'dfuf', # + 'NFS_format' : 'dfnf', # + 'audio_format' : 'dfau', # + 'ProDOS_format' : 'dfpr', # + 'MS_2d_DOS_format' : 'dfms', # + 'ISO_9660_format' : 'df96', # + 'High_Sierra_format' : 'dfhs', # + 'QuickTake_format' : 'dfqt', # + 'Apple_Photo_format' : 'dfph', # + 'AppleShare_format' : 'dfas', # + 'UDF_format' : 'dfud', # + 'WebDAV_format' : 'dfwd', # + 'FTP_format' : 'dfft', # + 'Packet_2d_written_UDF_format' : 'dfpu', # + 'unknown_format' : 'df??', # } _Enum_elsv = { - 'name_column' : 'elsn', # - 'modification_date_column' : 'elsm', # - 'creation_date_column' : 'elsc', # - 'size_column' : 'elss', # - 'kind_column' : 'elsk', # - 'label_column' : 'elsl', # - 'version_column' : 'elsv', # - 'comment_column' : 'elsC', # + 'name_column' : 'elsn', # + 'modification_date_column' : 'elsm', # + 'creation_date_column' : 'elsc', # + 'size_column' : 'elss', # + 'kind_column' : 'elsk', # + 'label_column' : 'elsl', # + 'version_column' : 'elsv', # + 'comment_column' : 'elsC', # } _Enum_ipnl = { - 'General_Information_panel' : 'gpnl', # - 'Sharing_panel' : 'spnl', # - 'Memory_panel' : 'mpnl', # - 'Preview_panel' : 'vpnl', # - 'Application_panel' : 'apnl', # - 'Languages_panel' : 'pklg', # - 'Plugins_panel' : 'pkpg', # - 'Name__26__Extension_panel' : 'npnl', # - 'Comments_panel' : 'cpnl', # - 'Content_Index_panel' : 'cinl', # + 'General_Information_panel' : 'gpnl', # + 'Sharing_panel' : 'spnl', # + 'Memory_panel' : 'mpnl', # + 'Preview_panel' : 'vpnl', # + 'Application_panel' : 'apnl', # + 'Languages_panel' : 'pklg', # + 'Plugins_panel' : 'pkpg', # + 'Name__26__Extension_panel' : 'npnl', # + 'Comments_panel' : 'cpnl', # + 'Content_Index_panel' : 'cinl', # } _Enum_isiz = { - 'mini' : 'miic', # - 'small' : 'smic', # - 'large' : 'lgic', # + 'mini' : 'miic', # + 'small' : 'smic', # + 'large' : 'lgic', # } _Enum_lvic = { - 'small_icon' : 'smic', # - 'large_icon' : 'lgic', # + 'small_icon' : 'smic', # + 'large_icon' : 'lgic', # } _Enum_priv = { - 'read_only' : 'read', # - 'read_write' : 'rdwr', # - 'write_only' : 'writ', # - 'none' : 'none', # + 'read_only' : 'read', # + 'read_write' : 'rdwr', # + 'write_only' : 'writ', # + 'none' : 'none', # } _Enum_sodr = { - 'normal' : 'snrm', # - 'reversed' : 'srvs', # + 'normal' : 'snrm', # + 'reversed' : 'srvs', # } _Enum_vwby = { - 'conflicts' : 'cflc', # - 'existing_items' : 'exsi', # - 'small_icon' : 'smic', # - 'icon' : 'iimg', # - 'name' : 'pnam', # - 'modification_date' : 'asmo', # - 'size' : 'ptsz', # - 'kind' : 'kind', # - 'comment' : 'comt', # - 'label' : 'labi', # - 'version' : 'vers', # - 'creation_date' : 'ascd', # - 'small_button' : 'smbu', # - 'large_button' : 'lgbu', # - 'grid' : 'grid', # - 'all' : 'kyal', # + 'conflicts' : 'cflc', # + 'existing_items' : 'exsi', # + 'small_icon' : 'smic', # + 'icon' : 'iimg', # + 'name' : 'pnam', # + 'modification_date' : 'asmo', # + 'size' : 'ptsz', # + 'kind' : 'kind', # + 'comment' : 'comt', # + 'label' : 'labi', # + 'version' : 'vers', # + 'creation_date' : 'ascd', # + 'small_button' : 'smbu', # + 'large_button' : 'lgbu', # + 'grid' : 'grid', # + 'all' : 'kyal', # } diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py b/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py index a40510e..f4aea73 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py @@ -224,29 +224,29 @@ class Mozilla_suite_Events: return _arguments['----'] _Enum_comp = { - 'Navigator' : 'navg', # The Navigator component - 'InBox' : 'inbx', # The InBox component - 'Newsgroups' : 'colb', # The Newsgroups component - 'Composer' : 'cpsr', # The Page Composer component - 'Conference' : 'conf', # The Conference Component - 'Calendar' : 'cald', # The Calendar Component + 'Navigator' : 'navg', # The Navigator component + 'InBox' : 'inbx', # The InBox component + 'Newsgroups' : 'colb', # The Newsgroups component + 'Composer' : 'cpsr', # The Page Composer component + 'Conference' : 'conf', # The Conference Component + 'Calendar' : 'cald', # The Calendar Component } _Enum_dire = { - 'again' : 'agai', # Again (reload) - 'home' : 'home', # Home - 'backward' : 'prev', # Previous page - 'forward' : 'next', # Next page + 'again' : 'agai', # Again (reload) + 'home' : 'home', # Home + 'backward' : 'prev', # Previous page + 'forward' : 'next', # Next page } _Enum_ncmd = { - 'Get_new_mail' : '\x00\x00\x04W', # - 'Send_queued_messages' : '\x00\x00\x04X', # - 'Read_newsgroups' : '\x00\x00\x04\x04', # - 'Show_Inbox' : '\x00\x00\x04\x05', # - 'Show_Bookmarks_window' : '\x00\x00\x04\x06', # - 'Show_History_window' : '\x00\x00\x04\x07', # - 'Show_Address_Book_window' : '\x00\x00\x04\t', # + 'Get_new_mail' : '\x00\x00\x04W', # + 'Send_queued_messages' : '\x00\x00\x04X', # + 'Read_newsgroups' : '\x00\x00\x04\x04', # + 'Show_Inbox' : '\x00\x00\x04\x05', # + 'Show_Bookmarks_window' : '\x00\x00\x04\x06', # + 'Show_History_window' : '\x00\x00\x04\x07', # + 'Show_Address_Book_window' : '\x00\x00\x04\t', # } diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py b/Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py index 30fe566..7767305 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/PowerPlant.py @@ -1,4 +1,4 @@ -"""Suite PowerPlant: +"""Suite PowerPlant: Level 0, version 0 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 @@ -62,10 +62,10 @@ class PowerPlant_Events: return _arguments['----'] _Enum_dbac = { - 'DoNothing' : '\x00\x00\x00\x00', # No debugging action is taken. - 'PostAlert' : '\x00\x00\x00\x01', # Post an alert. - 'LowLevelDebugger' : '\x00\x00\x00\x02', # Break into the low level debugger (MacsBug). - 'SourceDebugger' : '\x00\x00\x00\x03', # Break into the source level debugger (if source debugger is executing). + 'DoNothing' : '\x00\x00\x00\x00', # No debugging action is taken. + 'PostAlert' : '\x00\x00\x00\x01', # Post an alert. + 'LowLevelDebugger' : '\x00\x00\x00\x02', # Break into the low level debugger (MacsBug). + 'SourceDebugger' : '\x00\x00\x00\x03', # Break into the source level debugger (if source debugger is executing). } diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py b/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py index 5352bb1..b5c4110 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/Required_suite.py @@ -1,4 +1,4 @@ -"""Suite Required suite: +"""Suite Required suite: Level 0, version 0 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py b/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py index 94847aa..de4a01c 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/Standard_URL_suite.py @@ -22,8 +22,8 @@ class Standard_URL_suite_Events: def GetURL(self, _object, _attributes={}, **_arguments): """GetURL: Loads the URL (optionally to disk) - Required argument: The url - Keyword argument to: file the URL should be loaded into + Required argument: The url + Keyword argument to: file the URL should be loaded into Keyword argument inside: Window the URL should be loaded to Keyword argument from_: Referrer, to be sent with the HTTP request Keyword argument _attributes: AppleEvent attribute dictionary diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/Text.py b/Lib/plat-mac/lib-scriptpackages/Netscape/Text.py index 4515d4b..2360d94 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/Text.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/Text.py @@ -1,4 +1,4 @@ -"""Suite Text: +"""Suite Text: Level 0, version 0 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 diff --git a/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py b/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py index 152c24a..06cbfa7 100644 --- a/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py @@ -1,4 +1,4 @@ -"""Suite WorldWideWeb suite, as defined in Spyglass spec.: +"""Suite WorldWideWeb suite, as defined in Spyglass spec.: Level 1, version 1 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2 @@ -317,7 +317,7 @@ class WorldWideWeb_suite_Events: def unregister_protocol(self, _object=None, _attributes={}, **_arguments): """unregister protocol: reverses the effects of \xd2register protocol\xd3 - Required argument: Application sig. + Required argument: Application sig. Keyword argument for_protocol: protocol prefix. If none, unregister for all protocols Keyword argument _attributes: AppleEvent attribute dictionary Returns: TRUE if successful diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py index 251fd77..574043d 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py @@ -1995,64 +1995,64 @@ zones._privpropdict = { zones._privelemdict = { } _Enum_boov = { - 'true' : 'true', # the true boolean value - 'false' : 'fals', # the false boolean value + 'true' : 'true', # the true boolean value + 'false' : 'fals', # the false boolean value } _Enum_cons = { - 'case' : 'case', # case - 'diacriticals' : 'diac', # diacriticals - 'white_space' : 'whit', # white space - 'hyphens' : 'hyph', # hyphens - 'expansion' : 'expa', # expansion - 'punctuation' : 'punc', # punctuation - 'application_responses' : 'rmte', # remote event replies + 'case' : 'case', # case + 'diacriticals' : 'diac', # diacriticals + 'white_space' : 'whit', # white space + 'hyphens' : 'hyph', # hyphens + 'expansion' : 'expa', # expansion + 'punctuation' : 'punc', # punctuation + 'application_responses' : 'rmte', # remote event replies } _Enum_eMds = { - 'option_down' : 'Kopt', # - 'command_down' : 'Kcmd', # - 'control_down' : 'Kctl', # - 'shift_down' : 'Ksft', # - 'caps_lock_down' : 'Kclk', # + 'option_down' : 'Kopt', # + 'command_down' : 'Kcmd', # + 'control_down' : 'Kctl', # + 'shift_down' : 'Ksft', # + 'caps_lock_down' : 'Kclk', # } _Enum_ekst = { - 'escape_key' : 'ks5\x00', # - 'delete_key' : 'ks3\x00', # - 'tab_key' : 'ks0\x00', # - 'return_key' : 'ks$\x00', # - 'clear_key' : 'ksG\x00', # - 'enter_key' : 'ksL\x00', # - 'up_arrow_key' : 'ks~\x00', # - 'down_arrow_key' : 'ks}\x00', # - 'left_arrow_key' : 'ks{\x00', # - 'right_arrow_key' : 'ks|\x00', # - 'help_key' : 'ksr\x00', # - 'home_key' : 'kss\x00', # - 'page_up_key' : 'kst\x00', # - 'page_down_key' : 'ksy\x00', # - 'forward_del_key' : 'ksu\x00', # - 'end_key' : 'ksw\x00', # - 'F1_key' : 'ksz\x00', # - 'F2_key' : 'ksx\x00', # - 'F3_key' : 'ksc\x00', # - 'F4_key' : 'ksv\x00', # - 'F5_key' : 'ks`\x00', # - 'F6_key' : 'ksa\x00', # - 'F7_key' : 'ksb\x00', # - 'F8_key' : 'ksd\x00', # - 'F9_key' : 'kse\x00', # - 'F10_key' : 'ksm\x00', # - 'F11_key' : 'ksg\x00', # - 'F12_key' : 'kso\x00', # - 'F13_key' : 'ksi\x00', # - 'F14_key' : 'ksk\x00', # - 'F15_key' : 'ksq\x00', # + 'escape_key' : 'ks5\x00', # + 'delete_key' : 'ks3\x00', # + 'tab_key' : 'ks0\x00', # + 'return_key' : 'ks$\x00', # + 'clear_key' : 'ksG\x00', # + 'enter_key' : 'ksL\x00', # + 'up_arrow_key' : 'ks~\x00', # + 'down_arrow_key' : 'ks}\x00', # + 'left_arrow_key' : 'ks{\x00', # + 'right_arrow_key' : 'ks|\x00', # + 'help_key' : 'ksr\x00', # + 'home_key' : 'kss\x00', # + 'page_up_key' : 'kst\x00', # + 'page_down_key' : 'ksy\x00', # + 'forward_del_key' : 'ksu\x00', # + 'end_key' : 'ksw\x00', # + 'F1_key' : 'ksz\x00', # + 'F2_key' : 'ksx\x00', # + 'F3_key' : 'ksc\x00', # + 'F4_key' : 'ksv\x00', # + 'F5_key' : 'ks`\x00', # + 'F6_key' : 'ksa\x00', # + 'F7_key' : 'ksb\x00', # + 'F8_key' : 'ksd\x00', # + 'F9_key' : 'kse\x00', # + 'F10_key' : 'ksm\x00', # + 'F11_key' : 'ksg\x00', # + 'F12_key' : 'kso\x00', # + 'F13_key' : 'ksi\x00', # + 'F14_key' : 'ksk\x00', # + 'F15_key' : 'ksq\x00', # } _Enum_misc = { - 'current_application' : 'cura', # the current application + 'current_application' : 'cura', # the current application } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py index 5fa06dd..99fe5e3 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/Macintosh_Connectivity_Clas.py @@ -253,74 +253,74 @@ USB_address._privpropdict = { USB_address._privelemdict = { } _Enum_econ = { - 'ADB' : 'eadb', # - 'printer_port' : 'ecpp', # - 'modem_port' : 'ecmp', # - 'modem_printer_port' : 'empp', # - 'LocalTalk' : 'eclt', # - 'Ethernet' : 'ecen', # - 'Token_Ring' : 'etok', # - 'SCSI' : 'ecsc', # - 'USB' : 'ecus', # - 'FireWire' : 'ecfw', # - 'infrared' : 'ecir', # - 'PC_card' : 'ecpc', # - 'PCI_bus' : 'ecpi', # - 'NuBus' : 'enub', # - 'PDS_slot' : 'ecpd', # - 'Comm_slot' : 'eccm', # - 'monitor_out' : 'ecmn', # - 'video_out' : 'ecvo', # - 'video_in' : 'ecvi', # - 'audio_out' : 'ecao', # - 'audio_line_in' : 'ecai', # - 'audio_line_out' : 'ecal', # - 'microphone' : 'ecmi', # + 'ADB' : 'eadb', # + 'printer_port' : 'ecpp', # + 'modem_port' : 'ecmp', # + 'modem_printer_port' : 'empp', # + 'LocalTalk' : 'eclt', # + 'Ethernet' : 'ecen', # + 'Token_Ring' : 'etok', # + 'SCSI' : 'ecsc', # + 'USB' : 'ecus', # + 'FireWire' : 'ecfw', # + 'infrared' : 'ecir', # + 'PC_card' : 'ecpc', # + 'PCI_bus' : 'ecpi', # + 'NuBus' : 'enub', # + 'PDS_slot' : 'ecpd', # + 'Comm_slot' : 'eccm', # + 'monitor_out' : 'ecmn', # + 'video_out' : 'ecvo', # + 'video_in' : 'ecvi', # + 'audio_out' : 'ecao', # + 'audio_line_in' : 'ecai', # + 'audio_line_out' : 'ecal', # + 'microphone' : 'ecmi', # } _Enum_edvt = { - 'hard_disk_drive' : 'ehd ', # - 'floppy_disk_drive' : 'efd ', # - 'CD_ROM_drive' : 'ecd ', # - 'DVD_drive' : 'edvd', # - 'storage_device' : 'edst', # - 'keyboard' : 'ekbd', # - 'mouse' : 'emou', # - 'trackball' : 'etrk', # - 'trackpad' : 'edtp', # - 'pointing_device' : 'edpd', # - 'video_monitor' : 'edvm', # - 'LCD_display' : 'edlc', # - 'display' : 'edds', # - 'modem' : 'edmm', # - 'PC_card' : 'ecpc', # - 'PCI_card' : 'edpi', # - 'NuBus_card' : 'ednb', # - 'printer' : 'edpr', # - 'speakers' : 'edsp', # - 'microphone' : 'ecmi', # + 'hard_disk_drive' : 'ehd ', # + 'floppy_disk_drive' : 'efd ', # + 'CD_ROM_drive' : 'ecd ', # + 'DVD_drive' : 'edvd', # + 'storage_device' : 'edst', # + 'keyboard' : 'ekbd', # + 'mouse' : 'emou', # + 'trackball' : 'etrk', # + 'trackpad' : 'edtp', # + 'pointing_device' : 'edpd', # + 'video_monitor' : 'edvm', # + 'LCD_display' : 'edlc', # + 'display' : 'edds', # + 'modem' : 'edmm', # + 'PC_card' : 'ecpc', # + 'PCI_card' : 'edpi', # + 'NuBus_card' : 'ednb', # + 'printer' : 'edpr', # + 'speakers' : 'edsp', # + 'microphone' : 'ecmi', # } _Enum_epro = { - 'serial' : 'epsr', # - 'AppleTalk' : 'epat', # - 'IP' : 'epip', # - 'SCSI' : 'ecsc', # - 'ADB' : 'eadb', # - 'FireWire' : 'ecfw', # - 'IrDA' : 'epir', # - 'IRTalk' : 'epit', # - 'USB' : 'ecus', # - 'PC_card' : 'ecpc', # - 'PCI_bus' : 'ecpi', # - 'NuBus' : 'enub', # - 'bus' : 'ebus', # - 'Macintosh_video' : 'epmv', # - 'SVGA' : 'epsg', # - 'S_video' : 'epsv', # - 'analog_audio' : 'epau', # - 'digital_audio' : 'epda', # - 'PostScript' : 'epps', # + 'serial' : 'epsr', # + 'AppleTalk' : 'epat', # + 'IP' : 'epip', # + 'SCSI' : 'ecsc', # + 'ADB' : 'eadb', # + 'FireWire' : 'ecfw', # + 'IrDA' : 'epir', # + 'IRTalk' : 'epit', # + 'USB' : 'ecus', # + 'PC_card' : 'ecpc', # + 'PCI_bus' : 'ecpi', # + 'NuBus' : 'enub', # + 'bus' : 'ebus', # + 'Macintosh_video' : 'epmv', # + 'SVGA' : 'epsg', # + 'S_video' : 'epsv', # + 'analog_audio' : 'epau', # + 'digital_audio' : 'epda', # + 'PostScript' : 'epps', # } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py index f4b59f5..11747f9 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suite.py @@ -327,28 +327,28 @@ graphic_line._privpropdict = { graphic_line._privelemdict = { } _Enum_arro = { - 'no_arrow' : 'arno', # No arrow on line - 'arrow_at_start' : 'arst', # Arrow at start of line - 'arrow_at_end' : 'aren', # Arrow at end of line - 'arrow_at_both_ends' : 'arbo', # Arrow at both the start and the end of the line + 'no_arrow' : 'arno', # No arrow on line + 'arrow_at_start' : 'arst', # Arrow at start of line + 'arrow_at_end' : 'aren', # Arrow at end of line + 'arrow_at_both_ends' : 'arbo', # Arrow at both the start and the end of the line } _Enum_tran = { - 'copy_pixels' : 'cpy ', # - 'not_copy_pixels' : 'ncpy', # - 'or_pixels' : 'or ', # - 'not_or_pixels' : 'ntor', # - 'bic_pixels' : 'bic ', # - 'not_bic_pixels' : 'nbic', # - 'xor_pixels' : 'xor ', # - 'not_xor_pixels' : 'nxor', # - 'add_over_pixels' : 'addo', # - 'add_pin_pixels' : 'addp', # - 'sub_over_pixels' : 'subo', # - 'sub_pin_pixels' : 'subp', # - 'ad_max_pixels' : 'admx', # - 'ad_min_pixels' : 'admn', # - 'blend_pixels' : 'blnd', # + 'copy_pixels' : 'cpy ', # + 'not_copy_pixels' : 'ncpy', # + 'or_pixels' : 'or ', # + 'not_or_pixels' : 'ntor', # + 'bic_pixels' : 'bic ', # + 'not_bic_pixels' : 'nbic', # + 'xor_pixels' : 'xor ', # + 'not_xor_pixels' : 'nxor', # + 'add_over_pixels' : 'addo', # + 'add_pin_pixels' : 'addp', # + 'sub_over_pixels' : 'subo', # + 'sub_pin_pixels' : 'subp', # + 'ad_max_pixels' : 'admx', # + 'ad_min_pixels' : 'admn', # + 'blend_pixels' : 'blnd', # } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py index de6d5e5..86681f5 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py @@ -656,33 +656,33 @@ class _b2_(aetools.NComparison): class _b3_(aetools.NComparison): """\xb3 - Greater than or equal to """ _Enum_kfrm = { - 'index' : 'indx', # keyform designating indexed access - 'named' : 'name', # keyform designating named access - 'id' : 'ID ', # keyform designating access by unique identifier + 'index' : 'indx', # keyform designating indexed access + 'named' : 'name', # keyform designating named access + 'id' : 'ID ', # keyform designating access by unique identifier } _Enum_savo = { - 'yes' : 'yes ', # Save objects now - 'no' : 'no ', # Do not save objects - 'ask' : 'ask ', # Ask the user whether to save + 'yes' : 'yes ', # Save objects now + 'no' : 'no ', # Do not save objects + 'ask' : 'ask ', # Ask the user whether to save } _Enum_styl = { - 'plain' : 'plan', # Plain - 'bold' : 'bold', # Bold - 'italic' : 'ital', # Italic - 'outline' : 'outl', # Outline - 'shadow' : 'shad', # Shadow - 'underline' : 'undl', # Underline - 'superscript' : 'spsc', # Superscript - 'subscript' : 'sbsc', # Subscript - 'strikethrough' : 'strk', # Strikethrough - 'small_caps' : 'smcp', # Small caps - 'all_caps' : 'alcp', # All capital letters - 'all_lowercase' : 'lowc', # Lowercase - 'condensed' : 'cond', # Condensed - 'expanded' : 'pexp', # Expanded - 'hidden' : 'hidn', # Hidden + 'plain' : 'plan', # Plain + 'bold' : 'bold', # Bold + 'italic' : 'ital', # Italic + 'outline' : 'outl', # Outline + 'shadow' : 'shad', # Shadow + 'underline' : 'undl', # Underline + 'superscript' : 'spsc', # Superscript + 'subscript' : 'sbsc', # Subscript + 'strikethrough' : 'strk', # Strikethrough + 'small_caps' : 'smcp', # Small caps + 'all_caps' : 'alcp', # All capital letters + 'all_lowercase' : 'lowc', # Lowercase + 'condensed' : 'cond', # Condensed + 'expanded' : 'pexp', # Expanded + 'hidden' : 'hidn', # Hidden } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py index bb929b8..afa01a0 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py @@ -74,9 +74,9 @@ tables._privpropdict = { tables._privelemdict = { } _Enum_prtn = { - 'read_only' : 'nmod', # Can\xd5t change values or formulas - 'formulas_protected' : 'fpro', # Can changes values but not formulas - 'read_2f_write' : 'modf', # Can change values and formulas + 'read_only' : 'nmod', # Can\xd5t change values or formulas + 'formulas_protected' : 'fpro', # Can changes values but not formulas + 'read_2f_write' : 'modf', # Can change values and formulas } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py index 4edb7f4..1845f4d 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/Text_Suite.py @@ -162,28 +162,28 @@ text_style_info._privpropdict = { text_style_info._privelemdict = { } _Enum_just = { - 'left' : 'left', # Align with left margin - 'right' : 'rght', # Align with right margin - 'center' : 'cent', # Align with center - 'full' : 'full', # Align with both left and right margins + 'left' : 'left', # Align with left margin + 'right' : 'rght', # Align with right margin + 'center' : 'cent', # Align with center + 'full' : 'full', # Align with both left and right margins } _Enum_styl = { - 'plain' : 'plan', # Plain - 'bold' : 'bold', # Bold - 'italic' : 'ital', # Italic - 'outline' : 'outl', # Outline - 'shadow' : 'shad', # Shadow - 'underline' : 'undl', # Underline - 'superscript' : 'spsc', # Superscript - 'subscript' : 'sbsc', # Subscript - 'strikethrough' : 'strk', # Strikethrough - 'small_caps' : 'smcp', # Small caps - 'all_caps' : 'alcp', # All capital letters - 'all_lowercase' : 'lowc', # Lowercase - 'condensed' : 'cond', # Condensed - 'expanded' : 'pexp', # Expanded - 'hidden' : 'hidn', # Hidden + 'plain' : 'plan', # Plain + 'bold' : 'bold', # Bold + 'italic' : 'ital', # Italic + 'outline' : 'outl', # Outline + 'shadow' : 'shad', # Shadow + 'underline' : 'undl', # Underline + 'superscript' : 'spsc', # Superscript + 'subscript' : 'sbsc', # Subscript + 'strikethrough' : 'strk', # Strikethrough + 'small_caps' : 'smcp', # Small caps + 'all_caps' : 'alcp', # All capital letters + 'all_lowercase' : 'lowc', # Lowercase + 'condensed' : 'cond', # Condensed + 'expanded' : 'pexp', # Expanded + 'hidden' : 'hidn', # Hidden } diff --git a/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py b/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py index f648517..b80e3ba 100644 --- a/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/StdSuites/__init__.py @@ -469,4 +469,3 @@ class StdSuites(Text_Suite_Events, _signature = 'ascr' _moduleName = 'StdSuites' - diff --git a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py index b9e6b34..a9ac3dd 100644 --- a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py @@ -313,21 +313,21 @@ file._privelemdict = { 'item' : item, } _Enum_edfm = { - 'MS_2d_DOS_format' : 'dfms', # MS-DOS format - 'Apple_Photo_format' : 'dfph', # Apple Photo format - 'ISO_9660_format' : 'df96', # ISO 9660 format - 'QuickTake_format' : 'dfqt', # QuickTake format - 'AppleShare_format' : 'dfas', # AppleShare format - 'High_Sierra_format' : 'dfhs', # High Sierra format - 'Mac_OS_Extended_format' : 'dfh+', # Mac OS Extended format - 'UDF_format' : 'dfud', # UDF format - 'unknown_format' : 'df??', # unknown format - 'audio_format' : 'dfau', # audio format - 'Mac_OS_format' : 'dfhf', # Mac OS format - 'UFS_format' : 'dfuf', # UFS format - 'NFS_format' : 'dfnf', # NFS format - 'ProDOS_format' : 'dfpr', # ProDOS format - 'WebDAV_format' : 'dfwd', # WebDAV format + 'MS_2d_DOS_format' : 'dfms', # MS-DOS format + 'Apple_Photo_format' : 'dfph', # Apple Photo format + 'ISO_9660_format' : 'df96', # ISO 9660 format + 'QuickTake_format' : 'dfqt', # QuickTake format + 'AppleShare_format' : 'dfas', # AppleShare format + 'High_Sierra_format' : 'dfhs', # High Sierra format + 'Mac_OS_Extended_format' : 'dfh+', # Mac OS Extended format + 'UDF_format' : 'dfud', # UDF format + 'unknown_format' : 'df??', # unknown format + 'audio_format' : 'dfau', # audio format + 'Mac_OS_format' : 'dfhf', # Mac OS format + 'UFS_format' : 'dfuf', # UFS format + 'NFS_format' : 'dfnf', # NFS format + 'ProDOS_format' : 'dfpr', # ProDOS format + 'WebDAV_format' : 'dfwd', # WebDAV format } diff --git a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py index 22cf935..c2c7e5e 100644 --- a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Folder_Actions_Suite.py @@ -252,11 +252,11 @@ script._privpropdict = { script._privelemdict = { } _Enum_actn = { - 'items_added' : 'fget', # items added - 'items_removed' : 'flos', # items removed - 'window_closed' : 'fclo', # window closed - 'window_moved' : 'fsiz', # window moved - 'window_opened' : 'fopn', # window opened + 'items_added' : 'fget', # items added + 'items_removed' : 'flos', # items removed + 'window_closed' : 'fclo', # window closed + 'window_moved' : 'fsiz', # window moved + 'window_opened' : 'fopn', # window opened } diff --git a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py index c9f6d44..f20ef84 100644 --- a/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py @@ -524,9 +524,9 @@ class _b2_(aetools.NComparison): class _b3_(aetools.NComparison): """\xb3 - Greater than or equal to """ _Enum_savo = { - 'ask' : 'ask ', # Ask the user whether or not to save the file. - 'yes' : 'yes ', # Save the file. - 'no' : 'no ', # Do not save the file. + 'ask' : 'ask ', # Ask the user whether or not to save the file. + 'yes' : 'yes ', # Save the file. + 'no' : 'no ', # Do not save the file. } diff --git a/Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py b/Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py index 673a31a..035290f 100644 --- a/Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py @@ -524,9 +524,9 @@ class _b2_(aetools.NComparison): class _b3_(aetools.NComparison): """\xb3 - Greater than or equal to """ _Enum_savo = { - 'ask' : 'ask ', # Ask the user whether or not to save the file. - 'yes' : 'yes ', # Save the file. - 'no' : 'no ', # Do not save the file. + 'ask' : 'ask ', # Ask the user whether or not to save the file. + 'yes' : 'yes ', # Save the file. + 'no' : 'no ', # Do not save the file. } diff --git a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py index ac3c0ba..2c722d9 100644 --- a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py +++ b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/__init__.py @@ -9,20 +9,19 @@ import builtin_Suite _code_to_module = { - 'reqd' : builtin_Suite, - 'core' : builtin_Suite, + 'reqd' : builtin_Suite, + 'core' : builtin_Suite, } _code_to_fullname = { - 'reqd' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), - 'core' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), + 'reqd' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), + 'core' : ('_builtinSuites.builtin_Suite', 'builtin_Suite'), } from builtin_Suite import * class _builtinSuites(builtin_Suite_Events, - aetools.TalkTo): - _signature = 'ascr' - + aetools.TalkTo): + _signature = 'ascr' diff --git a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py index 117eedd..318250f 100644 --- a/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py +++ b/Lib/plat-mac/lib-scriptpackages/_builtinSuites/builtin_Suite.py @@ -9,118 +9,118 @@ _code = 'aevt' class builtin_Suite_Events: - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: list of objects to open - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def run(self, _no_object=None, _attributes={}, **_arguments): - """run: Run an application. Most applications will open an empty, untitled window. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'oapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def reopen(self, _no_object=None, _attributes={}, **_arguments): - """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'rapp' - - if _arguments: raise TypeError, 'No optional args expected' - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def _print(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: list of objects to print - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_quit = { - 'saving' : 'savo', - } - - def quit(self, _no_object=None, _attributes={}, **_arguments): - """quit: Quit an application - Keyword argument saving: specifies whether to save currently open documents - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'quit' - - aetools.keysubst(_arguments, self._argmap_quit) - if _no_object != None: raise TypeError, 'No direct arg expected' - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_close = { - 'saving' : 'savo', - 'saving_in' : 'kfil', - } + def open(self, _object, _attributes={}, **_arguments): + """open: Open the specified object(s) + Required argument: list of objects to open + Keyword argument _attributes: AppleEvent attribute dictionary + """ + _code = 'aevt' + _subcode = 'odoc' + + if _arguments: raise TypeError, 'No optional args expected' + _arguments['----'] = _object + + + _reply, _arguments, _attributes = self.send(_code, _subcode, + _arguments, _attributes) + if _arguments.get('errn', 0): + raise aetools.Error, aetools.decodeerror(_arguments) + # XXXX Optionally decode result + if _arguments.has_key('----'): + return _arguments['----'] + + def run(self, _no_object=None, _attributes={}, **_arguments): + """run: Run an application. Most applications will open an empty, untitled window. + Keyword argument _attributes: AppleEvent attribute dictionary + """ + _code = 'aevt' + _subcode = 'oapp' + + if _arguments: raise TypeError, 'No optional args expected' + if _no_object != None: raise TypeError, 'No direct arg expected' + + + _reply, _arguments, _attributes = self.send(_code, _subcode, + _arguments, _attributes) + if _arguments.get('errn', 0): + raise aetools.Error, aetools.decodeerror(_arguments) + # XXXX Optionally decode result + if _arguments.has_key('----'): + return _arguments['----'] + + def reopen(self, _no_object=None, _attributes={}, **_arguments): + """reopen: Reactivate a running application. Some applications will open a new untitled window if no window is open. + Keyword argument _attributes: AppleEvent attribute dictionary + """ + _code = 'aevt' + _subcode = 'rapp' + + if _arguments: raise TypeError, 'No optional args expected' + if _no_object != None: raise TypeError, 'No direct arg expected' + + + _reply, _arguments, _attributes = self.send(_code, _subcode, + _arguments, _attributes) + if _arguments.get('errn', 0): + raise aetools.Error, aetools.decodeerror(_arguments) + # XXXX Optionally decode result + if _arguments.has_key('----'): + return _arguments['----'] + + def _print(self, _object, _attributes={}, **_arguments): + """print: Print the specified object(s) + Required argument: list of objects to print + Keyword argument _attributes: AppleEvent attribute dictionary + """ + _code = 'aevt' + _subcode = 'pdoc' + + if _arguments: raise TypeError, 'No optional args expected' + _arguments['----'] = _object + + + _reply, _arguments, _attributes = self.send(_code, _subcode, + _arguments, _attributes) + if _arguments.get('errn', 0): + raise aetools.Error, aetools.decodeerror(_arguments) + # XXXX Optionally decode result + if _arguments.has_key('----'): + return _arguments['----'] + + _argmap_quit = { + 'saving' : 'savo', + } + + def quit(self, _no_object=None, _attributes={}, **_arguments): + """quit: Quit an application + Keyword argument saving: specifies whether to save currently open documents + Keyword argument _attributes: AppleEvent attribute dictionary + """ + _code = 'aevt' + _subcode = 'quit' + + aetools.keysubst(_arguments, self._argmap_quit) + if _no_object != None: raise TypeError, 'No direct arg expected' + + aetools.enumsubst(_arguments, 'savo', _Enum_savo) + + _reply, _arguments, _attributes = self.send(_code, _subcode, + _arguments, _attributes) + if _arguments.get('errn', 0): + raise aetools.Error, aetools.decodeerror(_arguments) + # XXXX Optionally decode result + if _arguments.has_key('----'): + return _arguments['----'] + + _argmap_close = { + 'saving' : 'savo', + 'saving_in' : 'kfil', + } _Enum_savo = { - 'yes' : 'yes ', # Save objects now - 'no' : 'no ', # Do not save objects - 'ask' : 'ask ', # Ask the user whether to save + 'yes' : 'yes ', # Save objects now + 'no' : 'no ', # Do not save objects + 'ask' : 'ask ', # Ask the user whether to save } # @@ -136,5 +136,5 @@ _compdeclarations = { } _enumdeclarations = { - 'savo' : _Enum_savo, + 'savo' : _Enum_savo, } diff --git a/Lib/plat-mac/macfs.py b/Lib/plat-mac/macfs.py index 11dbbeb..73815ae 100644 --- a/Lib/plat-mac/macfs.py +++ b/Lib/plat-mac/macfs.py @@ -9,7 +9,7 @@ import warnings warnings.warn("macfs is deprecated, use Carbon.File, Carbon.Folder or EasyDialogs", DeprecationWarning, stacklevel=2) - + # First step: ensure we also emulate the MACFS module, which contained # all the constants @@ -38,7 +38,7 @@ if time.gmtime(0)[0] == 1970: t = t + 0x10000000L return (0, int(t), 0) else: - def _utc2time(utc): + def _utc2time(utc): t = utc[1] if t < 0: t = t + 0x100000000L @@ -58,26 +58,26 @@ error = Carbon.File.Error class FSSpec(Carbon.File.FSSpec): def as_fsref(self): return FSRef(self) - + def NewAlias(self, src=None): return Alias(Carbon.File.NewAlias(src, self)) - + def GetCreatorType(self): finfo = self.FSpGetFInfo() return finfo.Creator, finfo.Type - + def SetCreatorType(self, ctor, tp): finfo = self.FSpGetFInfo() finfo.Creator = ctor finfo.Type = tp self.FSpSetFInfo(finfo) - + def GetFInfo(self): return self.FSpGetFInfo() - + def SetFInfo(self, info): return self.FSpSetFInfo(info) - + def GetDates(self): catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate catinfo, d1, d2, d3 = FSRef(self).FSGetCatalogInfo(catInfoFlags) @@ -85,7 +85,7 @@ class FSSpec(Carbon.File.FSSpec): mdate = catinfo.contentModDate bdate = catinfo.backupDate return _utc2time(cdate), _utc2time(mdate), _utc2time(bdate) - + def SetDates(self, cdate, mdate, bdate): catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate catinfo = Carbon.File.FSCatalogInfo( @@ -93,23 +93,23 @@ class FSSpec(Carbon.File.FSSpec): contentModDate = _time2utc(mdate), backupDate = _time2utc(bdate)) FSRef(self).FSSetCatalogInfo(catInfoFlags, catinfo) - + class FSRef(Carbon.File.FSRef): def as_fsspec(self): return FSSpec(self) - + class Alias(Carbon.File.Alias): def GetInfo(self, index): return self.GetAliasInfo(index) - + def Update(self, *args): pass # print "Alias.Update not yet implemented" - + def Resolve(self, src=None): fss, changed = self.ResolveAlias(src) return FSSpec(fss), changed - + from Carbon.File import FInfo # Backward-compatible type names: @@ -122,19 +122,19 @@ FInfoType = FInfo def ResolveAliasFile(fss, chain=1): fss, isdir, isalias = Carbon.File.ResolveAliasFile(fss, chain) return FSSpec(fss), isdir, isalias - + def RawFSSpec(data): return FSSpec(rawdata=data) - + def RawAlias(data): return Alias(rawdata=data) - + def FindApplication(*args): raise NotImplementedError, "FindApplication no longer implemented" - + def NewAliasMinimalFromFullPath(path): return Alias(Carbon.File.NewAliasMinimalFromFullPath(path, '', '')) - + # Another global function: from Carbon.Folder import FindFolder @@ -148,7 +148,7 @@ def StandardGetFile(*typelist): """Ask for an input file, optionally specifying 4-char file types that are allowable""" return PromptGetFile('', *typelist) - + def PromptGetFile(prompt, *typelist): """Ask for an input file giving the user a prompt message. Optionally you can specifying 4-char file types that are allowable""" @@ -157,7 +157,7 @@ def PromptGetFile(prompt, *typelist): DeprecationWarning, stacklevel=2) if not typelist: typelist = None - fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec, + fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec, typeList=typelist, defaultLocation=_handleSetFolder()) return fss, not fss is None @@ -167,10 +167,10 @@ def StandardPutFile(prompt, default=None): import EasyDialogs warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", DeprecationWarning, stacklevel=2) - fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt, + fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt, savedFileName=default, defaultLocation=_handleSetFolder()) return fss, not fss is None - + def SetFolder(folder): global _curfolder warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", @@ -181,18 +181,18 @@ def SetFolder(folder): rv = None _curfolder = folder return rv - + def _handleSetFolder(): global _curfolder rv = _curfolder _curfolder = None return rv - + def GetDirectory(prompt=None): """Ask the user to select a folder. Optionally you can give a prompt.""" import EasyDialogs warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen", DeprecationWarning, stacklevel=2) - fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec, + fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec, defaultLocation=_handleSetFolder()) return fss, not fss is None diff --git a/Lib/plat-mac/macostools.py b/Lib/plat-mac/macostools.py index 3644e7e..06bc92f 100644 --- a/Lib/plat-mac/macostools.py +++ b/Lib/plat-mac/macostools.py @@ -41,18 +41,18 @@ def mkalias(src, dst, relative=None): alias = File.FSNewAlias(relativefsr, srcfsr) else: alias = srcfsr.FSNewAliasMinimal() - - dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), + + dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), File.FSGetResourceForkName()) h = Res.FSOpenResourceFile(dstfsr, File.FSGetResourceForkName(), 3) resource = Res.Resource(alias.data) resource.AddResource('alis', 0, '') Res.CloseResFile(h) - + dstfinfo = dstfss.FSpGetFInfo() dstfinfo.Flags = dstfinfo.Flags|0x8000 # Alias flag dstfss.FSpSetFInfo(dstfinfo) - + def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): @@ -62,7 +62,7 @@ def mkdirs(dst): head = head + ':' mkdirs(head) os.mkdir(dst, 0777) - + def touched(dst): """Tell the finder a file has changed. No-op on MacOSX.""" if sys.platform != 'mac': return @@ -80,7 +80,7 @@ def touched(dst): dir_fss.SetDates(crdate, now, bkdate) except macfs.error: pass - + def touched_ae(dst): """Tell the finder a file has changed""" pardir = os.path.split(dst)[0] @@ -89,14 +89,14 @@ def touched_ae(dst): import Finder f = Finder.Finder() f.update(File.FSRef(pardir)) - + def copy(src, dst, createpath=0, copydates=1, forcetype=None): """Copy a file, including finder info, resource fork, etc""" src = File.pathname(src) dst = File.pathname(dst) if createpath: mkdirs(os.path.split(dst)[0]) - + ifp = open(src, 'rb') ofp = open(dst, 'wb') d = ifp.read(BUFSIZ) @@ -105,7 +105,7 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None): d = ifp.read(BUFSIZ) ifp.close() ofp.close() - + ifp = openrf(src, '*rb') ofp = openrf(dst, '*wb') d = ifp.read(BUFSIZ) @@ -114,7 +114,7 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None): d = ifp.read(BUFSIZ) ifp.close() ofp.close() - + srcfss = File.FSSpec(src) dstfss = File.FSSpec(dst) sf = srcfss.FSpGetFInfo() @@ -130,7 +130,7 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None): catinfo, _, _, _ = srcfsr.FSGetCatalogInfo(Files.kFSCatInfoAllDates) dstfsr.FSSetCatalogInfo(Files.kFSCatInfoAllDates, catinfo) touched(dstfss) - + def copytree(src, dst, copydates=1): """Copy a complete file tree to a new destination""" if os.path.isdir(src): diff --git a/Lib/plat-mac/macresource.py b/Lib/plat-mac/macresource.py index e4c3f62..f68ecdc 100644 --- a/Lib/plat-mac/macresource.py +++ b/Lib/plat-mac/macresource.py @@ -15,12 +15,12 @@ def need(restype, resid, filename=None, modname=None): is available we are done. If it is not available we look for a file filename (default: modname with .rsrc appended) either in the same folder as where modname was loaded from, or otherwise across sys.path. - + Returns the refno of the resource file opened (or None)""" if modname is None and filename is None: raise ArgumentError, "Either filename or modname argument (or both) must be given" - + if type(resid) is type(1): try: h = Res.GetResource(restype, resid) @@ -35,14 +35,14 @@ def need(restype, resid, filename=None, modname=None): pass else: return None - + # Construct a filename if we don't have one if not filename: if '.' in modname: filename = modname.split('.')[-1] + '.rsrc' else: filename = modname + '.rsrc' - + # Now create a list of folders to search searchdirs = [] if modname == '__main__': @@ -53,7 +53,7 @@ def need(restype, resid, filename=None, modname=None): if hasattr(mod, '__file__'): searchdirs = [os.path.dirname(mod.__file__)] searchdirs.extend(sys.path) - + # And look for the file for dir in searchdirs: pathname = os.path.join(dir, filename) @@ -61,16 +61,16 @@ def need(restype, resid, filename=None, modname=None): break else: raise ResourceFileNotFoundError, filename - + refno = open_pathname(pathname) - + # And check that the resource exists now if type(resid) is type(1): h = Res.GetResource(restype, resid) else: h = Res.GetNamedResource(restype, resid) return refno - + def open_pathname(pathname, verbose=0): """Open a resource file given by pathname, possibly decoding an AppleSingle file""" @@ -95,7 +95,7 @@ def open_pathname(pathname, verbose=0): else: raise return refno - + def resource_pathname(pathname, verbose=0): """Return the pathname for a resource file (either DF or RF based). If the pathname given already refers to such a file simply return it, @@ -121,12 +121,12 @@ def resource_pathname(pathname, verbose=0): else: raise return pathname - + def open_error_resource(): """Open the resource file containing the error code to error message mapping.""" need('Estr', 1, filename="errors.rsrc", modname=__name__) - + def _decode(pathname, verbose=0): # Decode an AppleSingle resource file, return the new pathname. newpathname = pathname + '.df.rsrc' diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 39bc693..67fab76 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -1,6 +1,6 @@ """Package Install Manager for Python. -This is currently a MacOSX-only strawman implementation. +This is currently a MacOSX-only strawman implementation. Despite other rumours the name stands for "Packman IMPlementation". Tools to allow easy installation of packages. The idea is that there is @@ -27,7 +27,7 @@ import tempfile import shutil import time -__all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main", +__all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main", "PIMP_VERSION", "main"] _scriptExc_NotInstalled = "pimp._scriptExc_NotInstalled" @@ -52,12 +52,12 @@ def getDefaultDatabase(experimental=False): status = "exp" else: status = "prod" - + major, minor, micro, state, extra = sys.version_info pyvers = '%d.%d' % (major, minor) if state != 'final': pyvers = pyvers + '%s%d' % (state, extra) - + longplatform = distutils.util.get_platform() osname, release, machine = longplatform.split('-') # For some platforms we may want to differentiate between @@ -94,7 +94,7 @@ def getDefaultDatabase(experimental=False): def _cmd(output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" - + cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) @@ -112,22 +112,22 @@ def _cmd(output, dir, *cmditems): class PimpDownloader: """Abstract base class - Downloader for archives""" - + def __init__(self, argument, dir="", watcher=None): self.argument = argument self._dir = dir self._watcher = watcher - + def download(self, url, filename, output=None): return None - + def update(self, str): if self._watcher: return self._watcher.update(str) return True - + class PimpCurlDownloader(PimpDownloader): def download(self, url, filename, output=None): @@ -138,7 +138,7 @@ class PimpCurlDownloader(PimpDownloader): url) self.update("Downloading %s: finished" % url) return (not exitstatus) - + class PimpUrllibDownloader(PimpDownloader): def download(self, url, filename, output=None): @@ -150,13 +150,13 @@ class PimpUrllibDownloader(PimpDownloader): length = long(download.headers['content-length']) else: length = -1 - + data = download.read(4096) #read 4K at a time dlsize = 0 lasttime = 0 while keepgoing: dlsize = dlsize + len(data) - if len(data) == 0: + if len(data) == 0: #this is our exit condition break output.write(data) @@ -171,12 +171,12 @@ class PimpUrllibDownloader(PimpDownloader): if keepgoing: self.update("Downloading %s: finished" % url) return keepgoing - + class PimpUnpacker: """Abstract base class - Unpacker for archives""" - + _can_rename = False - + def __init__(self, argument, dir="", renames=[], @@ -187,30 +187,30 @@ class PimpUnpacker: self._dir = dir self._renames = renames self._watcher = watcher - + def unpack(self, archive, output=None, package=None): return None - + def update(self, str): if self._watcher: return self._watcher.update(str) return True - + class PimpCommandUnpacker(PimpUnpacker): """Unpack archives by calling a Unix utility""" - + _can_rename = False - + def unpack(self, archive, output=None, package=None): cmd = self.argument % archive if _cmd(output, self._dir, cmd): return "unpack command failed" - + class PimpTarUnpacker(PimpUnpacker): """Unpack tarfiles using the builtin tarfile module""" - + _can_rename = True - + def unpack(self, archive, output=None, package=None): tf = tarfile.open(archive, "r") members = tf.getmembers() @@ -253,7 +253,7 @@ class PimpTarUnpacker(PimpUnpacker): names = package.filterExpectedSkips(names) if names: return "Not all files were unpacked: %s" % " ".join(names) - + ARCHIVE_FORMATS = [ (".tar.Z", PimpTarUnpacker, None), (".taz", PimpTarUnpacker, None), @@ -266,8 +266,8 @@ ARCHIVE_FORMATS = [ class PimpPreferences: """Container for per-user preferences, such as the database to use and where to install packages.""" - - def __init__(self, + + def __init__(self, flavorOrder=None, downloadDir=None, buildDir=None, @@ -287,10 +287,10 @@ class PimpPreferences: self.buildDir = buildDir self.pimpDatabase = pimpDatabase self.watcher = None - + def setWatcher(self, watcher): self.watcher = watcher - + def setInstallDir(self, installDir=None): if installDir: # Installing to non-standard location. @@ -303,14 +303,14 @@ class PimpPreferences: installDir = DEFAULT_INSTALLDIR self.installLocations = [] self.installDir = installDir - + def isUserInstall(self): return self.installDir != DEFAULT_INSTALLDIR def check(self): """Check that the preferences make sense: directories exist and are writable, the install directory is on sys.path, etc.""" - + rv = "" RWX_OK = os.R_OK|os.W_OK|os.X_OK if not os.path.exists(self.downloadDir): @@ -337,7 +337,7 @@ class PimpPreferences: else: rv += "Warning: Install directory \"%s\" is not on sys.path\n" % self.installDir return rv - + def compareFlavors(self, left, right): """Compare two flavor strings. This is part of your preferences because whether the user prefers installing from source or binary is.""" @@ -348,13 +348,13 @@ class PimpPreferences: if right in self.flavorOrder: return 1 return cmp(left, right) - + class PimpDatabase: """Class representing a pimp database. It can actually contain information from multiple databases through inclusion, but the toplevel database is considered the master, as its maintainer is "responsible" for the contents.""" - + def __init__(self, prefs): self._packages = [] self.preferences = prefs @@ -363,23 +363,23 @@ class PimpDatabase: self._version = "" self._maintainer = "" self._description = "" - + # Accessor functions def url(self): return self._url def version(self): return self._version def maintainer(self): return self._maintainer def description(self): return self._description - + def close(self): """Clean up""" self._packages = [] self.preferences = None - + def appendURL(self, url, included=0): """Append packages from the database with the given URL. Only the first database should specify included=0, so the global information (maintainer, description) get stored.""" - + if url in self._urllist: return self._urllist.append(url) @@ -396,7 +396,7 @@ class PimpDatabase: if not self._version: sys.stderr.write("Warning: database has no Version information\n") elif self._version > PIMP_VERSION: - sys.stderr.write("Warning: database version %s newer than pimp version %s\n" + sys.stderr.write("Warning: database version %s newer than pimp version %s\n" % (self._version, PIMP_VERSION)) self._maintainer = plistdata.get('Maintainer', '') self._description = plistdata.get('Description', '').strip() @@ -405,12 +405,12 @@ class PimpDatabase: others = plistdata.get('Include', []) for url in others: self.appendURL(url, included=1) - + def _appendPackages(self, packages): """Given a list of dictionaries containing package descriptions create the PimpPackage objects and append them to our internal storage.""" - + for p in packages: p = dict(p) flavor = p.get('Flavor') @@ -421,27 +421,27 @@ class PimpDatabase: else: pkg = PimpPackage(self, dict(p)) self._packages.append(pkg) - + def list(self): """Return a list of all PimpPackage objects in the database.""" - + return self._packages - + def listnames(self): """Return a list of names of all packages in the database.""" - + rv = [] for pkg in self._packages: rv.append(pkg.fullname()) rv.sort() return rv - + def dump(self, pathOrFile): """Dump the contents of the database to an XML .plist file. - + The file can be passed as either a file object or a pathname. All data, including included databases, is dumped.""" - + packages = [] for pkg in self._packages: packages.append(pkg.dump()) @@ -453,15 +453,15 @@ class PimpDatabase: } plist = plistlib.Plist(**plistdata) plist.write(pathOrFile) - + def find(self, ident): """Find a package. The package can be specified by name or as a dictionary with name, version and flavor entries. - + Only name is obligatory. If there are multiple matches the best one (higher version number, flavors ordered according to users' preference) is returned.""" - + if type(ident) == str: # Remove ( and ) for pseudo-packages if ident[0] == '(' and ident[-1] == ')': @@ -491,7 +491,7 @@ class PimpDatabase: if not found or found < p: found = p return found - + ALLOWED_KEYS = [ "Name", "Version", @@ -511,7 +511,7 @@ ALLOWED_KEYS = [ class PimpPackage: """Class representing a single package.""" - + def __init__(self, db, plistdata): self._db = db name = plistdata["Name"] @@ -519,10 +519,10 @@ class PimpPackage: if not k in ALLOWED_KEYS: sys.stderr.write("Warning: %s: unknown key %s\n" % (name, k)) self._dict = plistdata - + def __getitem__(self, key): return self._dict[key] - + def name(self): return self._dict['Name'] def version(self): return self._dict.get('Version') def flavor(self): return self._dict.get('Flavor') @@ -531,13 +531,13 @@ class PimpPackage: def homepage(self): return self._dict.get('Home-page') def downloadURL(self): return self._dict.get('Download-URL') def systemwideOnly(self): return self._dict.get('Systemwide-only') - + def fullname(self): """Return the full name "name-version-flavor" of a package. - + If the package is a pseudo-package, something that cannot be installed through pimp, return the name in (parentheses).""" - + rv = self._dict['Name'] if self._dict.has_key('Version'): rv = rv + '-%s' % self._dict['Version'] @@ -547,14 +547,14 @@ class PimpPackage: # Pseudo-package, show in parentheses rv = '(%s)' % rv return rv - + def dump(self): """Return a dict object containing the information on the package.""" return self._dict - + def __cmp__(self, other): """Compare two packages, where the "better" package sorts lower.""" - + if not isinstance(other, PimpPackage): return cmp(id(self), id(other)) if self.name() != other.name(): @@ -562,15 +562,15 @@ class PimpPackage: if self.version() != other.version(): return -cmp(self.version(), other.version()) return self._db.preferences.compareFlavors(self.flavor(), other.flavor()) - + def installed(self): """Test wheter the package is installed. - + Returns two values: a status indicator which is one of "yes", "no", "old" (an older version is installed) or "bad" (something went wrong during the install test) and a human readable string which may contain more details.""" - + namespace = { "NotInstalled": _scriptExc_NotInstalled, "OldInstalled": _scriptExc_OldInstalled, @@ -602,16 +602,16 @@ class PimpPackage: sys.stderr.write("-------------------------------------\n") return "bad", "Package install test got exception" return "yes", "" - + def prerequisites(self): """Return a list of prerequisites for this package. - + The list contains 2-tuples, of which the first item is either a PimpPackage object or None, and the second is a descriptive string. The first item can be None if this package depends on something that isn't pimp-installable, in which case the descriptive string should tell the user what to do.""" - + rv = [] if not self._dict.get('Download-URL'): # For pseudo-packages that are already installed we don't @@ -619,7 +619,7 @@ class PimpPackage: status, _ = self.installed() if status == "yes": return [] - return [(None, + return [(None, "%s: This package cannot be installed automatically (no Download-URL field)" % self.fullname())] if self.systemwideOnly() and self._db.preferences.isUserInstall(): @@ -645,28 +645,28 @@ class PimpPackage: descr = pkg.shortdescription() rv.append((pkg, descr)) return rv - - + + def downloadPackageOnly(self, output=None): """Download a single package, if needed. - + An MD5 signature is used to determine whether download is needed, and to test that we actually downloaded what we expected. If output is given it is a file-like object that will receive a log of what happens. - + If anything unforeseen happened the method returns an error message string. """ - + scheme, loc, path, query, frag = urlparse.urlsplit(self._dict['Download-URL']) path = urllib.url2pathname(path) filename = os.path.split(path)[1] - self.archiveFilename = os.path.join(self._db.preferences.downloadDir, filename) + self.archiveFilename = os.path.join(self._db.preferences.downloadDir, filename) if not self._archiveOK(): if scheme == 'manual': return "Please download package manually and save as %s" % self.archiveFilename - downloader = PimpUrllibDownloader(None, self._db.preferences.downloadDir, + downloader = PimpUrllibDownloader(None, self._db.preferences.downloadDir, watcher=self._db.preferences.watcher) if not downloader.download(self._dict['Download-URL'], self.archiveFilename, output): @@ -675,10 +675,10 @@ class PimpPackage: return "archive not found after download" if not self._archiveOK(): return "archive does not have correct MD5 checksum" - + def _archiveOK(self): """Test an archive. It should exist and the MD5 checksum should be correct.""" - + if not os.path.exists(self.archiveFilename): return 0 if not self._dict.get('MD5Sum'): @@ -687,10 +687,10 @@ class PimpPackage: data = open(self.archiveFilename, 'rb').read() checksum = md5.new(data).hexdigest() return checksum == self._dict['MD5Sum'] - + def unpackPackageOnly(self, output=None): """Unpack a downloaded package archive.""" - + filename = os.path.split(self.archiveFilename)[1] for ext, unpackerClass, arg in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: @@ -698,43 +698,43 @@ class PimpPackage: else: return "unknown extension for archive file: %s" % filename self.basename = filename[:-len(ext)] - unpacker = unpackerClass(arg, dir=self._db.preferences.buildDir, + unpacker = unpackerClass(arg, dir=self._db.preferences.buildDir, watcher=self._db.preferences.watcher) rv = unpacker.unpack(self.archiveFilename, output=output) if rv: return rv - + def installPackageOnly(self, output=None): """Default install method, to be overridden by subclasses""" return "%s: This package needs to be installed manually (no support for flavor=\"%s\")" \ % (self.fullname(), self._dict.get(flavor, "")) - + def installSinglePackage(self, output=None): """Download, unpack and install a single package. - + If output is given it should be a file-like object and it will receive a log of what happened.""" - + if not self._dict.get('Download-URL'): return "%s: This package needs to be installed manually (no Download-URL field)" % self.fullname() msg = self.downloadPackageOnly(output) if msg: return "%s: download: %s" % (self.fullname(), msg) - + msg = self.unpackPackageOnly(output) if msg: return "%s: unpack: %s" % (self.fullname(), msg) - + return self.installPackageOnly(output) - + def beforeInstall(self): """Bookkeeping before installation: remember what we have in site-packages""" self._old_contents = os.listdir(self._db.preferences.installDir) - + def afterInstall(self): """Bookkeeping after installation: interpret any new .pth files that have appeared""" - + new_contents = os.listdir(self._db.preferences.installDir) for fn in new_contents: if fn in self._old_contents: @@ -757,7 +757,7 @@ class PimpPackage: line = os.path.join(self._db.preferences.installDir, line) line = os.path.realpath(line) if not line in sys.path: - sys.path.append(line) + sys.path.append(line) def filterExpectedSkips(self, names): """Return a list that contains only unpexpected skips""" @@ -780,21 +780,21 @@ class PimpPackage_binary(PimpPackage): def unpackPackageOnly(self, output=None): """We don't unpack binary packages until installing""" pass - + def installPackageOnly(self, output=None): """Install a single source package. - + If output is given it should be a file-like object and it will receive a log of what happened.""" - + if self._dict.has_key('Install-command'): return "%s: Binary package cannot have Install-command" % self.fullname() - + if self._dict.has_key('Pre-install-command'): if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) - + self.beforeInstall() # Install by unpacking @@ -805,7 +805,7 @@ class PimpPackage_binary(PimpPackage): else: return "%s: unknown extension for archive file: %s" % (self.fullname(), filename) self.basename = filename[:-len(ext)] - + install_renames = [] for k, newloc in self._db.preferences.installLocations: if not newloc: @@ -815,22 +815,22 @@ class PimpPackage_binary(PimpPackage): else: return "%s: Don't know installLocation %s" % (self.fullname(), k) install_renames.append((oldloc, newloc)) - + unpacker = unpackerClass(arg, dir="/", renames=install_renames) rv = unpacker.unpack(self.archiveFilename, output=output, package=self) if rv: return rv - + self.afterInstall() - + if self._dict.has_key('Post-install-command'): if _cmd(output, self._buildDirname, self._dict['Post-install-command']): return "%s: post-install: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None - - + + class PimpPackage_source(PimpPackage): def unpackPackageOnly(self, output=None): @@ -844,15 +844,15 @@ class PimpPackage_source(PimpPackage): def installPackageOnly(self, output=None): """Install a single source package. - + If output is given it should be a file-like object and it will receive a log of what happened.""" - + if self._dict.has_key('Pre-install-command'): if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) - + self.beforeInstall() installcmd = self._dict.get('Install-command') if installcmd and self._install_renames: @@ -882,45 +882,45 @@ class PimpPackage_source(PimpPackage): rv = None shutil.rmtree(unwanted_install_dir) return rv - + self.afterInstall() - + if self._dict.has_key('Post-install-command'): if _cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None - - + + class PimpInstaller: """Installer engine: computes dependencies and installs packages in the right order.""" - + def __init__(self, db): self._todo = [] self._db = db self._curtodo = [] self._curmessages = [] - + def __contains__(self, package): return package in self._todo - + def _addPackages(self, packages): for package in packages: if not package in self._todo: self._todo.append(package) - + def _prepareInstall(self, package, force=0, recursive=1): """Internal routine, recursive engine for prepareInstall. - + Test whether the package is installed and (if not installed or if force==1) prepend it to the temporary todo list and call ourselves recursively on all prerequisites.""" - + if not force: status, message = package.installed() if status == "yes": - return + return if package in self._todo or package in self._curtodo: return self._curtodo.insert(0, package) @@ -932,17 +932,17 @@ class PimpInstaller: self._prepareInstall(pkg, False, recursive) else: self._curmessages.append("Problem with dependency: %s" % descr) - + def prepareInstall(self, package, force=0, recursive=1): """Prepare installation of a package. - + If the package is already installed and force is false nothing is done. If recursive is true prerequisites are installed first. - + Returns a list of packages (to be passed to install) and a list of messages of any problems encountered. """ - + self._curtodo = [] self._curmessages = [] self._prepareInstall(package, force, recursive) @@ -950,10 +950,10 @@ class PimpInstaller: self._curtodo = [] self._curmessages = [] return rv - + def install(self, packages, output): """Install a list of packages.""" - + self._addPackages(packages) status = [] for pkg in self._todo: @@ -961,12 +961,12 @@ class PimpInstaller: if msg: status.append(msg) return status - - - + + + def _run(mode, verbose, force, args, prefargs, watcher): """Engine for the main program""" - + prefs = PimpPreferences(**prefargs) if watcher: prefs.setWatcher(watcher) @@ -975,7 +975,7 @@ def _run(mode, verbose, force, args, prefargs, watcher): sys.stdout.write(rv) db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) - + if mode == 'dump': db.dump(sys.stdout) elif mode =='list': @@ -1050,7 +1050,7 @@ def _run(mode, verbose, force, args, prefargs, watcher): def main(): """Minimal commandline tool to drive pimp.""" - + import getopt def _help(): print "Usage: pimp [options] -s [package ...] List installed status" @@ -1065,12 +1065,12 @@ def main(): print " (default: %s)" % DEFAULT_INSTALLDIR print " -u url URL for database" sys.exit(1) - + class _Watcher: def update(self, msg): sys.stderr.write(msg + '\r') return 1 - + try: opts, args = getopt.getopt(sys.argv[1:], "slifvdD:Vu:") except getopt.GetoptError: @@ -1133,8 +1133,6 @@ if __name__ != 'pimp_update': (pimp_update.PIMP_VERSION, PIMP_VERSION)) else: from pimp_update import * - + if __name__ == '__main__': main() - - diff --git a/Lib/plat-mac/videoreader.py b/Lib/plat-mac/videoreader.py index 646c726..f16228b 100644 --- a/Lib/plat-mac/videoreader.py +++ b/Lib/plat-mac/videoreader.py @@ -34,19 +34,19 @@ class VideoFormat: self.__width = width self.__height = height self.__format = format - + def getname(self): return self.__name - + def getdescr(self): return self.__descr - + def getsize(self): return self.__width, self.__height - + def getformat(self): return self.__format - + class _Reader: def __init__(self, path): fd = Qt.OpenMovieFile(path, 0) @@ -66,8 +66,8 @@ class _Reader: self.audiodescr = _audiodescr(handle.data) self.audiotimescale = self.audiomedia.GetMediaTimeScale() del handle - - try: + + try: self.videotrack = self.movie.GetMovieIndTrackType(1, QuickTime.VisualMediaCharacteristic, QuickTime.movieTrackCharacteristic) self.videomedia = self.videotrack.GetTrackMedia() @@ -81,14 +81,14 @@ class _Reader: self.videocurtime = None self.audiocurtime = None - + def __del__(self): self.audiomedia = None self.audiotrack = None self.videomedia = None self.videotrack = None self.movie = None - + def _initgworld(self): old_port, old_dev = Qdoffs.GetGWorld() try: @@ -108,34 +108,34 @@ class _Reader: # XXXX framerate finally: Qdoffs.SetGWorld(old_port, old_dev) - + def _gettrackduration_ms(self, track): tracktime = track.GetTrackDuration() return self._movietime_to_ms(tracktime) - + def _movietime_to_ms(self, time): value, d1, d2 = Qt.ConvertTimeScale((time, self.movietimescale, None), 1000) return value - + def _videotime_to_ms(self, time): value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), 1000) return value - + def _audiotime_to_ms(self, time): value, d1, d2 = Qt.ConvertTimeScale((time, self.audiotimescale, None), 1000) return value - + def _videotime_to_movietime(self, time): value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), self.movietimescale) return value - + def HasAudio(self): return not self.audiotrack is None - + def HasVideo(self): return not self.videotrack is None - + def GetAudioDuration(self): if not self.audiotrack: return 0 @@ -145,7 +145,7 @@ class _Reader: if not self.videotrack: return 0 return self._gettrackduration_ms(self.videotrack) - + def GetAudioFormat(self): if not self.audiodescr: return None, None, None, None, None @@ -172,20 +172,20 @@ class _Reader: encoding = 'linear-signed' else: encoding = 'quicktime-coding-%s'%self.audiodescr['dataFormat'] -## return audio.format.AudioFormatLinear('quicktime_audio', 'QuickTime Audio Format', +## return audio.format.AudioFormatLinear('quicktime_audio', 'QuickTime Audio Format', ## channels, encoding, blocksize=blocksize, fpb=fpb, bps=bps) return channels, encoding, blocksize, fpb, bps - + def GetAudioFrameRate(self): if not self.audiodescr: return None return int(self.audiodescr['sampleRate']) - + def GetVideoFormat(self): width = self.videodescr['width'] height = self.videodescr['height'] return VideoFormat('dummy_format', 'Dummy Video Format', width, height, macrgb) - + def GetVideoFrameRate(self): tv = self.videocurtime if tv == None: @@ -194,7 +194,7 @@ class _Reader: tv, dur = self.videomedia.GetMediaNextInterestingTime(flags, tv, 1.0) dur = self._videotime_to_ms(dur) return int((1000.0/dur)+0.5) - + def ReadAudio(self, nframes, time=None): if not time is None: self.audiocurtime = time @@ -210,7 +210,7 @@ class _Reader: self.audiomedia.GetMediaSample(h, 0, tv, desc_h, nframes) self.audiocurtime = actualtime + actualcount*sampleduration return self._audiotime_to_ms(actualtime), h.data - + def ReadVideo(self, time=None): if not time is None: self.videocurtime = time @@ -226,7 +226,7 @@ class _Reader: self.movie.SetMovieTimeValue(moviecurtime) self.movie.MoviesTask(0) return self._videotime_to_ms(self.videocurtime), self._getpixmapcontent() - + def _getpixmapcontent(self): """Shuffle the offscreen PixMap data, because it may have funny stride values""" rowbytes = Qdoffs.GetPixRowBytes(self.pixmap) @@ -281,12 +281,11 @@ def _test(): wrt.write(data) timestamp, data = rdr.ReadVideo() MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG') - if num > 20: + if num > 20: print 'stopping at 20 frames so your disk does not fill up:-)' break print 'Total frames:', num - + if __name__ == '__main__': _test() sys.exit(1) - |