-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support of pretty print of image process list
- Introduced new PhLImageProcess to store data about image process - fixes #616
- Loading branch information
Showing
2 changed files
with
137 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
" | ||
I represent running Pharo image process. I have a known PID of running Pharo image process, image name, vm path, image Path start datetime of process. I am used mainly for pretty printing to user output. | ||
" | ||
Class { | ||
#name : #PhLImageProcess, | ||
#superclass : #PhLObject, | ||
#instVars : [ | ||
'pid', | ||
'vmPath', | ||
'imagePath', | ||
'startDateTime' | ||
], | ||
#category : #'PharoLauncher-Core-Model' | ||
} | ||
|
||
{ #category : #private } | ||
PhLImageProcess class >> listPrintAttributeBlocks [ | ||
|
||
^ {[:imgProcess | imgProcess pid asString]. [:imgProcess | imgProcess imageName]. [:imgProcess | imgProcess vmPath]. [:imgProcess | imgProcess imagePath]. [:imgProcess | imgProcess startDateTime ].} | ||
|
||
] | ||
|
||
{ #category : #private } | ||
PhLImageProcess class >> listPrintAttributeLabels [ | ||
|
||
^ #('PID' 'Image name' 'VM path' 'Image path' 'Date/Time started') | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
PhLImageProcess class >> newFrom: osOutputLine [ | ||
|
||
"initialize image process instance from line represented by OS command output line" | ||
^ self new initializeFrom: osOutputLine; yourself | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> imageName [ | ||
|
||
|
||
self imagePath ifEmpty: [ ^ '' ]. | ||
^ (self imagePath copyAfterLast: FileSystem disk delimiter) copyUpTo: $. | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> imagePath [ | ||
|
||
^ imagePath | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> imagePath: anObject [ | ||
|
||
imagePath := anObject | ||
] | ||
|
||
{ #category : #initialization } | ||
PhLImageProcess >> initializeFrom: processLineArray [ | ||
|
||
self pid: processLineArray first. | ||
self vmPath: processLineArray second. | ||
self imagePath: processLineArray third. | ||
self startDateTime: processLineArray fourth. | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> pid [ | ||
|
||
^ pid | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> pid: anObject [ | ||
|
||
pid := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> startDateTime [ | ||
|
||
^ startDateTime | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> startDateTime: anObject [ | ||
|
||
startDateTime := anObject | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> vmPath [ | ||
|
||
^ vmPath | ||
] | ||
|
||
{ #category : #accessing } | ||
PhLImageProcess >> vmPath: anObject [ | ||
|
||
vmPath := anObject | ||
] |