-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ErrorReport can now show problems with metadata.
Also catches errors with broken files (#124).
- Loading branch information
Vincent Opitz
committed
Jun 23, 2019
1 parent
4ab5f46
commit dfecf60
Showing
20 changed files
with
78 additions
and
44 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.../Presenter-Core.package/PSPresentationLoader.class/instance/buildFileErrorReportString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
as yet unclassified | ||
buildFileErrorReportString | ||
|
||
| aString | | ||
(self errorReport at: #files) isEmpty | ||
ifTrue: [^ ' I loaded all additional files correctly.'] | ||
ifFalse: | ||
[aString := ''. | ||
self filesErrorReport keysAndValuesDo: | ||
[:key :value | aString := aString, Character cr , key , ' ', value , '.'. | ||
^ aString]] |
14 changes: 14 additions & 0 deletions
14
...Presenter-Core.package/PSPresentationLoader.class/instance/buildMorphErrorReportString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
as yet unclassified | ||
buildMorphErrorReportString | ||
|
||
| aString wronglyLoadedMorphs | | ||
wronglyLoadedMorphs := self slidesErrorReport select: | ||
[:each | each > 0]. | ||
(wronglyLoadedMorphs) isEmpty | ||
ifTrue: [^ ' I loaded all morphs correctly.'] | ||
ifFalse: | ||
[aString := ''. | ||
wronglyLoadedMorphs keysAndValuesDo: | ||
[:key :value | aString := aString , Character cr , key , ' is missing ' , value , ' morph(s)']. | ||
^ aString]. | ||
|
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationLoader.class/instance/completeErrorReport.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
completeErrorReport | ||
|
||
^ self buildMorphErrorReportString , Character cr , self buildFileErrorReportString. |
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationLoader.class/instance/filesErrorReport.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
filesErrorReport | ||
|
||
^ self errorReport at: #files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/Presenter-Core.package/PSPresentationLoader.class/instance/loadMetadataFrom.for..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
slide loading | ||
loadMetadataFrom: aDirectory for: aSlide | ||
|
||
| instanceVarDict | | ||
(aDirectory /'metadata.dict') exists ifTrue: | ||
[[instanceVarDict := Dictionary readFrom: (aDirectory readOnlyFileNamed: 'metadata.dict'). | ||
self update: aSlide with: instanceVarDict] | ||
on: Error | ||
do: [self filesErrorReport at: aDirectory/ 'metadata' asString put: 'file corrupted']] | ||
|
7 changes: 2 additions & 5 deletions
7
...ges/Presenter-Core.package/PSPresentationLoader.class/instance/loadSlideFromDirectory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
slide loading | ||
loadSlideFromDirectory: aDirectory | ||
|
||
| slide instanceVar| | ||
| slide | | ||
slide := self presentation createSlideBack. | ||
self loadMorphsFromDirectory: aDirectory intoSlide: slide. | ||
(aDirectory / 'metadata.dict') exists ifTrue: | ||
[instanceVar := Object readFrom: (aDirectory readOnlyFileNamed: 'metadata.dict'). | ||
"instanceVar := FileStream oldFileNamed: (aDirectory / ) fullName do: [:in | Object readFrom: in]." | ||
self update:slide with: instanceVar.]. | ||
self loadMetadataFrom: aDirectory for: slide. | ||
^ slide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/Presenter-Core.package/PSPresentationLoader.class/instance/slidesErrorReport.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
slidesErrorReport | ||
|
||
^ self errorReport at: #slides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/Presenter-Core.package/PSPresentationTool.class/instance/buildErrorReportString..st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
packages/Presenter-Core.package/PSPresentationTool.class/instance/showErrorReport..st
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...ter-Core.package/PSPresentationTool.class/instance/updatePresentation.withErrorReport..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
slide miniatures | ||
updatePresentation: aPSPresentation withErrorReport: aDictionary | ||
updatePresentation: aPSPresentation withErrorReport: aString | ||
|
||
self | ||
presentation: aPSPresentation; | ||
selectSlideNumber: 1; | ||
updateSlideMiniaturesCompletely; | ||
showErrorReport: aDictionary | ||
updateSlideMiniaturesCompletely. | ||
UIManager inform: aString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters