forked from ObjectProfile/PythonBridge
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPBSettings.class.st
More file actions
70 lines (60 loc) · 1.74 KB
/
PBSettings.class.st
File metadata and controls
70 lines (60 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Class {
#name : #PBSettings,
#superclass : #LanguageLinkSettings,
#instVars : [
'pipenvPath',
'debugSocketAddress'
],
#category : #'PythonBridge-Platform'
}
{ #category : #accessing }
PBSettings class >> pharoSocketAddress: pharoSocketAddress pythonSocketAddress: pythonSocketAddress [
^ self new
clientSocketAddress: pharoSocketAddress;
serverSocketAddress: pythonSocketAddress;
yourself
]
{ #category : #accessing }
PBSettings >> debugSocketAddress [
^ debugSocketAddress
]
{ #category : #accessing }
PBSettings >> debugSocketAddress: anObject [
debugSocketAddress := anObject
]
{ #category : #utils }
PBSettings >> deleteRuntimeEnvironment [
"Delete the whole PythonBridgeRuntime working directory.
This will effectively force reinstallation on the next run.
Only execute when you have not added or editing anything there"
self workingDirectory deleteAll
]
{ #category : #ui }
PBSettings >> gtDeleteActionFor: anAction [
<gtAction>
^ anAction button
icon: BrGlamorousVectorIcons remove;
tooltip: 'Delete the runtime environment';
priority: 20;
action: [ :element | self deleteRuntimeEnvironment ]
]
{ #category : #accessing }
PBSettings >> manualCommand [
^ 'pipenv run python -m gtoolkit_bridge --port {1} --pharo {2} --method {3}{4}'
format: {
self serverSocketAddress port .
self clientSocketAddress port .
self messageBrokerStrategy methodArg.
self debugMode ifTrue: [ ' --log' ] ifFalse: [ '' ] }
]
{ #category : #accessing }
PBSettings >> pipenvPath [
^ pipenvPath
]
{ #category : #accessing }
PBSettings >> pipenvPath: aFileReference [
pipenvPath := aFileReference asFileReference.
pipenvPath ifNil: [ ^ self ].
self assert: [ pipenvPath exists ]
description: pipenvPath fullName, ' doesn''t exist'.
]