Nicolas Cellier uploaded a new version of Universes to project The Trunk:
http://source.squeak.org/trunk/Universes-nice.44.mcz ==================== Summary ==================== Name: Universes-nice.44 Author: nice Time: 23 March 2010, 10:12:52.427 pm UUID: fc50a0e7-cc49-49fb-8503-9e71721134b9 Ancestors: Universes-nice.43 Fix underscores =============== Diff against Universes-nice.43 =============== Item was changed: ----- Method: UGlobalInstallerTest>>testBrokenDependency (in category 'Running') ----- testBrokenDependency | installer neededPackages | installer := UGlobalInstaller universe: universe. + neededPackages := installer allPackagesNeededToInstall: (universe newestPackageNamed: 'Broken') orIfImpossible: [ :ign | nil ]. - neededPackages _ installer allPackagesNeededToInstall: (universe newestPackageNamed: 'Broken') orIfImpossible: [ :ign | nil ]. self should: [ neededPackages isNil ]. ! Item was changed: ----- Method: UUniverse>>newestPackageNamed: (in category 'packages') ----- newestPackageNamed: name | potentials sorted | + potentials := self packagesNamed: name. + sorted := potentials asSortedCollection: [ :p1 :p2 | p1 version < p2 version ]. - potentials _ self packagesNamed: name. - sorted _ potentials asSortedCollection: [ :p1 :p2 | p1 version < p2 version ]. ^sorted last! Item was changed: ----- Method: UUniverseMultiServer>>processConnection: (in category 'networking') ----- processConnection: aConnection | message | aConnection isConnected ifFalse: [ ^self destroyConnection: aConnection ]. "process all incoming messages. Note that some messages move the connection to one of the subsidiary servers, so be careful not to process messages after that happens" aConnection processIO. [ (connections includes: aConnection) and: [ + message := aConnection nextOrNil. - message _ aConnection nextOrNil. message notNil ] ] whileTrue: [ self processRawMessage: message fromConnection: aConnection ]. (connections includes: aConnection) ifFalse: [ ^self ]. aConnection isConnected ifTrue: [ aConnection processIO. "start sending out the response" ] ifFalse: [ self destroyConnection: aConnection ] ! Item was changed: ----- Method: UPackageEditor>>morphicView (in category 'user interface') ----- morphicView | win column nameRow versionRow urlRow descriptionField submitButton dependsRow homepageRow providesRow maintainerRow categoryRow smidRow | window ifNotNil: [ ^window ]. + win := SystemWindow labelled: 'Package Editor'. - win _ SystemWindow labelled: 'Package Editor'. win model: self. + column := AlignmentMorph newColumn. - column _ AlignmentMorph newColumn. win addMorph: column frame: (0@0 extent: 1@0.6). + nameRow := UInterfaceUtilities makeFieldRowNamed: 'name:' getSelector: #packageName setSelector: #packageName: for: self. - nameRow _ UInterfaceUtilities makeFieldRowNamed: 'name:' getSelector: #packageName setSelector: #packageName: for: self. column addMorphBack: nameRow. + versionRow := UInterfaceUtilities makeFieldRowNamed: 'version:' getSelector: #versionString setSelector: #versionString: for: self. - versionRow _ UInterfaceUtilities makeFieldRowNamed: 'version:' getSelector: #versionString setSelector: #versionString: for: self. column addMorphBack: versionRow. + categoryRow := UInterfaceUtilities makeFieldRowNamed: 'category:' getSelector: #categoryString setSelector: #categoryString: for: self. - categoryRow _ UInterfaceUtilities makeFieldRowNamed: 'category:' getSelector: #categoryString setSelector: #categoryString: for: self. column addMorphBack: categoryRow. + maintainerRow := UInterfaceUtilities makeFieldRowNamed: 'maintainer:' getSelector: #maintainer setSelector: #maintainer: for: self. - maintainerRow _ UInterfaceUtilities makeFieldRowNamed: 'maintainer:' getSelector: #maintainer setSelector: #maintainer: for: self. column addMorphBack: maintainerRow. + homepageRow := UInterfaceUtilities makeFieldRowNamed: 'homepage:' getSelector: #homepageString setSelector: #homepageString: for: self. - homepageRow _ UInterfaceUtilities makeFieldRowNamed: 'homepage:' getSelector: #homepageString setSelector: #homepageString: for: self. column addMorphBack: homepageRow. + smidRow := UInterfaceUtilities makeFieldRowNamed: 'SqueakMap ID:' getSelector: #smidString setSelector: #smidString: for: self. - smidRow _ UInterfaceUtilities makeFieldRowNamed: 'SqueakMap ID:' getSelector: #smidString setSelector: #smidString: for: self. smidRow addMorphBack: self makeGuessSMIDButton. column addMorphBack: smidRow. + urlRow := UInterfaceUtilities makeFieldRowNamed: 'download from:' getSelector: #urlString setSelector: #urlString: for: self. - urlRow _ UInterfaceUtilities makeFieldRowNamed: 'download from:' getSelector: #urlString setSelector: #urlString: for: self. column addMorphBack: urlRow. + providesRow := UInterfaceUtilities makeFieldRowNamed: 'provides:' getSelector: #providesString setSelector: #providesString: for: self. - providesRow _ UInterfaceUtilities makeFieldRowNamed: 'provides:' getSelector: #providesString setSelector: #providesString: for: self. column addMorphBack: providesRow. + dependsRow := UInterfaceUtilities makeFieldRowNamed: 'depends:' getSelector: #dependsString setSelector: #dependsString: for: self. - dependsRow _ UInterfaceUtilities makeFieldRowNamed: 'depends:' getSelector: #dependsString setSelector: #dependsString: for: self. column addMorphBack: dependsRow. column addMorphBack: (StringMorph contents: 'Description:'). + descriptionField := self makeFieldGet: #description set: #description:. - descriptionField _ self makeFieldGet: #description set: #description:. win addMorph: descriptionField frame: (0@0.6 extent: 1@0.3). + submitButton := UInterfaceUtilities makeButtonWithAction: #submit andLabel: 'Submit' for: self. - submitButton _ UInterfaceUtilities makeButtonWithAction: #submit andLabel: 'Submit' for: self. win addMorph: submitButton frame: (0@0.9 extent: 1@0.1). + ^window := win! - ^window _ win! Item was changed: ----- Method: UInterfaceUtilities classSide>>makeFieldRowNamed:getSelector:setSelector:isPassword:for: (in category 'as yet unclassified') ----- makeFieldRowNamed: fieldName getSelector: getSelector setSelector: setSelector isPassword: isPassword for: model | row field | + row := AlignmentMorph newRow. - row _ AlignmentMorph newRow. row color: Color transparent. row cellInset: 3@0. + field := self makeFieldGet: getSelector set: setSelector for: model. - field _ self makeFieldGet: getSelector set: setSelector for: model. isPassword ifTrue:[ field font: (StrikeFont passwordFontSize: TextStyle default defaultFont pointSize) ]. row addMorph: (StringMorph contents: fieldName). row addMorphBack: field. ^row ! Item was changed: ----- Method: UUniverseServer>>saveDirectory: (in category 'initialize-release') ----- saveDirectory: aDirectory + saveDirectory := aDirectory! - saveDirectory _ aDirectory! Item was changed: ----- Method: UConfiguration>>initialize (in category 'initialize-release') ----- initialize + installedPackages := Set new.! - installedPackages _ Set new.! Item was changed: ----- Method: UStandardUniverse>>updatePackagesViaWWW (in category 'packages') ----- updatePackagesViaWWW | rawPackageList newPackages | packagesURL ifNil: [ ^self ]. + rawPackageList := packagesURL retrieveContents content. - rawPackageList _ packagesURL retrieveContents content. (rawPackageList withBlanksTrimmed beginsWith: '<') ifFalse: [ "it is possible that the universe is completely empty, but more likely there was an error retrieving the document" ^self ]. + newPackages := UPackage decodePackagesFromXMLStream: (ReadStream on: rawPackageList). - newPackages _ UPackage decodePackagesFromXMLStream: (ReadStream on: rawPackageList). self packages: newPackages! Item was changed: ----- Method: UPackage>>description: (in category 'initialize-release') ----- description: aString + description := aString! - description _ aString! Item was changed: ----- Method: UUniverse>>packageNames (in category 'packages') ----- packageNames | names | + names := Set new. - names _ Set new. self packages do: [ :p | names add: p name ]. ^names! Item was changed: ----- Method: UMRemovePackage>>username:password:packageName:packageVersion: (in category 'initialize-release') ----- username: username0 password: password0 packageName: packageName0 packageVersion: packageVersion0 + username := username0. + password := password0. + packageName := packageName0. + packageVersion := packageVersion0. - username _ username0. - password _ password0. - packageName _ packageName0. - packageVersion _ packageVersion0. ! Item was changed: ----- Method: StringSocket classSide>>encodeStringArray: (in category '*universes') ----- encodeStringArray: stringArray | size outBuf outBufIndex | + size := self spaceToEncode: stringArray. - size _ self spaceToEncode: stringArray. + outBuf := String new: size. + outBufIndex := 1. - outBuf _ String new: size. - outBufIndex _ 1. outBuf putInteger32: stringArray size at: outBufIndex. + outBufIndex := outBufIndex + 4. - outBufIndex _ outBufIndex + 4. stringArray do: [ :each | outBuf putInteger32: each size at: outBufIndex. + outBufIndex := outBufIndex + 4. - outBufIndex _ outBufIndex + 4. outBuf replaceFrom: outBufIndex to: outBufIndex + each size - 1 with: each startingAt: 1. + outBufIndex := outBufIndex + each size. - outBufIndex _ outBufIndex + each size. ]. ^outBuf! Item was changed: ----- Method: UUniverseMultiServer>>checkForNewConnections (in category 'networking') ----- checkForNewConnections connectionQueue ifNil: [ ^self ]. [ connections size < 100 ] whileTrue: [ | newSocket | + newSocket := connectionQueue getConnectionOrNil. - newSocket _ connectionQueue getConnectionOrNil. newSocket ifNil: [ ^self ]. connections add: (StringSocket on: newSocket) ]. ! Item was changed: ----- Method: UUniverseServer>>startListening (in category 'networking') ----- startListening self stopListening. + connectionQueue := ConnectionQueue portNumber: universe serverPort queueLength: 5. - connectionQueue _ ConnectionQueue portNumber: universe serverPort queueLength: 5. ! Item was changed: ----- Method: UPolicyResponse>>allowed: (in category 'accessing') ----- allowed: anObject + allowed := anObject! - allowed _ anObject! Item was changed: ----- Method: UUniverseEditor>>newPackageVersion (in category 'package editing') ----- newPackageVersion | package editor newPackage | self anyPackageSelected ifFalse: [ ^self ]. self acceptFields. + package := self selectedPackage. - package _ self selectedPackage. + newPackage := package deepCopy. - newPackage _ package deepCopy. newPackage version: (UVersion readFromString: (newPackage version asString, 'new')). + editor := UPackageEditor package: newPackage whenComplete: [ :p | - editor _ UPackageEditor package: newPackage whenComplete: [ :p | self acceptFields. self sendMessage: (UMAddPackage username: username password: password package: p) ]. editor openInMorphic. packageEditors add: editor. ! Item was changed: ----- Method: UUniverse>>shortName: (in category 'initialize-release') ----- shortName: aString + shortName := aString - shortName _ aString ! Item was changed: ----- Method: UAccount>>password: (in category 'accessing') ----- password: anObject + password := anObject! - password _ anObject! Item was changed: ----- Method: UUniverseServer>>stopListening (in category 'networking') ----- stopListening connectionQueue ifNotNil: [ connectionQueue destroy. + connectionQueue := nil ]. - connectionQueue _ nil ]. ! Item was changed: ----- Method: UPackage classSide>>decodeFromXMLElement: (in category 'decoding') ----- decodeFromXMLElement: doc | package urlString | + package := self new. - package _ self new. package name: (self getXMLPartNamed: 'name' from: doc). package version: (UVersion readFromString: (self getXMLPartNamed: 'version' from: doc)). package description: (self getXMLPartNamed: 'description' from: doc). + urlString := self getXMLPartNamed: 'url' from: doc. - urlString _ self getXMLPartNamed: 'url' from: doc. urlString isEmpty ifFalse: [ (urlString withBlanksTrimmed beginsWith: 'http://(') ifFalse: [ package url: (Url absoluteFromText: urlString). ] ]. (doc elementAt: 'homepage') ifNotNil: [ package homepage: (Url absoluteFromText: (self getXMLPartNamed: 'homepage' from: doc)) ]. package maintainer: (self getXMLPartNamed: 'maintainer' from: doc). package provides: (self getXMLPackageList: 'provides' from: doc). package depends: (self getXMLPackageList: 'depends' from: doc). (doc elementAt: 'category') ifNotNil: [ package category: (UPackageCategory readFromString: (self getXMLPartNamed: 'category' from: doc ))]. (doc elementAt: 'squeakMapID') ifNotNil: [ | idstr | idstr := self getXMLPartNamed: 'squeakMapID' from: doc. idstr isEmpty ifFalse: [ package squeakMapID: (UUID fromString: idstr)]]. ^package! Item was changed: ----- Method: UUniverse>>initialize (in category 'initialize-release') ----- initialize + description := 'some universe'.! - description _ 'some universe'.! Item was changed: ----- Method: UUniverseServer>>policy: (in category 'initialize-release') ----- policy: aPolicy + policy := aPolicy! - policy _ aPolicy! Item was changed: ----- Method: UAccountEditor>>password1: (in category 'accessing') ----- password1: aString + newPassword := aString asString. - newPassword _ aString asString. self changed: #password1. ^true! Item was changed: ----- Method: UPWild>>changeUser:withPassword:toHavePassword:andNewEmail: (in category 'policies') ----- changeUser: username withPassword: password toHavePassword: newPassword andNewEmail: newEmail | account | + account := self findAccount: username withPassword: password. - account _ self findAccount: username withPassword: password. account ifNil: [ ^UPolicyResponse denied: 'username not present or password does not match' ]. newPassword isEmpty ifFalse: [account password: newPassword ]. newEmail isEmpty ifFalse: [account email: newEmail ]. ^UPolicyResponse allowed! Item was changed: ----- Method: UMAddAccount>>username:password:email: (in category 'initialize-release') ----- username: username0 password: password0 email: email0 + username := username0. + password := password0. + email := email0. - username _ username0. - password _ password0. - email _ email0. ! Item was changed: ----- Method: UUniverseEditor>>editAccount (in category 'account') ----- editAccount | editor | self acceptFields. self closeAccountEditor. + editor := UAccountEditor - editor _ UAccountEditor username: username password: password email: '' whenDone: [ :oldPassword :newPassword :newEmail | + password := oldPassword. - password _ oldPassword. self sendMessage: (UMEditAccount username: username password: password newPassword: newPassword newEmail: newEmail) ]. editor openInMorphic. + accountEditor := editor.! - accountEditor _ editor.! Item was changed: ----- Method: UPackage>>url: (in category 'initialize-release') ----- url: aURL + url := aURL! - url _ aURL! Item was changed: ----- Method: UUniverseEditor>>newPackage (in category 'package editing') ----- newPackage | editor | self acceptFields. + editor := UPackageEditor package: self createNewPackage whenComplete: [ :p | - editor _ UPackageEditor package: self createNewPackage whenComplete: [ :p | self acceptFields. self sendMessage: (UMAddPackage username: username password: password package: p) ]. editor openInMorphic. packageEditors add: editor. ! Item was changed: ----- Method: UUniverseBrowser>>morphicView (in category 'user interface') ----- morphicView | win packageList installButton doInstallButton buttonList upgradeButton updateListButton descriptionArea installButtonHolder | + win := SystemWindow labelled: 'Universe'. - win _ SystemWindow labelled: 'Universe'. win model: self. + packageList := - packageList _ PluggableTreeMorph new model: self; name: 'package list'; getRootsSelector: #rootCategoriesAndPackages; hasChildrenSelector: #isCategory:; getChildrenSelector: #categoriesAndPackagesIn:; setSelectedSelector: #selectPackageOrCategory:; getLabelSelector: #packageOneLineDescription:. win addMorph: packageList frame: ((0@0) extent: (0.5@0.9)). + installButtonHolder := Morph new. "necessary to keep SystemWindow from screwing up the colors of the button" - installButtonHolder _ Morph new. "necessary to keep SystemWindow from screwing up the colors of the button" installButtonHolder name: 'holder for install button'; layoutPolicy: TableLayout new; borderColor: self defaultBackgroundColor. + doInstallButton := self makeButtonWithAction: #doInstall andGetState: #anyPackagesToInstall andLabel: 'Install Selections'. - doInstallButton _ self makeButtonWithAction: #doInstall andGetState: #anyPackagesToInstall andLabel: 'Install Selections'. doInstallButton useSquareCorners; borderWidth: 0; setBalloonText: 'Download and install all the packages that you have selected'; name: 'install selections button'. installButtonHolder addMorph: doInstallButton. win addMorph: installButtonHolder frame: ((0@0.9) extent:(1@0.1)). + descriptionArea := PluggableTextMorph on: self text: #selectedPackageDescription accept: nil. - descriptionArea _ PluggableTextMorph on: self text: #selectedPackageDescription accept: nil. win addMorph: descriptionArea frame: ((0.5@0.4) extent: (0.5@0.5)). + buttonList := AlignmentMorph newColumn. - buttonList _ AlignmentMorph newColumn. buttonList cellInset: 0@3; name: 'button list'. win addMorph: buttonList frame: ((0.5@0) extent: (0.5@0.4)). + installButton := self makeButtonWithAction: #installSelectedPackage andGetState: #canMarkSelectionForInstallation andLabel: 'select package'. - installButton _ self makeButtonWithAction: #installSelectedPackage andGetState: #canMarkSelectionForInstallation andLabel: 'select package'. installButton setBalloonText: 'Select this package for installation'. buttonList addMorph: installButton. + upgradeButton := self makeButtonWithAction: #chooseUpgrades andLabel: 'select all upgrades'. - upgradeButton _ self makeButtonWithAction: #chooseUpgrades andLabel: 'select all upgrades'. upgradeButton setBalloonText: 'Select every possible upgrade for the currently installed packages'. buttonList addMorphBack: upgradeButton. + updateListButton := self makeButtonWithAction: #requestPackageList andLabel: 'update list from network'. - updateListButton _ self makeButtonWithAction: #requestPackageList andLabel: 'update list from network'. updateListButton setBalloonText: 'Refresh the list of available packages from the network'. buttonList addMorphBack: updateListButton. ^win! Item was changed: ----- Method: UStandardUniverse>>serverName: (in category 'initialize-release') ----- serverName: aString + serverName := aString! - serverName _ aString! Item was changed: ----- Method: UPackage>>maintainer: (in category 'initialize-release') ----- maintainer: aString + maintainer := aString! - maintainer _ aString! Item was changed: ----- Method: UStandardUniverse>>packages: (in category 'initialize-release') ----- packages: aCollection + packages := Set new. - packages _ Set new. packages addAll: aCollection. self changed: #packages! Item was changed: ----- Method: UStandardUniverse>>serverPort: (in category 'initialize-release') ----- serverPort: port + serverPort := port! - serverPort _ port! Item was changed: ----- Method: UPolicyResponse>>reason: (in category 'accessing') ----- reason: anObject + reason := anObject! - reason _ anObject! Item was changed: ----- Method: UAccountEditor>>newEmail: (in category 'accessing') ----- newEmail: anObject + newEmail := anObject! - newEmail _ anObject! Item was changed: ----- Method: UAccount>>username: (in category 'accessing') ----- username: anObject + username := anObject! - username _ anObject! Item was changed: ----- Method: UUniverseServer>>connection:requestedAccountChangeForUsername:password:newPassword:newEmail: (in category 'editing') ----- connection: connection requestedAccountChangeForUsername: username password: password newPassword: newPassword newEmail: newEmail | response | + response := policy changeUser: username withPassword: password toHavePassword: newPassword andNewEmail: newEmail. - response _ policy changeUser: username withPassword: password toHavePassword: newPassword andNewEmail: newEmail. response allowed ifFalse: [ ^self sendError: 'changing account for ', username, ' failed (', response reason, ')' onConnection: connection]. self sendMessage: (UMEditedAccount username: username newPassword: newPassword newEmail: newEmail) onConnection: connection! Item was changed: ----- Method: UOneShotConnection>>initializeWithInMessage:andOutQueue: (in category 'initialize-release') ----- initializeWithInMessage: inMessage0 andOutQueue: aSharedQueue + inputMessage := inMessage0. + outputQueue := aSharedQueue. + hasBeenRead := false. + hasBeenWritten := false.! - inputMessage _ inMessage0. - outputQueue _ aSharedQueue. - hasBeenRead _ false. - hasBeenWritten _ false.! Item was changed: ----- Method: UMessage classSide>>fromStringArray: (in category 'instance creation') ----- fromStringArray: array | class | + class := nil. + array first = 'requestpackages' ifTrue: [ class := UMRequestPackages ]. + array first = 'packages' ifTrue: [ class := UMPackageList ]. + array first = 'error' ifTrue: [ class := UMError ]. + array first = 'addaccount' ifTrue: [ class := UMAddAccount ]. + array first = 'addpackage' ifTrue: [ class := UMAddPackage ]. + array first = 'editaccount' ifTrue: [ class := UMEditAccount ]. + array first = 'editedaccount' ifTrue: [ class := UMEditedAccount ]. + array first = 'packageadded' ifTrue: [ class := UMPackageAdded ]. + array first = 'packageremoved' ifTrue: [ class := UMPackageRemoved ]. + array first = 'removepackage' ifTrue: [ class := UMRemovePackage ]. + array first = 'selectserver' ifTrue: [ class := UMSelectServer ]. + array first = 'protocolversion' ifTrue: [ class := UMProtocolVersion ]. - class _ nil. - array first = 'requestpackages' ifTrue: [ class _ UMRequestPackages ]. - array first = 'packages' ifTrue: [ class _ UMPackageList ]. - array first = 'error' ifTrue: [ class _ UMError ]. - array first = 'addaccount' ifTrue: [ class _ UMAddAccount ]. - array first = 'addpackage' ifTrue: [ class _ UMAddPackage ]. - array first = 'editaccount' ifTrue: [ class _ UMEditAccount ]. - array first = 'editedaccount' ifTrue: [ class _ UMEditedAccount ]. - array first = 'packageadded' ifTrue: [ class _ UMPackageAdded ]. - array first = 'packageremoved' ifTrue: [ class _ UMPackageRemoved ]. - array first = 'removepackage' ifTrue: [ class _ UMRemovePackage ]. - array first = 'selectserver' ifTrue: [ class _ UMSelectServer ]. - array first = 'protocolversion' ifTrue: [ class _ UMProtocolVersion ]. class ifNil: [ ^UMMalformed fromStringArray: array ]. ^[ class fromStringArray: array ] on: Error do: [ :ex | UMMalformed fromStringArray: array ]! Item was changed: ----- Method: UUniverseClient>>startConnecting (in category 'networking') ----- startConnecting "start a new connection to the server" self disconnect. + lastConnectionStart := DateAndTime now. - lastConnectionStart _ DateAndTime now. + socket := Socket newTCP. - socket _ Socket newTCP. socket connectTo: (NetNameResolver addressForName: universe serverName) port: universe serverPort. ! Item was changed: ----- Method: UMEditedAccount>>username:newPassword:newEmail: (in category 'initialize-release') ----- username: username0 newPassword: newPassword0 newEmail: newEmail0 + username := username0. + newPassword := newPassword0. + newEmail := newEmail0. - username _ username0. - newPassword _ newPassword0. - newEmail _ newEmail0. ! Item was changed: ----- Method: UPWild>>addUser:withPassword:andEmail: (in category 'policies') ----- addUser: username withPassword: password andEmail: email | newAccount | (accounts anySatisfy: [ :acc | acc username = username]) ifTrue: [ "already an account here" ^UPolicyResponse denied: 'account already exists' ]. superUser ifNotNil: [ superUser username = username ifTrue: [ "cannot create an account with the superuser's name" ^UPolicyResponse denied: 'same account name as the superuser' ] ]. (self class isReasonableUsername: username) ifFalse: [ ^UPolicyResponse denied: 'invalid account name' ]. + newAccount := UAccount new. - newAccount _ UAccount new. newAccount username: username. newAccount password: password. newAccount email: email. accounts add: newAccount. ^UPolicyResponse allowed! Item was changed: ----- Method: UPackage>>name: (in category 'initialize-release') ----- name: aString + name := aString! - name _ aString! Item was changed: ----- Method: UUniverseMultiServer>>switchConnection:toServerNamed: (in category 'messages') ----- switchConnection: aConnection toServerNamed: serverName | server | + server := servers detect: [ :s | s universe shortName = serverName ] ifNone: [ - server _ servers detect: [ :s | s universe shortName = serverName ] ifNone: [ aConnection nextPut: (UMError description: 'no such server here') asStringArray. ^self ]. server acceptConnection: aConnection. connections remove: aConnection. ! Item was changed: ----- Method: UMPackageRemoved>>packageName:version: (in category 'initialize-release') ----- packageName: aString version: aVersion + packageName := aString. + version := aVersion.! - packageName _ aString. - version _ aVersion.! Item was changed: ----- Method: UAccount>>initialize (in category 'initialize-release') ----- initialize + username := 'joeblow'. + password := ''. + packageNames := Set new.! - username _ 'joeblow'. - password _ ''. - packageNames _ Set new.! Item was changed: ----- Method: UAccountEditor>>password: (in category 'accessing') ----- password: aString + password := aString. - password _ aString. self changed: #password! Item was changed: ----- Method: UInterfaceUtilities classSide>>makeFieldGet:set:for: (in category 'as yet unclassified') ----- makeFieldGet: getSelector set: setSelector for: model | field fieldHeight | + fieldHeight := TextStyle default defaultFont pointSize + 8. - fieldHeight _ TextStyle default defaultFont pointSize + 8. field := PluggableTextMorph on: model text: getSelector accept: setSelector. field height: fieldHeight. field hResizing: #spaceFill. field hideScrollBarsIndefinitely. field setProperty: #alwaysAccept toValue: true. model noteField: field. ^field! Item was changed: ----- Method: UUniverseEditor>>morphicView (in category 'user interface') ----- morphicView | win universeDescription buttonList usernameRow passwordRow button usernamePasswordArea packageList | + win := SystemWindow labelled: 'Universe Editor'. - win _ SystemWindow labelled: 'Universe Editor'. win model: self. universeDescription := PluggableTextMorph on: self text: #universeDescription accept: nil. universeDescription hideScrollBarsIndefinitely. win addMorph: universeDescription frame: (0@0 extent: 1@0.1). + buttonList := AlignmentMorph newColumn. - buttonList _ AlignmentMorph newColumn. buttonList cellInset: 0@3. win addMorph: buttonList frame: (0@0.5 extent: 0.5@0.5). + usernamePasswordArea := AlignmentMorph newColumn. - usernamePasswordArea _ AlignmentMorph newColumn. win addMorph: usernamePasswordArea frame: (0@0.1 extent: 0.5@0.4). + usernameRow := UInterfaceUtilities makeFieldRowNamed: 'username' getSelector: #username setSelector: #username: for: self. - usernameRow _ UInterfaceUtilities makeFieldRowNamed: 'username' getSelector: #username setSelector: #username: for: self. usernamePasswordArea addMorphBack: usernameRow. + passwordRow := UInterfaceUtilities makeFieldRowNamed: 'password:' getSelector: #password setSelector: #password: isPassword: true for: self. - passwordRow _ UInterfaceUtilities makeFieldRowNamed: 'password:' getSelector: #password setSelector: #password: isPassword: true for: self. usernamePasswordArea addMorphBack: passwordRow. + button := self makeButtonWithAction: #createAccount andLabel: 'createAccount'. - button _ self makeButtonWithAction: #createAccount andLabel: 'createAccount'. buttonList addMorphBack: button. + button := self makeButtonWithAction: #editAccount andLabel: 'edit account'. - button _ self makeButtonWithAction: #editAccount andLabel: 'edit account'. buttonList addMorphBack: button. + button := self makeButtonWithAction: #newPackage andLabel: 'new package'. - button _ self makeButtonWithAction: #newPackage andLabel: 'new package'. buttonList addMorphBack: button. + button := self makeButtonWithAction: #newPackageVersion andGetState: #anyPackageSelected andLabel: 'new package version'. - button _ self makeButtonWithAction: #newPackageVersion andGetState: #anyPackageSelected andLabel: 'new package version'. buttonList addMorphBack: button. + button := self makeButtonWithAction: #removeVersion andGetState: #anyPackageSelected andLabel: 'remove package version'. - button _ self makeButtonWithAction: #removeVersion andGetState: #anyPackageSelected andLabel: 'remove package version'. buttonList addMorphBack: button. + button := self makeButtonWithAction: #requestPackageList andLabel: 'update package list'. - button _ self makeButtonWithAction: #requestPackageList andLabel: 'update package list'. buttonList addMorphBack: button. + packageList := PluggableListMorph on: self list: #packageDescriptions selected: #selectedPackageIndex changeSelected: #selectedPackageIndex: menu: nil. - packageList _ PluggableListMorph on: self list: #packageDescriptions selected: #selectedPackageIndex changeSelected: #selectedPackageIndex: menu: nil. win addMorph: packageList frame: ((0.5@0.1) extent: (0.5@0.9)). ^win! Item was changed: ----- Method: UUniverseServer>>processRawMessage:fromConnection: (in category 'messages') ----- processRawMessage: aStringArray fromConnection: connection | message | + message := UMessage fromStringArray: aStringArray. - message _ UMessage fromStringArray: aStringArray. message applyToServer: self forConnection: connection. self logMessage: message. ! Item was changed: ----- Method: UUniverseEditor>>createAccount (in category 'account') ----- createAccount self acceptFields. + email := FillInTheBlankMorph request: 'your email address?'. - email _ FillInTheBlankMorph request: 'your email address?'. email = '' ifTrue: [ ^self ]. self sendMessage: (UMAddAccount username: username password: password email: email). ! Item was changed: ----- Method: UUniverseBrowser>>universe: (in category 'initialize-release') ----- universe: aUniverse + universe := aUniverse. - universe _ aUniverse. universe addDependent: self.! Item was changed: ----- Method: UUniverse classSide>>systemUniverse (in category 'system') ----- systemUniverse "return the universe this image uses" + ^SystemUniverse ifNil: [ SystemUniverse := self developmentUniverse ]! - ^SystemUniverse ifNil: [ SystemUniverse _ self developmentUniverse ]! Item was changed: ----- Method: UPackage>>version: (in category 'initialize-release') ----- version: aVersion + version := aVersion. - version _ aVersion. ! Item was changed: ----- Method: UPackageTestCase>>testXML (in category 'comparing') ----- testXML | xmlString stream readp1 readp2 readPackages readp3 | p2 version: (UVersion readFromString: '1.2'). p1 description: 'blah blah <>&"'''. + xmlString := String streamContents: [ :str | - xmlString _ String streamContents: [ :str | str nextPutAll: p1 xmlForExport; nextPutAll: p2 xmlForExport. str nextPutAll: '<package> <name>IRCe</name> <version>10.7.6</version> <description>This is a significant rewrite of the built-in Squeak IRC client GUI. A new user interface includes having one console window per connection and then having all console messages, channel messages and private messages contained inside the main console window using tabbed swapped panes. Numerous other changes are also included but are not described here. The change-set contains documentation for all features added or modified. Instructions at http://squeak.preeminent.org/irc-help/irc-help.html</description> <url>http://kilana.unibe.ch:8888/IRC/Network-IRC-fc.10.7.6.mcz</url> <maintainer></maintainer> <provides></provides><depends></depends><conflicts></conflicts></package>' ]. + stream := ReadStream on: xmlString. + readPackages := UPackage decodePackagesFromXMLStream: stream. - stream _ ReadStream on: xmlString. - readPackages _ UPackage decodePackagesFromXMLStream: stream. self should: [ readPackages size = 3 ]. + readp1 := readPackages first. + readp2 := readPackages second. + readp3 := readPackages third. - readp1 _ readPackages first. - readp2 _ readPackages second. - readp3 _ readPackages third. self should: [ readp1 = p1 ]. self should: [ readp2 = p2 ]. self should: [ readp3 name = 'IRCe']. self should: [ readp3 version = (UVersion readFromString: '10.7.6')]. ! Item was changed: ----- Method: UPWild>>findAccount:withPassword: (in category 'account assignment') ----- findAccount: username withPassword: password | account | + account := accounts detect: [ :acc | acc username = username] ifNone: [ - account _ accounts detect: [ :acc | acc username = username] ifNone: [ "no such account" ^nil ]. account password = password ifFalse:[ "wrong password" ^nil ]. ^account! Item was changed: ----- Method: UPackage classSide>>savePackageList:onFileNamed: (in category 'saving') ----- savePackageList: packageList onFileNamed: filename | tmpName file | + tmpName := filename, 'tmp'. - tmpName _ filename, 'tmp'. FileDirectory default deleteFileNamed: tmpName ifAbsent: []. + file := FileStream fileNamed: tmpName. - file _ FileStream fileNamed: tmpName. packageList do: [ :package | file nextPutAll: package xmlForExport ]. file close. FileDirectory default rename: tmpName toBe: filename. ! Item was changed: ----- Method: UMPackageList>>packages: (in category 'initialize-release') ----- packages: aCollection + packages := aCollection! - packages _ aCollection! Item was changed: ----- Method: UUniverseEditor>>initialize: (in category 'initialization') ----- initialize: universe0 + universe := universe0. - universe _ universe0. universe addDependent: self. + client := UUniverseClient forUniverse: universe. + username := Utilities authorInitialsPerSe. + password := ''. - client _ UUniverseClient forUniverse: universe. - username _ Utilities authorInitialsPerSe. - password _ ''. + packageEditors := Set new. - packageEditors _ Set new. + selectedPackageIndex := 0. - selectedPackageIndex _ 0. ! Item was changed: ----- Method: UPackage classSide>>decodePackagesFromXMLStream: (in category 'decoding') ----- decodePackagesFromXMLStream: stream | doc | + doc := XMLDOMParser parseDocumentFrom: stream. - doc _ XMLDOMParser parseDocumentFrom: stream. ^doc elements collect: [ :element | self decodeFromXMLElement: element ]. ! Item was changed: ----- Method: UConfiguration>>installPackage: (in category 'installing') ----- installPackage: aPackage | matchingPackages | + matchingPackages := installedPackages select: [ :p | p name = aPackage name ]. - matchingPackages _ installedPackages select: [ :p | p name = aPackage name ]. installedPackages removeAll: matchingPackages. aPackage install. installedPackages add: aPackage. ! Item was changed: ----- Method: UUniverseEditor>>accountUpdatedWithUsername:password:email: (in category 'account') ----- accountUpdatedWithUsername: newUsername password: newPassword email: newEmail self acceptFields. + username := newUsername. + password := newPassword. + email := newEmail. - username _ newUsername. - password _ newPassword. - email _ newEmail. self changed: #username. self changed: #password. self changed: #email. self closeAccountEditor! Item was changed: ----- Method: UUniverseMultiServer>>stopListening (in category 'networking') ----- stopListening connectionQueue ifNotNil: [ connectionQueue destroy. + connectionQueue := nil ]. - connectionQueue _ nil ]. ! Item was changed: ----- Method: UMEditAccount>>username:password:newPassword:newEmail: (in category 'initialize-release') ----- username: username0 password: password0 newPassword: newPassword0 newEmail: newEmail0 + username := username0. + password := password0. + newPassword := newPassword0. + newEmail := newEmail0. - username _ username0. - password _ password0. - newPassword _ newPassword0. - newEmail _ newEmail0. ! Item was changed: ----- Method: UPackageEditor>>makeFieldGet:set: (in category 'user interface') ----- makeFieldGet: getSelector set: setSelector | field fieldHeight | + fieldHeight := TextStyle default defaultFont pointSize + 8. - fieldHeight _ TextStyle default defaultFont pointSize + 8. field := PluggableTextMorph on: self text: getSelector accept: setSelector. field extent: 200@fieldHeight. field hideScrollBarsIndefinitely. field setProperty: #alwaysAccept toValue: true. + fields ifNil: [ fields := OrderedCollection new]. - fields ifNil: [ fields _ OrderedCollection new]. fields add: field. ^field! Item was changed: ----- Method: UUniverseServer>>connection:requestedForUsername:andPassword:toRemovePackageNamed:withVersion: (in category 'editing') ----- connection: connection requestedForUsername: username andPassword: password toRemovePackageNamed: packageName withVersion: version | packagesToRemove response | + response := policy packageNamed: packageName withVersion: version mayBeRemovedBy: username withPassword: password. - response _ policy packageNamed: packageName withVersion: version mayBeRemovedBy: username withPassword: password. response allowed ifFalse: [ ^self sendError: 'removing package ', packageName, ' failed (', response reason, ')' onConnection: connection]. packagesToRemove := universe packages select: [ :p | p name = packageName and: [ p version = version ] ]. packagesToRemove do: [ :p | universe removePackage: p ]. self sendMessage: (UMPackageRemoved packageName: packageName version: version) onConnection: connection.! Item was changed: ----- Method: UUniverseMultiServer>>startListening (in category 'networking') ----- startListening self stopListening. + connectionQueue := ConnectionQueue portNumber: port queueLength: 5. - connectionQueue _ ConnectionQueue portNumber: port queueLength: 5. ! Item was changed: ----- Method: UUniverseServer>>connection:requestedForUsername:andPassword:toAddPackage: (in category 'editing') ----- connection: connection requestedForUsername: username andPassword: password toAddPackage: package | response | + response := policy package: package mayBeAddedBy: username withPassword: password. - response _ policy package: package mayBeAddedBy: username withPassword: password. response allowed ifFalse: [ ^self sendError: 'adding package ', package name, ' failed (', response reason, ')' onConnection: connection]. universe addPackage: package. self sendMessage: (UMPackageAdded package: package) onConnection: connection.! Item was changed: ----- Method: UServerStepperMorph>>server: (in category 'initialization') ----- server: aServer + server := aServer! - server _ aServer! Item was changed: ----- Method: UPackage>>cachedCopyFilename (in category 'installing') ----- cachedCopyFilename "Download the package to a local cache, if it is not already in the cache. Return the filename of the file in the cache. If the package has no URL, download nothing and return nil." | filename doc file downloadDir | self url ifNil: [ ^nil ]. + downloadDir := FileDirectory default directoryNamed: 'universetmp'. - downloadDir _ FileDirectory default directoryNamed: 'universetmp'. downloadDir assureExistence. + filename := self url path last. - filename _ self url path last. (downloadDir isAFileNamed: filename) ifFalse: [ "download the file" + doc := url retrieveContents. - doc _ url retrieveContents. ((doc contentType asString = 'text/plain') and: [ doc content beginsWith: 'error']) ifTrue: [ "HACK to see if the download failed; the real solution is to make retrieveContents report errors" ^self error: 'download failed' ]. + file := downloadDir newFileNamed: filename. - file _ downloadDir newFileNamed: filename. file binary. file nextPutAll: doc content. file close. ]. ^ (downloadDir fullNameFor: filename).! Item was changed: ----- Method: UGlobalInstallerTest>>setUp (in category 'Running') ----- setUp | package | + universe := UStandardUniverse new. - universe _ UStandardUniverse new. + package := UPackage new. - package _ UPackage new. package name: 'A'. package addDependency: 'B'. universe addPackage: package. + package := UPackage new. - package _ UPackage new. package name: 'B'. package addDependency: 'C'. universe addPackage: package. + package := UPackage new. - package _ UPackage new. package name: 'C'. package addDependency: 'D'. package addDependency: 'E'. universe addPackage: package. + package := UPackage new. - package _ UPackage new. package name: 'D'. universe addPackage: package. + package := UPackage new. - package _ UPackage new. package name: 'E'. universe addPackage: package. + package := UPackage new. - package _ UPackage new. package name: 'Broken'. package addDependency: 'NonExistent'. universe addPackage: package. ! Item was changed: ----- Method: UUniverseServer>>packageListFilename: (in category 'initialize-release') ----- packageListFilename: filename + packageListFilename := filename! - packageListFilename _ filename! Item was changed: ----- Method: UAccount>>email: (in category 'accessing') ----- email: aString + email := aString! - email _ aString! Item was changed: ----- Method: UVersion classSide>>readFrom: (in category 'instance creation') ----- readFrom: stream | components | + components := OrderedCollection new. - components _ OrderedCollection new. [ stream atEnd ] whileFalse: [ stream peek isDigit ifTrue: [ components add: (Integer readFrom: stream) ] ifFalse: [ components add: (String streamContents: [ :compStr | [ stream atEnd not and: [ stream peek isDigit not ] ] whileTrue: [ compStr nextPut: stream next ] ]) ] ]. ^self fromComponents: components! Item was changed: ----- Method: UUniverseEditor>>closeAccountEditor (in category 'user interface') ----- closeAccountEditor accountEditor ifNil: [ ^self ]. accountEditor window delete. + accountEditor := nil.! - accountEditor _ nil.! Item was changed: ----- Method: UPStable>>masterPassword: (in category 'initialize-release') ----- masterPassword: password + masterPassword := password! - masterPassword _ password! Item was changed: ----- Method: UPackage>>depends: (in category 'initialize-release') ----- depends: aCollection + depends := Set withAll: aCollection! - depends _ Set withAll: aCollection! Item was changed: ----- Method: UUniverseBrowser>>configuration: (in category 'initialize-release') ----- configuration: aConfiguration + configuration := aConfiguration! - configuration _ aConfiguration! Item was changed: ----- Method: UUniverse classSide>>switchSystemToUniverse: (in category 'system') ----- switchSystemToUniverse: aUniverse + SystemUniverse := aUniverse! - SystemUniverse _ aUniverse! Item was changed: ----- Method: UVersion>>components: (in category 'initialization') ----- components: aCollection + components := aCollection! - components _ aCollection! Item was changed: ----- Method: UAccountEditor>>password2: (in category 'accessing') ----- password2: aString + newPassword2 := aString asString. - newPassword2 _ aString asString. self changed: #password2. ^true! Item was changed: ----- Method: UIFileOut>>install:usingBaseName: (in category 'installing') ----- install: inStream usingBaseName: basename "find a changeset name that is not used" | num changesetName stream | + num := 0. + [ changesetName := basename. + num > 0 ifTrue:[ changesetName := changesetName, '-', num printString. ]. - num _ 0. - [ changesetName _ basename. - num > 0 ifTrue:[ changesetName _ changesetName, '-', num printString. ]. (ChangeSorter changeSetNamed: changesetName) notNil ] + whileTrue: [ num := num + 1 ]. - whileTrue: [ num _ num + 1 ]. "decompress if necessary" inStream peek asInteger = 16r1F + ifTrue: [ stream := ReadStream on: ((GZipReadStream on: inStream) upToEnd) asString ] + ifFalse: [ stream := inStream ]. - ifTrue: [ stream _ ReadStream on: ((GZipReadStream on: inStream) upToEnd) asString ] - ifFalse: [ stream _ inStream ]. ChangeSorter newChangesFromStream: stream named: changesetName! Item was changed: ----- Method: UUniverseServer classSide>>forSaveDirectory: (in category 'instance creation') ----- forSaveDirectory: aDirectory | universe | + universe := self forUniverse: UUniverse new. - universe _ self forUniverse: UUniverse new. universe saveDirectory: aDirectory. universe loadFromCheckpoint. ^universe! Item was changed: ----- Method: UMMalformed>>stringArray: (in category 'accessing') ----- stringArray: anObject + stringArray := anObject! - stringArray _ anObject! Item was changed: ----- Method: UUniverseMultiServer>>initialize (in category 'initialize-release') ----- initialize + servers := Set new. + port := UUniverseMultiServer defaultPort. + connections := Set new. - servers _ Set new. - port _ UUniverseMultiServer defaultPort. - connections _ Set new. ! Item was changed: ----- Method: StringSocket classSide>>decodeStringArray: (in category '*universes') ----- decodeStringArray: aString | idx numStrings | + idx := 1. + numStrings := aString getInteger32: idx. + idx := idx + 4. - idx _ 1. - numStrings _ aString getInteger32: idx. - idx _ idx + 4. numStrings < 0 ifTrue: [ ^self error: 'invalid string socket encoding' ]. numStrings > 10000000 ifTrue: [ self error: 'refusing to decode humongous string socket' ]. ^(1 to: numStrings) collect: [ :ignored | | size str | + size := aString getInteger32: idx. + idx := idx + 4. + str := aString copyFrom: idx to: idx+size-1. + idx := idx + size. - size _ aString getInteger32: idx. - idx _ idx + 4. - str _ aString copyFrom: idx to: idx+size-1. - idx _ idx + size. str ] ! Item was changed: ----- Method: UUniverseServer>>initializeForUniverse: (in category 'initialize-release') ----- initializeForUniverse: aUniverse + universe := aUniverse. + policy := UPolicy new. + connectionQueue := nil. + connections := Set new. - universe _ aUniverse. - policy _ UPolicy new. - connectionQueue _ nil. - connections _ Set new. ! Item was changed: ----- Method: UMPackageList classSide>>fromStringArray: (in category 'instance creation') ----- fromStringArray: array | str packages numPackages | + str := ReadStream on: array. - str _ ReadStream on: array. str next. "skip the 'packages' designation". + packages := OrderedCollection new. - packages _ OrderedCollection new. + numPackages := Integer readFromString: str next. - numPackages _ Integer readFromString: str next. numPackages timesRepeat: [ packages add: (UPackage decodeFromStringStream: str) ]. ^self packages: packages! Item was changed: ----- Method: UPackage classSide>>readPackageListFromFileNamed: (in category 'decoding') ----- readPackageListFromFileNamed: filename | file packages | + file := FileStream readOnlyFileNamed: filename. + packages := self decodePackagesFromXMLStream: file. - file _ FileStream readOnlyFileNamed: filename. - packages _ self decodePackagesFromXMLStream: file. file close. ^packages! Item was changed: ----- Method: UPackageInstaller>>installFileNamed: (in category 'installing') ----- installFileNamed: filename | stream baseName | + stream := (FileStream readOnlyFileNamed: filename). + baseName := (FileDirectory splitName: filename to: [:path :base|base]) copyUpTo: $. . - stream _ (FileStream readOnlyFileNamed: filename). - baseName _ (FileDirectory splitName: filename to: [:path :base|base]) copyUpTo: $. . self install: stream usingBaseName: baseName. stream close. ! Item was changed: ----- Method: UUniverseServer>>connection:requestedAccountWithUsername:password:email: (in category 'editing') ----- connection: connection requestedAccountWithUsername: username password: password email: email | response | + response := policy addUser: username withPassword: password andEmail: email. - response _ policy addUser: username withPassword: password andEmail: email. response allowed ifFalse: [ self sendError: 'adding account for ', username, ' failed (', response reason, ')' onConnection: connection].! Item was changed: ----- Method: UPackage classSide>>getXMLPackageList:from: (in category 'decoding') ----- getXMLPackageList: listname from: element | listElement | + listElement := element elementAt: listname. - listElement _ element elementAt: listname. listElement ifNil: [ ^#() ]. ^listElement elements collect: [ :nameXML | nameXML contents first string ] ! Item was changed: ----- Method: UOneShotConnection>>nextOrNil (in category 'string socket') ----- nextOrNil hasBeenRead ifTrue:[ ^nil ]. + hasBeenRead := true. - hasBeenRead _ true. ^inputMessage! Item was changed: ----- Method: UUniverseServer>>processConnection: (in category 'networking') ----- processConnection: aConnection | message | aConnection isConnected ifFalse: [ ^self destroyConnection: aConnection ]. aConnection processIO. + [ message := aConnection nextOrNil. - [ message _ aConnection nextOrNil. message notNil ] whileTrue: [ self processRawMessage: message fromConnection: aConnection ]. aConnection isConnected ifTrue: [ aConnection processIO. "start sending out the response" ] ifFalse: [ self destroyConnection: aConnection ]! Item was changed: ----- Method: UUniverseServer>>loadFromCheckpoint (in category 'persistence') ----- loadFromCheckpoint "reload from a checkpoint" | file savedObject | (saveDirectory isAFileNamed: 'checkpoint') + ifTrue: [ file := saveDirectory readOnlyFileNamed: 'checkpoint' ] + ifFalse: [ file := saveDirectory readOnlyFileNamed: 'checkpoint.die' ]. - ifTrue: [ file _ saveDirectory readOnlyFileNamed: 'checkpoint' ] - ifFalse: [ file _ saveDirectory readOnlyFileNamed: 'checkpoint.die' ]. savedObject := file fileInObjectAndCode. file close. universe := savedObject first. policy := savedObject second. ! Item was changed: ----- Method: UIMpeg>>install:usingBasename: (in category 'installing') ----- install: stream usingBasename: basename | movieDir movieFile | movieDir := FileDirectory default directoryNamed: 'movies'. movieDir assureExistence. movieDir removeFileNamed: basename. + movieFile := movieDir newFileNamed: basename, '.mpeg'. - movieFile _ movieDir newFileNamed: basename, '.mpeg'. stream binary. movieFile binary. movieFile nextPutAll: stream upToEnd. movieFile close. Smalltalk at: #MPEGMoviePlayerMorph ifPresent: [ :player | player playFile: (movieDir fullNameFor: basename, '.mpeg') ]! Item was changed: ----- Method: UPackageInstaller classSide>>initialize (in category 'initialization') ----- initialize + Installers ifNil: [ Installers := Set new ]. - Installers ifNil: [ Installers _ Set new ]. {UIFileOut. UIMonticello. UIMpeg. UIProject. UISar} do: [ :c | self registerInstaller: c new ]! Item was changed: ----- Method: UConfiguration classSide>>forSystem (in category 'system') ----- forSystem "return a configuration describing the currently running system" + ^SystemConfiguration ifNil: [ SystemConfiguration := self new ]. - ^SystemConfiguration ifNil: [ SystemConfiguration _ self new ]. ! Item was changed: ----- Method: UUniverseEditor>>removeVersion (in category 'package editing') ----- removeVersion | package | self anyPackageSelected ifFalse: [ ^self ]. self acceptFields. + package := self selectedPackage. - package _ self selectedPackage. (self confirm: ('Delete ', package printString, '?')) ifFalse: [ ^self ]. self sendMessage: (UMRemovePackage username: username password: password packageName: package name packageVersion: package version). ! Item was changed: ----- Method: UUniverseMultiServer>>processRawMessage:fromConnection: (in category 'messages') ----- processRawMessage: aStringArray fromConnection: connection | message | + message := UMessage fromStringArray: aStringArray. - message _ UMessage fromStringArray: aStringArray. message applyToMultiServer: self forConnection: connection. ! Item was changed: ----- Method: UPackage>>homepage: (in category 'initialize-release') ----- homepage: aURL + homepage := aURL! - homepage _ aURL! Item was changed: ----- Method: UStandardUniverse>>packagesURL: (in category 'initialize-release') ----- packagesURL: aURL + packagesURL := aURL! - packagesURL _ aURL! Item was changed: ----- Method: UPWild>>tryToGivePackageName:toUsername:withPassword: (in category 'account assignment') ----- tryToGivePackageName: packageName toUsername: username withPassword: password | account | (self class isReasonablePackageName: packageName) ifFalse: [ ^UPolicyResponse denied: 'invalid package name' ]. + account := self findAccount: username withPassword: password. - account _ self findAccount: username withPassword: password. account ifNil: [ ^UPolicyResponse denied: 'incorrect password or no such user' ]. account == superUser ifTrue: [ ^UPolicyResponse allowed ]. (account ownsPackageName: packageName) ifTrue: [ ^UPolicyResponse allowed ]. (accounts anySatisfy: [ :acc | acc ownsPackageName: packageName ]) ifTrue: [ ^UPolicyResponse denied: 'package is owned by another' ]. account addPackageName: packageName. ^UPolicyResponse allowed! Item was changed: ----- Method: UPWild>>initialize (in category 'initialize-release') ----- initialize + accounts := OrderedCollection new! - accounts _ OrderedCollection new! Item was changed: ----- Method: UUniverseEditor>>selectedPackageIndex: (in category 'package list') ----- selectedPackageIndex: anInteger + selectedPackageIndex := anInteger. - selectedPackageIndex _ anInteger. self changed: #selectedPackageIndex. ! Item was changed: ----- Method: UUniverse>>removePackageNamed:withVersion: (in category 'packages') ----- removePackageNamed: packageName withVersion: version | packagesToRemove | + packagesToRemove := self packages select: [ :p | p name = packageName and: [ p version = version ] ]. - packagesToRemove _ self packages select: [ :p | p name = packageName and: [ p version = version ] ]. packagesToRemove do: [ :p | self removePackage: p ]. ! Item was changed: ----- Method: UUniverseClient>>processIO (in category 'networking') ----- processIO | rawMsg | (stringSocket notNil and: [ stringSocket isConnected not ]) ifTrue: [ "connection has died" stringSocket destroy. + stringSocket := nil ]. - stringSocket _ nil ]. (outMessages isEmpty not and: [ socket isNil and: [ stringSocket isNil ] ]) ifTrue: [ "there are outgoing messages queued but there is no stringSocket" (DateAndTime now - lastConnectionStart) > (Duration minutes: 1) ifTrue: [ self startConnecting ] ]. socket ifNotNil: [ "a connection is in progress" socket isConnected ifTrue: [ "connection completed" + stringSocket := StringSocket on: socket. - stringSocket _ StringSocket on: socket. universe shortName ifNotNil: [ outMessages addFirst: (UMProtocolVersion version: 1). outMessages addFirst: (UMSelectServer shortName: universe shortName) ]. + socket := nil. ] - socket _ nil. ] ifFalse: [ socket isWaitingForConnection ifFalse: [ "the connection failed" inMessages add: (UMConnectionFailed description: 'connection failed'). ^self disconnect ] ] ]. stringSocket ifNil: [ ^self ]. [ outMessages isEmpty ] whileFalse: [ stringSocket nextPut: outMessages removeFirst asStringArray ]. stringSocket processIO. + [ rawMsg := stringSocket nextOrNil. - [ rawMsg _ stringSocket nextOrNil. rawMsg isNil not ] whileTrue: [ self newInMessage: (UMessage fromStringArray: rawMsg) ]! Item was changed: ----- Method: UPackage classSide>>getXMLPartNamed:from: (in category 'decoding') ----- getXMLPartNamed: partName from: xmlDoc | element | + element := xmlDoc elementAt: partName. - element _ xmlDoc elementAt: partName. (element isNil or: [ element contents isEmpty ]) ifTrue:[ ^ '' ]. ^element contents first string! Item was changed: ----- Method: UMProtocolVersion>>version: (in category 'initialize-release') ----- version: anInteger + version := anInteger! - version _ anInteger! Item was changed: ----- Method: UPackageEditor>>package:whenComplete: (in category 'initialize-release') ----- package: aPackage whenComplete: aBlock + package := aPackage. + whenComplete := aBlock. - package _ aPackage. - whenComplete _ aBlock. ! Item was changed: ----- Method: UPStable>>masterUser: (in category 'initialize-release') ----- masterUser: userName + masterUser := userName! - masterUser _ userName! Item was changed: ----- Method: UCompoundUniverse>>components: (in category 'accessing') ----- components: anObject + components := anObject. - components _ anObject. components do: [ :c | c addDependent: self ].! Item was changed: ----- Method: UMPackageAdded>>package: (in category 'initialize-release') ----- package: aPackage + package := aPackage! - package _ aPackage! Item was changed: ----- Method: UUniverseServer>>checkForNewConnections (in category 'networking') ----- checkForNewConnections connectionQueue ifNil: [ ^self ]. [ connections size < 10 ] whileTrue: [ | newSocket | + newSocket := connectionQueue getConnectionOrNil. - newSocket _ connectionQueue getConnectionOrNil. newSocket ifNil: [ ^self ]. connections add: (StringSocket on: newSocket) ]. ! Item was changed: ----- Method: UUniverseClient>>disconnect (in category 'public') ----- disconnect "explicitly close the connection" + socket ifNotNil: [ socket destroy. socket := nil ]. + stringSocket ifNotNil: [ stringSocket destroy. stringSocket := nil ].! - socket ifNotNil: [ socket destroy. socket _ nil ]. - stringSocket ifNotNil: [ stringSocket destroy. stringSocket _ nil ].! Item was changed: ----- Method: UUniverseClient>>initialize: (in category 'initialization') ----- initialize: aUniverse + universe := aUniverse. - universe _ aUniverse. + inMessages := OrderedCollection new. + outMessages := OrderedCollection new. - inMessages _ OrderedCollection new. - outMessages _ OrderedCollection new. + lastConnectionStart := DateAndTime epoch.! - lastConnectionStart _ DateAndTime epoch.! Item was changed: ----- Method: UOneShotConnection>>destroy (in category 'string socket') ----- destroy + hasBeenWritten := true! - hasBeenWritten _ true! Item was changed: ----- Method: UPackageTestCase>>setUp (in category 'setup') ----- setUp + p1 := UPackage new. - p1 _ UPackage new. p1 name: 'Scamper'. p1 category: (UPackageCategory withComponents: #('Networking')). p1 description: 'A web browser'. p1 url: 'http://www.squeak.org' asUrl. p1 homepage: p1 url. p1 version: (UVersion readFromString: '1.0'). p1 maintainer: 'John Doe'. + p2 := p1 deepCopy. - p2 _ p1 deepCopy. ! Item was changed: ----- Method: UAccountEditor>>username:password:email:whenDone: (in category 'initialize-release') ----- username: username0 password: password0 email: email0 whenDone: aBlock + username := username0. + password := password0. + newPassword := ''. + newPassword2 := ''. + newEmail := email0. + whenDone := aBlock. - username _ username0. - password _ password0. - newPassword _ ''. - newPassword2 _ ''. - newEmail _ email0. - whenDone _ aBlock. ! Item was changed: ----- Method: UUniverse>>description: (in category 'initialize-release') ----- description: aString + description := aString! - description _ aString! Item was changed: ----- Method: UPackage>>provides: (in category 'initialize-release') ----- provides: aCollection + provides := Set withAll: aCollection! - provides _ Set withAll: aCollection! Item was changed: ----- Method: UMSelectServer>>shortName: (in category 'initialize-release') ----- shortName: aString + shortName := aString! - shortName _ aString! Item was changed: ----- Method: UUniverseEditor>>closeEditorForPackage: (in category 'user interface') ----- closeEditorForPackage: package | matchingEditors | + matchingEditors := packageEditors select: [ :p | p package = package ]. - matchingEditors _ packageEditors select: [ :p | p package = package ]. matchingEditors do: [ :editor | editor window delete. packageEditors remove: editor ].! Item was changed: ----- Method: UPackage classSide>>decodeFromStringStream: (in category '*universes-messages') ----- decodeFromStringStream: str | package numDepends homePageText numProvides numConflicts urlString | + package := self new. - package _ self new. package name: str next. package version: (UVersion readFromString: str next). package description: str next. urlString := str next. (urlString withBlanksTrimmed beginsWith: '(') ifFalse: [ (urlString withBlanksTrimmed beginsWith: 'http://(') ifFalse: [ package url: (Url absoluteFromText: urlString) ] ]. + homePageText := str next. - homePageText _ str next. package homepage: (homePageText isEmpty ifTrue: [ nil ] ifFalse: [ homePageText asUrl ]). package maintainer: str next. + numProvides := Integer readFromString: str next. - numProvides _ Integer readFromString: str next. package provides: (str next: numProvides). + numDepends := Integer readFromString: str next. - numDepends _ Integer readFromString: str next. package depends: (str next: numDepends). + numConflicts := Integer readFromString: str next. - numConflicts _ Integer readFromString: str next. str next: numConflicts. "skip them" str atEnd ifFalse: [ package category: (UPackageCategory readFromString: str next)]. str atEnd ifFalse: [ | idstr | idstr := str next. idstr isEmpty ifFalse: [ package squeakMapID: (UUID fromString: idstr) ]. ]. ^package ! Item was changed: ----- Method: UMPackageAdded classSide>>fromStringArray: (in category 'instance creation') ----- fromStringArray: array | str | + str := ReadStream on: array. - str _ ReadStream on: array. str next. ^self package: (UPackage decodeFromStringStream: str)! Item was changed: ----- Method: UUniverseEditor>>username: (in category 'attributes') ----- username: aString + username := aString asString. - username _ aString asString. ^true! Item was changed: ----- Method: UUniverseBrowser classSide>>orderPackagesByDependency: (in category 'dependencies') ----- orderPackagesByDependency: packages "return a collection of the specified packages such that, when possible, any dependencies of a package are ordered before that package" "The present algorithm is simple but slow..." | remainingPackages orderedPackages packagesToAdd | + remainingPackages := Set new. + orderedPackages := OrderedCollection new. - remainingPackages _ Set new. - orderedPackages _ OrderedCollection new. remainingPackages addAll: packages. "each time through this loop, add to orderedPackages any packages whose dependencies are not in remainaingPackages" [ packagesToAdd := remainingPackages select: [ :p | p depends noneSatisfy: [ :depName | remainingPackages anySatisfy: [ :p2 | p2 name = depName ] ] ]. packagesToAdd isEmpty not ] whileTrue: [ orderedPackages addAll: packagesToAdd. remainingPackages := remainingPackages difference: packagesToAdd ]. orderedPackages addAll: remainingPackages. ^orderedPackages ! Item was changed: ----- Method: UUniverseEditor>>password: (in category 'attributes') ----- password: aString + password := aString asString. - password _ aString asString. ^true! Item was changed: ----- Method: UMAddPackage>>username:password:package: (in category 'initialize-release') ----- username: username0 password: password0 package: package0 + username := username0. + password := password0. + package := package0. - username _ username0. - password _ password0. - package _ package0. ! |
Free forum by Nabble | Edit this page |