Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.57.mcz==================== Summary ====================
Name: EToys-nice.57
Author: nice
Time: 18 January 2010, 7:36:46.029 pm
UUID: 27f68dd7-d86f-c643-b42d-307ac2a5eab7
Ancestors: EToys-ul.56
Let a temporary assignment go outside a block
=============== Diff against EToys-ul.56 ===============
Item was changed:
----- Method: ServerDirectory class>>parseEToyUserListFrom: (in category '*eToys-school support') -----
parseEToyUserListFrom: urlString
| url userString userList |
urlString ifNil:[^nil].
url := urlString asUrl.
+ userString := ["Note: We need to prevent going through the plugin API
- ["Note: We need to prevent going through the plugin API
when retrieving a local (file) URL, since the plugin API
(correctly) rejects file:// downloads."
Cursor wait showWhile:[
(url hasRemoteContents) ifTrue:[
"Go through the browser (if present)"
+ (HTTPClient httpGet: url asString) contents.
- userString := (HTTPClient httpGet: url asString) contents.
] ifFalse:[
"Go grab it directly"
+ url retrieveContents contents.
- userString := url retrieveContents contents.
].
].
+ ] on: Error do:[nil].
- ] on: Error do:[:ex| userString := nil. ex return].
userString ifNil:[^nil].
"Get rid of any line ending problems"
userString := userString copyReplaceAll: String crlf with: String cr.
userString := userString copyReplaceAll: String lf with: String cr.
userList := (userString findTokens: Character cr) collect:[:each| each withBlanksTrimmed].
userList := userList reject:[:any| any isEmpty].
(userList first = '##user list##') ifFalse:[^nil].
userList := userList copyFrom: 2 to: userList size.
^userList!