Skip to content

Commit cc54e83

Browse files
Add start_bridge calling to support new imports from inheriteds applications.
1 parent 2eb918d commit cc54e83

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/PythonBridge/PBApplication.class.st

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ PBApplication class >> do: aBlockClosure [
4040
[
4141
self start.
4242
retVal := aBlockClosure value.
43-
KCF << nil.
44-
KCF send waitForValue. ] ensure: [ self stop ].
43+
self uniqueInstance commandFactory << nil.
44+
self uniqueInstance commandFactory send waitForValue. ] ensure: [ self stop ].
4545
^ retVal
4646
]
4747

@@ -106,6 +106,7 @@ PBApplication class >> start [
106106
self isRunning ifTrue: [ Error signal: 'Keras already running.' ].
107107
self stop.
108108
uniqueInstance := self new.
109+
uniqueInstance commandFactory reset.
109110
uniqueInstance start
110111
]
111112

@@ -190,6 +191,7 @@ PBApplication >> newCommandFactory [
190191

191192
{ #category : #accessing }
192193
PBApplication >> postInitialization [
194+
193195
]
194196

195197
{ #category : #accessing }

src/PythonBridge/PBProcessHandler.class.st

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PBProcessHandler class >> resolvePipenvPath [
3333

3434
{ #category : #accessing }
3535
PBProcessHandler >> arguments [
36-
^ { 'run'. 'python'. 'PythonBridge/pharo_hooks.py'.
36+
^ { 'run'. 'python'. 'start_bridge.py'.
3737
'--port'. self communicationHandler pythonPort asString .
3838
'--pharo'. self communicationHandler pharoPort asString .
3939
'--log'}
@@ -52,10 +52,12 @@ PBProcessHandler >> isRunning [
5252

5353
{ #category : #'instance creation' }
5454
PBProcessHandler >> newProcess [
55+
| workingDirectory |
56+
workingDirectory := self application class repositoryFileReference fullName.
5557
^ OSSUnixSubprocess new
5658
command: self class pipEnvPath;
5759
arguments: self arguments;
58-
workingDirectory: self application class repositoryFileReference fullName;
60+
workingDirectory: workingDirectory;
5961
redirectStdin;
6062
redirectStdout;
6163
redirectStderr;

0 commit comments

Comments
 (0)