Creating PyEnv class and fixing baseline.
This commit is contained in:
parent
80e4dcf5a3
commit
30b0d3f721
@ -7,7 +7,5 @@ Class {
|
|||||||
{ #category : #baseline }
|
{ #category : #baseline }
|
||||||
BaselineOfExtEnvi >> baseline: spec [
|
BaselineOfExtEnvi >> baseline: spec [
|
||||||
<baseline>
|
<baseline>
|
||||||
^ spec
|
^ spec for: #common do: [ spec package: 'ExtEnvi' ]
|
||||||
for: #common
|
|
||||||
do: [ spec package: 'ExtEnvi' with: [ spec requires: #('GToolkit-Utility-System') ] ]
|
|
||||||
]
|
]
|
||||||
|
41
src/ExtEnvi/PyEnv.class.st
Normal file
41
src/ExtEnvi/PyEnv.class.st
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
Class {
|
||||||
|
#name : #PyEnv,
|
||||||
|
#superclass : #Object,
|
||||||
|
#instVars : [
|
||||||
|
'workingDirectory',
|
||||||
|
'pyVersion',
|
||||||
|
'pyBinLocation'
|
||||||
|
],
|
||||||
|
#category : #ExtEnvi
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #'as yet unclassified' }
|
||||||
|
PyEnv >> initialize [
|
||||||
|
super initialize
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #'as yet unclassified' }
|
||||||
|
PyEnv >> python3 [
|
||||||
|
pyVersion := (GtSubprocessWithInMemoryOutput new
|
||||||
|
command: 'python3';
|
||||||
|
arguments: #('--version');
|
||||||
|
runAndWait;
|
||||||
|
stdout) trimmed.
|
||||||
|
pyBinLocation := (GtSubprocessWithInMemoryOutput new
|
||||||
|
command: 'which';
|
||||||
|
arguments: #('python3');
|
||||||
|
runAndWait;
|
||||||
|
stdout) trimmed asFileReference.
|
||||||
|
^ {'location' -> pyBinLocation.
|
||||||
|
'version' -> pyVersion} asDictionary
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PyEnv >> workingDirectory [
|
||||||
|
^ workingDirectory ifNil: [ workingDirectory := (FileLocator documents / 'TempPythonEnv') ensureCreateDirectory ]
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PyEnv >> workingDirectory: aDirReference [
|
||||||
|
workingDirectory := aDirReference
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user