David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.1118.mcz
==================== Summary ====================
Name: System-dtl.1118
Author: dtl
Time: 14 November 2019, 11:44:09.783497 am
UUID: e1e88bc2-8860-4665-9ac4-af0e01dc258c
Ancestors: System-mt.1117
When reporting VM parameters, enable formatting in the case of a parameter value that is represented as a Float rather than an Integer. This may happen if a VM parameter is defined in units of milliseconds but internally measured to microsecond precision by the VM, in which case the value may be returned as a Float in order to retain full precision. SmalltalkImage>>formatVMParameter: handles the formatting for integer and non-integer values.
Includes recommendations from Marcel and Chris, original System-dtl.1118 submission is moved to treated inbox.
=============== Diff against System-mt.1117 ===============
Item was added:
+ ----- Method: SmalltalkImage>>formatVMParameter: (in category 'vm statistics') -----
+ formatVMParameter: aNumber
+ "Format a VM parameter that may have been reported either as a Float or
+ an Integer. If a VM parameter is defined in units of milliseconds but internally
+ measured to microsecond precision by the VM, the VM may choose to return
+ the value as a Float in order to retain full precision. Otther representations
+ such as Fraction may seem more natural but are difficult to instantiate in
+ the VM, hence the presumption of Float for representation of higher precision
+ millisecond values."
+
+ ^ aNumber isFloat
+ ifTrue: [ aNumber < 1000
+ ifTrue: [ aNumber printShowingMaxDecimalPlaces: 5 ]
+ ifFalse: [ aNumber rounded asStringWithCommas ] ]
+ ifFalse: [ aNumber asInteger asStringWithCommas ].!
Item was changed:
----- Method: SmalltalkImage>>vmStatisticsReportOn: (in category 'vm statistics') -----
(excessive size, no diff calculated)
Patrick Rein uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-pre.424.mcz
==================== Summary ====================
Name: Graphics-pre.424
Author: pre
Time: 14 November 2019, 4:32:50.472053 pm
UUID: bbaa1a3d-78d0-0c42-ba47-0c1949e20cca
Ancestors: Graphics-pre.423
Refactors the embedded object callback to allow for handling cases in which several TextAnchors are attached to the same character. Also allows TextAnchors to change the style of the text by letting TextAnchors work on the scanner (as other TextAttributes are allowed to do).
=============== Diff against Graphics-pre.423 ===============
Item was changed:
----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
embeddedObject
pendingKernX := 0.
((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
+ ifNotEmpty: [:attributes | self placeEmbeddedObjectsFrom: attributes].
+ self setFont.
- ifNotEmpty: [:attributes | attributes do: [:attr |
- "Try to placeEmbeddedObject: - if it answers false, then there's no place left"
- (self placeEmbeddedObjectFrom: attr) ifFalse: [^ self crossedX]]].
"Note: if ever several objects are embedded on same character, only indent lastIndex once"
lastIndex := lastIndex + 1.
^false!
Item was changed:
+ ----- Method: CharacterScanner>>placeEmbeddedObjectFrom: (in category 'private-text-anchor') -----
- ----- Method: CharacterScanner>>placeEmbeddedObjectFrom: (in category 'private') -----
placeEmbeddedObjectFrom: aTextAttribute
"Place the anchoredMorph or return false if it cannot be placed"
^ true!
Item was added:
+ ----- Method: CharacterScanner>>placeEmbeddedObjectsFrom: (in category 'private-text-anchor') -----
+ placeEmbeddedObjectsFrom: textAttributes
+ textAttributes do: [:attr |
+ "Try to placeEmbeddedObject: - if it answers false, then there's no place left"
+ (self placeEmbeddedObjectFrom: attr) ifFalse: [^ self crossedX]]!
Patrick Rein uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-pre.423.mcz
==================== Summary ====================
Name: Graphics-pre.423
Author: pre
Time: 14 November 2019, 4:20:44.164053 pm
UUID: a9abea50-6c2d-1645-83da-5204166dda73
Ancestors: Graphics-mt.422
Fixes a bug causing lines with several morphs to become to high.
=============== Diff against Graphics-mt.422 ===============
Item was changed:
----- Method: CompositionScanner>>lineHeightForMorphOfHeight:aligned:to:paddedWith:andOptionalMorphBaseline: (in category 'private') -----
lineHeightForMorphOfHeight: aMorphHeight aligned: morphPosition to: linePosition paddedWith: verticalPadding andOptionalMorphBaseline: morphBaseline
"The idea here is to first compute the total height and then subtract the overlapping area."
| adjustedLineHeight morphHeight total |
morphHeight := aMorphHeight + verticalPadding.
total := font height + morphHeight.
adjustedLineHeight := 0.
morphPosition = #top ifTrue: [
linePosition = #top ifTrue: [adjustedLineHeight := total - font height].
linePosition = #center ifTrue: [adjustedLineHeight := total - (font descent + (font ascent / 2))].
linePosition = #baseline ifTrue: [adjustedLineHeight := total - font descent].
linePosition = #bottom ifTrue: [adjustedLineHeight := total].].
morphPosition = #center ifTrue: [ | upperMorphHalf lowerMorphHalf |
"The overlapping area of a morph aligned at the center position can be determined by splitting
the morph into a top half which is aligned at the bottom and a lower half aligned at the top."
upperMorphHalf := self
+ lineHeightForMorphOfHeight: aMorphHeight // 2
- lineHeightForMorphOfHeight: aMorphHeight / 2
aligned: #bottom to: linePosition.
lowerMorphHalf := self
+ lineHeightForMorphOfHeight: aMorphHeight // 2
- lineHeightForMorphOfHeight: aMorphHeight / 2
aligned: #top to: linePosition.
adjustedLineHeight := upperMorphHalf + lowerMorphHalf - font height].
morphPosition = #baseline ifTrue: [ | upperMorphHalf lowerMorphHalf |
"We use the same trick as we used with the center position but with different proportions of the morph."
upperMorphHalf := self
lineHeightForMorphOfHeight: morphBaseline
aligned: #bottom to: linePosition.
lowerMorphHalf := self
lineHeightForMorphOfHeight: aMorphHeight - morphBaseline
aligned: #top to: linePosition.
adjustedLineHeight := upperMorphHalf + lowerMorphHalf - font height].
morphPosition = #bottom ifTrue: [
linePosition = #top ifTrue: [adjustedLineHeight := total].
linePosition = #center ifTrue: [adjustedLineHeight := total - (font ascent / 2)].
linePosition = #baseline ifTrue: [adjustedLineHeight := total - font ascent].
linePosition = #bottom ifTrue: [adjustedLineHeight := total - font height].].
+ ^ adjustedLineHeight!
- ^ lineHeight max: adjustedLineHeight !
Item was changed:
----- Method: CompositionScanner>>placeEmbeddedObjectFrom: (in category 'private') -----
placeEmbeddedObjectFrom: aTextAttribute
| width anchoredMorphOrForm textAnchorProperties |
anchoredMorphOrForm := aTextAttribute anchoredMorph.
textAnchorProperties := self textAnchorPropertiesFor: anchoredMorphOrForm.
textAnchorProperties anchorLayout == #document ifTrue: [^ true].
"If it is not anchored at the document, we assume that it is inline."
width := anchoredMorphOrForm width + textAnchorProperties horizontalPadding.
(textAnchorProperties consumesHorizontalSpace and: [destX + width > rightMargin and: [(leftMargin + width) <= rightMargin or: [lastIndex > line first]]])
ifTrue: ["Won't fit, but would on next line"
^ false].
"The width had to be set beforehand to determine line wrapping.
We can now re-use and reset it as it might not be necessary anymore. --pre"
width := textAnchorProperties consumesHorizontalSpace
ifTrue: [anchoredMorphOrForm width + textAnchorProperties horizontalPadding]
ifFalse: [0].
destX := destX + width + kern.
baseline := baseline max:
(self alignmentMorphOffsetFor: textAnchorProperties of: anchoredMorphOrForm)
+ (self baselineAdjustmentFor: textAnchorProperties).
+ lineHeight := lineHeight max: (self
- lineHeight := self
lineHeightForMorphOfHeight: anchoredMorphOrForm height
aligned: textAnchorProperties verticalAlignmentMorph
to: textAnchorProperties verticalAlignmentLine
paddedWith: textAnchorProperties verticalPadding
andOptionalMorphBaseline: (textAnchorProperties morphBaselineGetter
+ ifNotNil: [:getter | anchoredMorphOrForm perform: getter] ifNil: [0])).
- ifNotNil: [:getter | anchoredMorphOrForm perform: getter] ifNil: [0]).
^ true!
Item was changed:
----- Method: DisplayScanner>>placeEmbeddedObjectFrom: (in category 'private') -----
placeEmbeddedObjectFrom: aTextAttribute
| width anchoredMorphOrForm textAnchorProperties |
anchoredMorphOrForm := aTextAttribute anchoredMorph.
textAnchorProperties := self textAnchorPropertiesFor: anchoredMorphOrForm.
(self embeddedObject: anchoredMorphOrForm shouldBePlacedInDocumentGiven: textAnchorProperties)
ifTrue: [^ self placeEmbeddedObjectInDocument: anchoredMorphOrForm].
+ self placeEmbeddedObject: anchoredMorphOrForm inlineGiven: textAnchorProperties.
- .self placeEmbeddedObject: anchoredMorphOrForm inlineGiven: textAnchorProperties.
width := textAnchorProperties consumesHorizontalSpace
ifTrue: [anchoredMorphOrForm width + textAnchorProperties horizontalPadding]
ifFalse: [0].
destX := destX + width + kern.
^ true!
Marcel Taeumel uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-cbc.234.mcz
==================== Summary ====================
Name: Network-cbc.234
Author: cbc
Time: 7 June 2019, 12:56:17.741581 pm
UUID: a2081791-f54f-40fd-bd59-b8da1d52265d
Ancestors: Network-pre.233
Password was very specific for ServerDirectory.
Re-factor Password into a more generic password holder (usuable in other classes).
Create ServerPassword as a sub-class of Password with necessary specilizations moved down to it.
Make ServcieDirectory point to ServerPassword.
This allows us to use Password generally to store a password in memory (encoded) during a Squeak session, which is cleared out when saving. The intended use case is to not store passwords in code or in the file system - instead prompt the user at first use and cache it for the rest of the life of the session.
=============== Diff against Network-pre.233 ===============
Item was changed:
Object subclass: #Password
+ instanceVariableNames: 'cache'
- instanceVariableNames: 'cache sequence'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-Kernel'!
+ !Password commentStamp: 'cbc 6/7/2019 11:19' prior: 0!
+ "Hold a password in memory during a run of the app.
- !Password commentStamp: 'pre 12/11/2018 15:53' prior: 0!
- "Hold a password. There are three ways to get the password.
+ After each save (after each startup), when an applicaiton asks for a password, one of two things will happen:
+ 1> the user will be prompted for the password
+ 2> If the user was previously prompted, return that password
- If there is no password (sequence == nil), ask the user for it.
+ Passwords are stored encoded.
+ At shutDown, passwords are cleared (will not be written to disc).
- If the user supplied one during this session, return that. It is cleared at shutDown.
+ The intent for this class is to avoid storing passwords in code or on files on the system. Instead, prompt the user during the running of the application."!
- If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was changed:
----- Method: Password>>cache: (in category 'accessing') -----
cache: anObject
+ "if anObject is nil, then clear out cache - don't store values to disc"
+ anObject ifNil: [^cache := nil].
+ "Otherwise, 'encode' (trivially) the password while it resides in memory - no plain text"
+ cache := self decode: anObject!
- cache := anObject!
Item was removed:
- ----- Method: Password>>passwordFor: (in category 'accessing') -----
- passwordFor: serverDir
- "Returned the password from one of many sources. OK if send in a nil arg."
-
- | sp msg |
- cache ifNotNil: [^ cache].
- sequence ifNotNil: [
- (sp := self serverPasswords) ifNotNil: [
- sequence <= sp size ifTrue: [^ sp at: sequence]]].
- msg := serverDir isRemoteDirectory
- ifTrue: [serverDir moniker]
- ifFalse: ['this directory'].
- (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
- ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
- initialAnswer: 'yourName(a)company.com'].
-
- ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
- "Diff between empty string and abort?"!
Item was added:
+ ----- Method: Password>>passwordForMessage: (in category 'accessing') -----
+ passwordForMessage: msg
+ cache ifNotNil: [^self decode: cache]. "Our stored value is encoded"
+ ^self decode: (cache := self decode: (UIManager default requestPassword: 'Password for ', msg, ':')).!
Item was removed:
- ----- Method: Password>>sequence (in category 'accessing') -----
- sequence
- ^sequence!
Item was removed:
- ----- Method: Password>>sequence: (in category 'accessing') -----
- sequence: anNumber
- sequence := anNumber!
Item was removed:
- ----- Method: Password>>serverPasswords (in category 'accessing') -----
- serverPasswords
- "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
-
- | sfile |
- (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
- "If not there, Caller will ask user for password"
- "If you don't have this file, and you really do want to release an update,
- contact Ted Kaehler."
- ^ (self decode: (sfile contentsOfEntireFile)) lines
- !
Item was changed:
----- Method: ServerDirectory>>password (in category 'accessing') -----
password
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
^ passwordHolder passwordFor: self "may ask the user"!
Item was changed:
----- Method: ServerDirectory>>password: (in category 'accessing') -----
password: pp
+ passwordHolder := ServerPassword new.
- passwordHolder := Password new.
pp isString
ifTrue: [passwordHolder cache: pp. ^ self].
pp isInteger
ifTrue: [passwordHolder sequence: pp]
ifFalse: [passwordHolder := pp].!
Item was changed:
----- Method: ServerDirectory>>passwordSequence: (in category 'accessing') -----
passwordSequence: aNumber
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
passwordHolder sequence: aNumber!
Item was added:
+ Password subclass: #ServerPassword
+ instanceVariableNames: 'sequence'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Network-Kernel'!
+
+ !ServerPassword commentStamp: 'cbc 6/7/2019 11:15' prior: 0!
+ "Hold a password. There are three ways to get the password.
+
+ If there is no password (sequence == nil), ask the user for it.
+
+ If the user supplied one during this session, return that. It is cleared at shutDown.
+
+ If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was added:
+ ----- Method: ServerPassword>>cache: (in category 'accessing') -----
+ cache: anObject
+ cache := anObject!
Item was added:
+ ----- Method: ServerPassword>>passwordFor: (in category 'accessing') -----
+ passwordFor: serverDir
+ "Returned the password from one of many sources. OK if send in a nil arg."
+
+ | sp msg |
+ cache ifNotNil: [^ cache].
+ sequence ifNotNil: [
+ (sp := self serverPasswords) ifNotNil: [
+ sequence <= sp size ifTrue: [^ sp at: sequence]]].
+ msg := serverDir isRemoteDirectory
+ ifTrue: [serverDir moniker]
+ ifFalse: ['this directory'].
+ (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
+ ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
+ initialAnswer: 'yourName(a)company.com'].
+
+ ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
+ "Diff between empty string and abort?"!
Item was added:
+ ----- Method: ServerPassword>>sequence (in category 'accessing') -----
+ sequence
+ ^sequence!
Item was added:
+ ----- Method: ServerPassword>>sequence: (in category 'accessing') -----
+ sequence: anNumber
+ sequence := anNumber!
Item was added:
+ ----- Method: ServerPassword>>serverPasswords (in category 'accessing') -----
+ serverPasswords
+ "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
+
+ | sfile |
+ (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
+ "If not there, Caller will ask user for password"
+ "If you don't have this file, and you really do want to release an update,
+ contact Ted Kaehler."
+ ^ (self decode: (sfile contentsOfEntireFile)) lines
+ !
Marcel Taeumel uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ck.235.mcz
==================== Summary ====================
Name: Network-ck.235
Author: ck
Time: 5 November 2019, 2:28:19.977827 pm
UUID: 8ba9f4f6-31d1-4901-8d7a-93654d90a89f
Ancestors: Network-cbc.234
Move noAuthorizationMethod to the class side.
Without this change the #socks5 method is broken.
All the other default settings that #socks5 uses are on the class side too and its the only place that uses it.
=============== Diff against Network-pre.233 ===============
Item was changed:
Object subclass: #Password
+ instanceVariableNames: 'cache'
- instanceVariableNames: 'cache sequence'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-Kernel'!
+ !Password commentStamp: 'cbc 6/7/2019 11:19' prior: 0!
+ "Hold a password in memory during a run of the app.
- !Password commentStamp: 'pre 12/11/2018 15:53' prior: 0!
- "Hold a password. There are three ways to get the password.
+ After each save (after each startup), when an applicaiton asks for a password, one of two things will happen:
+ 1> the user will be prompted for the password
+ 2> If the user was previously prompted, return that password
- If there is no password (sequence == nil), ask the user for it.
+ Passwords are stored encoded.
+ At shutDown, passwords are cleared (will not be written to disc).
- If the user supplied one during this session, return that. It is cleared at shutDown.
+ The intent for this class is to avoid storing passwords in code or on files on the system. Instead, prompt the user during the running of the application."!
- If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was changed:
----- Method: Password>>cache: (in category 'accessing') -----
cache: anObject
+ "if anObject is nil, then clear out cache - don't store values to disc"
+ anObject ifNil: [^cache := nil].
+ "Otherwise, 'encode' (trivially) the password while it resides in memory - no plain text"
+ cache := self decode: anObject!
- cache := anObject!
Item was removed:
- ----- Method: Password>>passwordFor: (in category 'accessing') -----
- passwordFor: serverDir
- "Returned the password from one of many sources. OK if send in a nil arg."
-
- | sp msg |
- cache ifNotNil: [^ cache].
- sequence ifNotNil: [
- (sp := self serverPasswords) ifNotNil: [
- sequence <= sp size ifTrue: [^ sp at: sequence]]].
- msg := serverDir isRemoteDirectory
- ifTrue: [serverDir moniker]
- ifFalse: ['this directory'].
- (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
- ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
- initialAnswer: 'yourName(a)company.com'].
-
- ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
- "Diff between empty string and abort?"!
Item was added:
+ ----- Method: Password>>passwordForMessage: (in category 'accessing') -----
+ passwordForMessage: msg
+ cache ifNotNil: [^self decode: cache]. "Our stored value is encoded"
+ ^self decode: (cache := self decode: (UIManager default requestPassword: 'Password for ', msg, ':')).!
Item was removed:
- ----- Method: Password>>sequence (in category 'accessing') -----
- sequence
- ^sequence!
Item was removed:
- ----- Method: Password>>sequence: (in category 'accessing') -----
- sequence: anNumber
- sequence := anNumber!
Item was removed:
- ----- Method: Password>>serverPasswords (in category 'accessing') -----
- serverPasswords
- "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
-
- | sfile |
- (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
- "If not there, Caller will ask user for password"
- "If you don't have this file, and you really do want to release an update,
- contact Ted Kaehler."
- ^ (self decode: (sfile contentsOfEntireFile)) lines
- !
Item was changed:
----- Method: ServerDirectory>>password (in category 'accessing') -----
password
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
^ passwordHolder passwordFor: self "may ask the user"!
Item was changed:
----- Method: ServerDirectory>>password: (in category 'accessing') -----
password: pp
+ passwordHolder := ServerPassword new.
- passwordHolder := Password new.
pp isString
ifTrue: [passwordHolder cache: pp. ^ self].
pp isInteger
ifTrue: [passwordHolder sequence: pp]
ifFalse: [passwordHolder := pp].!
Item was changed:
----- Method: ServerDirectory>>passwordSequence: (in category 'accessing') -----
passwordSequence: aNumber
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
passwordHolder sequence: aNumber!
Item was added:
+ Password subclass: #ServerPassword
+ instanceVariableNames: 'sequence'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Network-Kernel'!
+
+ !ServerPassword commentStamp: 'cbc 6/7/2019 11:15' prior: 0!
+ "Hold a password. There are three ways to get the password.
+
+ If there is no password (sequence == nil), ask the user for it.
+
+ If the user supplied one during this session, return that. It is cleared at shutDown.
+
+ If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was added:
+ ----- Method: ServerPassword>>cache: (in category 'accessing') -----
+ cache: anObject
+ cache := anObject!
Item was added:
+ ----- Method: ServerPassword>>passwordFor: (in category 'accessing') -----
+ passwordFor: serverDir
+ "Returned the password from one of many sources. OK if send in a nil arg."
+
+ | sp msg |
+ cache ifNotNil: [^ cache].
+ sequence ifNotNil: [
+ (sp := self serverPasswords) ifNotNil: [
+ sequence <= sp size ifTrue: [^ sp at: sequence]]].
+ msg := serverDir isRemoteDirectory
+ ifTrue: [serverDir moniker]
+ ifFalse: ['this directory'].
+ (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
+ ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
+ initialAnswer: 'yourName(a)company.com'].
+
+ ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
+ "Diff between empty string and abort?"!
Item was added:
+ ----- Method: ServerPassword>>sequence (in category 'accessing') -----
+ sequence
+ ^sequence!
Item was added:
+ ----- Method: ServerPassword>>sequence: (in category 'accessing') -----
+ sequence: anNumber
+ sequence := anNumber!
Item was added:
+ ----- Method: ServerPassword>>serverPasswords (in category 'accessing') -----
+ serverPasswords
+ "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
+
+ | sfile |
+ (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
+ "If not there, Caller will ask user for password"
+ "If you don't have this file, and you really do want to release an update,
+ contact Ted Kaehler."
+ ^ (self decode: (sfile contentsOfEntireFile)) lines
+ !
Item was added:
+ ----- Method: SocksSocket class>>noAutorizationMethod (in category 'accessing') -----
+ noAutorizationMethod
+ ^0!
Item was removed:
- ----- Method: SocksSocket>>noAutorizationMethod (in category 'methods') -----
- noAutorizationMethod
- ^0!
Marcel Taeumel uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-mt.236.mcz
==================== Summary ====================
Name: Network-mt.236
Author: mt
Time: 13 November 2019, 1:57:55.190043 pm
UUID: 09f99a0e-f8d4-7d40-becf-e0669f5a20c7
Ancestors: Network-nice.234, Network-ck.235
Merges inbox contributions.
=============== Diff against Network-nice.234 ===============
Item was changed:
Object subclass: #Password
+ instanceVariableNames: 'cache'
- instanceVariableNames: 'cache sequence'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-Kernel'!
+ !Password commentStamp: 'cbc 6/7/2019 11:19' prior: 0!
+ "Hold a password in memory during a run of the app.
- !Password commentStamp: 'pre 12/11/2018 15:53' prior: 0!
- "Hold a password. There are three ways to get the password.
+ After each save (after each startup), when an applicaiton asks for a password, one of two things will happen:
+ 1> the user will be prompted for the password
+ 2> If the user was previously prompted, return that password
- If there is no password (sequence == nil), ask the user for it.
+ Passwords are stored encoded.
+ At shutDown, passwords are cleared (will not be written to disc).
- If the user supplied one during this session, return that. It is cleared at shutDown.
+ The intent for this class is to avoid storing passwords in code or on files on the system. Instead, prompt the user during the running of the application."!
- If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was changed:
----- Method: Password>>cache: (in category 'accessing') -----
cache: anObject
+ "if anObject is nil, then clear out cache - don't store values to disc"
+ anObject ifNil: [^cache := nil].
+ "Otherwise, 'encode' (trivially) the password while it resides in memory - no plain text"
+ cache := self decode: anObject!
- cache := anObject!
Item was removed:
- ----- Method: Password>>passwordFor: (in category 'accessing') -----
- passwordFor: serverDir
- "Returned the password from one of many sources. OK if send in a nil arg."
-
- | sp msg |
- cache ifNotNil: [^ cache].
- sequence ifNotNil: [
- (sp := self serverPasswords) ifNotNil: [
- sequence <= sp size ifTrue: [^ sp at: sequence]]].
- msg := serverDir isRemoteDirectory
- ifTrue: [serverDir moniker]
- ifFalse: ['this directory'].
- (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
- ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
- initialAnswer: 'yourName(a)company.com'].
-
- ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
- "Diff between empty string and abort?"!
Item was added:
+ ----- Method: Password>>passwordForMessage: (in category 'accessing') -----
+ passwordForMessage: msg
+ cache ifNotNil: [^self decode: cache]. "Our stored value is encoded"
+ ^self decode: (cache := self decode: (UIManager default requestPassword: 'Password for ', msg, ':')).!
Item was removed:
- ----- Method: Password>>sequence (in category 'accessing') -----
- sequence
- ^sequence!
Item was removed:
- ----- Method: Password>>sequence: (in category 'accessing') -----
- sequence: anNumber
- sequence := anNumber!
Item was removed:
- ----- Method: Password>>serverPasswords (in category 'accessing') -----
- serverPasswords
- "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
-
- | sfile |
- (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
- "If not there, Caller will ask user for password"
- "If you don't have this file, and you really do want to release an update,
- contact Ted Kaehler."
- ^ (self decode: (sfile contentsOfEntireFile)) lines
- !
Item was changed:
----- Method: ServerDirectory>>password (in category 'accessing') -----
password
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
^ passwordHolder passwordFor: self "may ask the user"!
Item was changed:
----- Method: ServerDirectory>>password: (in category 'accessing') -----
password: pp
+ passwordHolder := ServerPassword new.
- passwordHolder := Password new.
pp isString
ifTrue: [passwordHolder cache: pp. ^ self].
pp isInteger
ifTrue: [passwordHolder sequence: pp]
ifFalse: [passwordHolder := pp].!
Item was changed:
----- Method: ServerDirectory>>passwordSequence: (in category 'accessing') -----
passwordSequence: aNumber
+ passwordHolder ifNil: [passwordHolder := ServerPassword new].
- passwordHolder ifNil: [passwordHolder := Password new].
passwordHolder sequence: aNumber!
Item was added:
+ Password subclass: #ServerPassword
+ instanceVariableNames: 'sequence'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Network-Kernel'!
+
+ !ServerPassword commentStamp: 'cbc 6/7/2019 11:15' prior: 0!
+ "Hold a password. There are three ways to get the password.
+
+ If there is no password (sequence == nil), ask the user for it.
+
+ If the user supplied one during this session, return that. It is cleared at shutDown.
+
+ If sequence is a number, get the server passwords off the disk. File 'sqk.info' must be in the same folder 'Squeak.sources' file. Decode the file. Return the password indexed by sequence."!
Item was added:
+ ----- Method: ServerPassword>>cache: (in category 'accessing') -----
+ cache: anObject
+ cache := anObject!
Item was added:
+ ----- Method: ServerPassword>>passwordFor: (in category 'accessing') -----
+ passwordFor: serverDir
+ "Returned the password from one of many sources. OK if send in a nil arg."
+
+ | sp msg |
+ cache ifNotNil: [^ cache].
+ sequence ifNotNil: [
+ (sp := self serverPasswords) ifNotNil: [
+ sequence <= sp size ifTrue: [^ sp at: sequence]]].
+ msg := serverDir isRemoteDirectory
+ ifTrue: [serverDir moniker]
+ ifFalse: ['this directory'].
+ (serverDir user = 'anonymous') & (serverDir typeWithDefault == #ftp) ifTrue: [
+ ^ cache := UIManager default request: 'Please let this anonymous ftp\server know your email address.\This is the polite thing to do.' withCRs
+ initialAnswer: 'yourName(a)company.com'].
+
+ ^ cache := UIManager default requestPassword: 'Password for ', serverDir user, ' at ', msg, ':'.
+ "Diff between empty string and abort?"!
Item was added:
+ ----- Method: ServerPassword>>sequence (in category 'accessing') -----
+ sequence
+ ^sequence!
Item was added:
+ ----- Method: ServerPassword>>sequence: (in category 'accessing') -----
+ sequence: anNumber
+ sequence := anNumber!
Item was added:
+ ----- Method: ServerPassword>>serverPasswords (in category 'accessing') -----
+ serverPasswords
+ "Get the server passwords off the disk and decode them. The file 'sqk.info' must be in some folder that Squeak thinks is special (vm folder, or default directory). (Note: This code works even if you are running with no system sources file.)"
+
+ | sfile |
+ (sfile := FileDirectory lookInUsualPlaces: 'sqk.info') ifNil: [^ nil].
+ "If not there, Caller will ask user for password"
+ "If you don't have this file, and you really do want to release an update,
+ contact Ted Kaehler."
+ ^ (self decode: (sfile contentsOfEntireFile)) lines
+ !
Item was added:
+ ----- Method: SocksSocket class>>noAutorizationMethod (in category 'accessing') -----
+ noAutorizationMethod
+ ^0!
Item was removed:
- ----- Method: SocksSocket>>noAutorizationMethod (in category 'methods') -----
- noAutorizationMethod
- ^0!
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.267.mcz
==================== Summary ====================
Name: MorphicExtras-mt.267
Author: mt
Time: 13 November 2019, 1:49:19.350043 pm
UUID: 2d40f447-7663-3e49-a7a3-41d4ee87c391
Ancestors: MorphicExtras-ul.266
Increase the accuracy of magnifier a little bit. Not sure whether we want to add some "low performance" check here. In that case, I would opt for "500" or "1000" as stepTime.
=============== Diff against MorphicExtras-ul.266 ===============
Item was changed:
----- Method: MagnifierMorph>>stepTime (in category 'stepping and presenter') -----
stepTime
+ ^ 33 "ms = 30 frames-per-second"!
- ^ 100!