Offray Luna
a4af9071a5
Now GrafoscopioDocumentation can be downloaded by several related projects without having to download the full Grafoscopio Package, only the Utilities. Maybe here we can put also the ones that deals with installation of simple software (Fossil, SQLite)... time will tell.
30 lines
759 B
Smalltalk
30 lines
759 B
Smalltalk
"
|
|
I contain simple functionality used by Grafoscopio, Datavis or other
|
|
related projects.
|
|
"
|
|
Class {
|
|
#name : #GrafoscopioUtils,
|
|
#superclass : #Object,
|
|
#category : #'Grafoscopio-Utils'
|
|
}
|
|
|
|
{ #category : #'graphical interface' }
|
|
GrafoscopioUtils class >> downloadingFrom: downloadUrl withMessage: aString into: location [
|
|
| fileName |
|
|
fileName := (downloadUrl splitOn: $/) last.
|
|
(location / fileName) exists ifTrue: [ (location / fileName) ensureDelete ].
|
|
[: bar |
|
|
bar title: aString.
|
|
[ZnClient new
|
|
enforceHttpSuccess: true;
|
|
url: downloadUrl;
|
|
downloadTo: location;
|
|
signalProgress: true
|
|
]
|
|
on: HTTPProgress
|
|
do: [ :progress |
|
|
progress isEmpty ifFalse: [ bar current: progress percentage ].
|
|
progress resume ].
|
|
] asJob run.
|
|
]
|