The Trunk: Monticello-ar.345.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Monticello-ar.345.mcz

commits-2
Andreas Raab uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ar.345.mcz

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

Name: Monticello-ar.345
Author: ar
Time: 30 December 2009, 4:43:26 am
UUID: 41d6d7f1-8398-464f-afa8-9d67fa71271f
Ancestors: Monticello-ar.344

Display progress during common MC operations on HTTP repositories.

=============== Diff against Monticello-ar.344 ===============

Item was added:
+ ----- Method: MCHttpRepository>>displayProgress:during: (in category 'required') -----
+ displayProgress: label during: workBlock
+ | nextUpdateTime |
+ nextUpdateTime := 0.
+ ^UIManager default displayProgress: label at: Display center
+ from: 0.0 to: 1.0 during:[:bar|
+ [workBlock value] on: HTTPProgress do:[:ex|
+ (ex total == nil or:[ex amount == nil]) ifFalse:[
+ (nextUpdateTime < Time millisecondClockValue
+ or:[ex total = ex amount]) ifTrue:[
+ bar value: ex amount asFloat / ex total asFloat.
+ nextUpdateTime := Time millisecondClockValue + 100.
+ ].
+ ].
+ ex resume.
+ ]
+ ].
+ !

Item was changed:
  ----- Method: MCHttpRepository>>writeStreamForFileNamed:replace:do: (in category 'required') -----
  writeStreamForFileNamed: aString replace: ignoreBoolean do: aBlock
  | stream response |
  stream := RWBinaryOrTextStream on: String new.
  aBlock value: stream.
+ self displayProgress: 'Uploading package' during:[
+ response := HTTPSocket
- response := HTTPSocket
  httpPut: stream contents
  to: (self urlForFileNamed: aString)
  user: self user
  passwd: self password.
+ ].
-
  (#( 'HTTP/1.1 201 ' 'HTTP/1.1 200 ' 'HTTP/1.0 201 ' 'HTTP/1.0 200 ')
  anySatisfy: [:code | response beginsWith: code ])
  ifFalse: [self error: response].!

Item was changed:
  ----- Method: MCHttpRepository>>allFileNames (in category 'required') -----
  allFileNames
  | index |
+ self displayProgress: 'Updating repository' during:[
+ index := HTTPSocket httpGet: self locationWithTrailingSlash, '?C=M;O=D' args: nil user: self user passwd: self password.
+ ].
- index := HTTPSocket httpGet: self locationWithTrailingSlash, '?C=M;O=D' args: nil user: self user passwd: self password.
  index isString ifTrue: [self error: 'Could not access ', location].
  ^ self parseFileNamesFromStream: index !