[squeak-dev] The Trunk: EToys-nice.70.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 11 20:01:01 UTC 2010

Nicolas Cellier uploaded a new version of EToys to project The Trunk:

==================== Summary ====================

Name: EToys-nice.70
Author: nice
Time: 11 June 2010, 10:00:28.977 pm
UUID: 3a16c00c-2d38-5b49-9da7-25e95887c9d3
Ancestors: EToys-ar.69

Using String>>lines is a better way to get rid of any line ending problems

=============== Diff against EToys-ar.69 ===============

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 
  	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.
  			] ifFalse:[
  				"Go grab it directly"
  				url retrieveContents contents.
  	] on: Error do:[nil].
  	userString ifNil:[^nil].
+ 	userList := userString lines collect: [:each| each withBlanksTrimmed].
- 	"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.

More information about the Squeak-dev mailing list