Multiple changes:
- Move to a Python process for the LanguageLink client [fixes #1, presumably] - Finish a first rough draft of the booklet [fixes #4]
This commit is contained in:
@@ -11,26 +11,27 @@ Class {
|
||||
#category : #'Carp-Processes'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess class >> program [
|
||||
^ 'carp'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess class >> resolveCarpPath [
|
||||
| proc |
|
||||
|
||||
proc := GtSubprocessWithInMemoryOutput new
|
||||
command: 'which';
|
||||
arguments: { 'carp' }.
|
||||
arguments: { self program}.
|
||||
CarpPlatform subProcessEnvironmentDictionary keysAndValuesDo: [ :key :value |
|
||||
proc environmentAt: key put: value ].
|
||||
proc runAndWait.
|
||||
(#(0 1) includes: proc exitCode) ifFalse:
|
||||
[ self error: 'Unable to request carp location' ].
|
||||
[ self error: 'Unable to request', self program, ' location' ].
|
||||
^ proc stdout trim asFileReference
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess class >> resolveNodejsPath [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess class >> serverPath [
|
||||
^ CarpPath
|
||||
@@ -89,12 +90,17 @@ CarpProcess >> processArguments [
|
||||
self settings serverDebugMode ifTrue:
|
||||
[ args add: '--inspect' ].
|
||||
args
|
||||
add: (self workingDirectory / 'src/languagelink.carp') resolve fullName;
|
||||
add: (self workingDirectory / self programFile) resolve fullName;
|
||||
add: self settings serverSocketAddress port asString;
|
||||
add: self settings clientSocketAddress port asString.
|
||||
^ args
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess >> programFile [
|
||||
^ 'src/languagelink.carp'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpProcess >> serverPath [
|
||||
| fileReference |
|
||||
|
15
src/Carp/CarpPythonProcess.class.st
Normal file
15
src/Carp/CarpPythonProcess.class.st
Normal file
@@ -0,0 +1,15 @@
|
||||
Class {
|
||||
#name : #CarpPythonProcess,
|
||||
#superclass : #CarpProcess,
|
||||
#category : #'Carp-Processes'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpPythonProcess class >> program [
|
||||
^ 'python'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CarpPythonProcess >> programFile [
|
||||
^ 'src/languagelink.py'
|
||||
]
|
@@ -9,7 +9,7 @@ LanguageLinkSettings class >> carpDefaultSettings [
|
||||
serverSocketAddress: (LanguageLinkSocketAddress
|
||||
ipOrName: 'localhost' port: (9900 + 99 atRandom));
|
||||
messageBrokerStrategy: LanguageLinkHttpMessageBroker;
|
||||
serverProcessClass: CarpProcess;
|
||||
serverProcessClass: CarpPythonProcess;
|
||||
platform: CarpPlatform new;
|
||||
commandFactoryClass: CarpCommandFactory;
|
||||
commandClass: LanguageLinkCommand;
|
||||
|
Reference in New Issue
Block a user