<div dir="ltr"><div>This one is also to be removed please...<br></div>Sorry for the noise.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-20 22:37 GMT+02:00 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas Cellier uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-nice.735.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-nice.735.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-nice.735<br>
Author: nice<br>
Time: 20 July 2014, 10:36:28.157 pm<br>
UUID: add43698-a89f-480a-9bc6-9f8bac49558a<br>
Ancestors: Morphic-cmm.734<br>
<br>
Don't use RWBinaryOrTextStream where a simple WriteStream would perfectly do the job.<br>
<br>
=============== Diff against Morphic-cmm.734 ===============<br>
<br>
Item was changed:<br>
----- Method: MorphicProject class>>compileNewDefaultBackgroundFrom: (in category 'utilities') -----<br>
compileNewDefaultBackgroundFrom: aForm<br>
"Compile a new #defaultBackgroundForm method in this class-side which uses aForm as the background."<br>
+ | formStream base64 |<br>
+ formStream := ByteArray new writeStream.<br>
- | formStream base64Stream |<br>
- formStream := RWBinaryOrTextStream on: ByteArray new.<br>
PNGReadWriter<br>
putForm: aForm<br>
onStream: formStream.<br>
+ base64 := formStream base64Encoded.<br>
- base64Stream := Base64MimeConverter mimeEncode: formStream.<br>
self class<br>
compile:<br>
(String streamContents:<br>
[ : stream | stream<br>
nextPutAll: 'defaultBackgroundForm<br>
^ Form fromBinaryStream: ' ;<br>
nextPut: $' ;<br>
+ nextPutAll: base64 ;<br>
- nextPutAll: base64Stream contents ;<br>
nextPut: $' ;<br>
nextPutAll: ' base64Decoded asByteArray readStream' ])<br>
classified: 'class initialization'!<br>
<br>
Item was changed:<br>
----- Method: TextMorph>>getAllButFirstCharacter (in category 'scripting access') -----<br>
getAllButFirstCharacter<br>
"Obtain all but the first character from the receiver; if that would be empty, return a black dot"<br>
<br>
| aString |<br>
+ ^ (aString := text string) size > 1 ifTrue: [aString copyFrom: 2 to: aString size] ifFalse: ['·']!<br>
- ^ (aString := text string) size > 1 ifTrue: [aString copyFrom: 2 to: aString size] ifFalse: ['·']!<br>
<br>
Item was changed:<br>
----- Method: TextMorph>>getFirstCharacter (in category 'accessing') -----<br>
getFirstCharacter<br>
"obtain the first character from the receiver if it is empty, return a<br>
black dot"<br>
| aString |<br>
^ (aString := text string) isEmpty<br>
+ ifTrue: ['·']<br>
- ifTrue: ['·']<br>
ifFalse: [aString first asString] !<br>
<br>
Item was changed:<br>
----- Method: TextMorph>>getLastCharacter (in category 'accessing') -----<br>
getLastCharacter<br>
"obtain the last character from the receiver if it is empty, return a black dot"<br>
<br>
| aString |<br>
+ ^ (aString := text string) size > 0 ifTrue: [aString last asString] ifFalse: ['·']!<br>
- ^ (aString := text string) size > 0 ifTrue: [aString last asString] ifFalse: ['·']!<br>
<br>
Item was changed:<br>
----- Method: TextMorph>>setAllButFirstCharacter: (in category 'scripting access') -----<br>
setAllButFirstCharacter: source<br>
"Set all but the first char of the receiver to the source"<br>
| aChar chars |<br>
aChar := source asCharacter.<br>
(chars := self getCharacters) isEmpty<br>
+ ifTrue: [self newContents: '·' , source asString]<br>
- ifTrue: [self newContents: '·' , source asString]<br>
ifFalse: [chars first = aChar<br>
ifFalse: [""<br>
self<br>
newContents: (String<br>
streamContents: [:aStream |<br>
aStream nextPut: chars first.<br>
aStream nextPutAll: source])]] !<br>
<br>
Item was changed:<br>
----- Method: TheWorldMenu class>>loadSqueakMap (in category 'open-menu registry') -----<br>
loadSqueakMap<br>
+ "Load the externally-maintained SqueakMap package if it is not already loaded. Based on code by Göran Hultgren"<br>
- "Load the externally-maintained SqueakMap package if it is not already loaded. Based on code by Göran Hultgren"<br>
<br>
| server |<br>
Socket initializeNetwork.<br>
server := #('<a href="http://map1.squeakfoundation.org" target="_blank">map1.squeakfoundation.org</a>' '<a href="http://map2.squeakfoundation.org" target="_blank">map2.squeakfoundation.org</a>' '<a href="http://map.squeak.org" target="_blank">map.squeak.org</a>' '<a href="http://map.bluefish.se" target="_blank">map.bluefish.se</a>' '<a href="http://marvin.bluefish.se:8000" target="_blank">marvin.bluefish.se:8000</a>')<br>
detect: [:srv | | addr answer |<br>
addr := NetNameResolver addressForName: (srv upTo: $:) timeout: 5.<br>
addr notNil and: [<br>
answer := HTTPSocket httpGet: ('http://', srv, '/sm/ping').<br>
answer isString not and: [answer contents = 'pong']]]<br>
ifNone: [^ self inform: 'Sorry, no SqueakMap master server responding.'].<br>
server ifNotNil: ["Ok, found an SqueakMap server"<br>
ChangeSet newChangesFromStream:<br>
((('http://', server, '/sm/packagebyname/squeakmap/downloadurl')<br>
asUrl retrieveContents content) asUrl retrieveContents content unzipped<br>
readStream)<br>
named: 'SqueakMap']!<br>
<br>
<br>
</blockquote></div><br></div>