From bcdbaa9eba36978bcc3a6c450e63f4997e130230 Mon Sep 17 00:00:00 2001 From: Sean DeNigris Date: Wed, 27 Dec 2023 19:38:16 -0500 Subject: [PATCH] [Port]: PythonBridge Pipfile Generation Hack to Latest GT --- src/Dynabook-GToolkit/DbSoup.extension.st | 18 +++++++-------- .../PBPharoPlatform.extension.st | 22 ++----------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/src/Dynabook-GToolkit/DbSoup.extension.st b/src/Dynabook-GToolkit/DbSoup.extension.st index 1682e6d..083e0d2 100644 --- a/src/Dynabook-GToolkit/DbSoup.extension.st +++ b/src/Dynabook-GToolkit/DbSoup.extension.st @@ -1,5 +1,14 @@ Extension { #name : #DbSoup } +{ #category : #'*Dynabook-GToolkit' } +DbSoup class >> addSourceForOlReferencedClass: aClass withBuilder: aBlock [ + "Convenience message because usually one wants to add to both ObjectiveLepiter (to support per-instance pages) and DbSoup" + + ^ self uniqueInstance + addSourceForOlReferencedClass: aClass + withBuilder: aBlock +] + { #category : #'*Dynabook-GToolkit' } DbSoup >> addSourceForOlReferencedClass: aClass withBuilder: aBlock [ @@ -9,12 +18,3 @@ DbSoup >> addSourceForOlReferencedClass: aClass withBuilder: aBlock [ self sources add: aBlock value ] - -{ #category : #'*Dynabook-GToolkit' } -DbSoup class >> addSourceForOlReferencedClass: aClass withBuilder: aBlock [ - "Convenience message because usually one wants to add to both ObjectiveLepiter (to support per-instance pages) and DbSoup" - - ^ self uniqueInstance - addSourceForOlReferencedClass: aClass - withBuilder: aBlock -] diff --git a/src/Dynabook-GToolkit/PBPharoPlatform.extension.st b/src/Dynabook-GToolkit/PBPharoPlatform.extension.st index 9beceb8..d6abaa3 100644 --- a/src/Dynabook-GToolkit/PBPharoPlatform.extension.st +++ b/src/Dynabook-GToolkit/PBPharoPlatform.extension.st @@ -3,30 +3,12 @@ Extension { #name : #PBPharoPlatform } { #category : #'*Dynabook-GToolkit' } PBPharoPlatform >> copyApplicationTo: appFolder application: application [ "Copy the PythonBridge runtime environment to the specified folder" - | srcDir cpCommand proc srcFilename dstFilename error defaultPipfile projectPipfiles | + | srcDir defaultPipfile projectPipfiles | srcDir := self runtimeSourceDirectoryFor: application. srcDir resolve = appFolder resolve ifTrue: [ ^ self ]. - "Copy the runtime directory" - srcFilename := srcDir resolve fullName copyReplaceAll: '"' with: '\"'. - dstFilename := appFolder resolve fullName copyReplaceAll: '"' with: '\"'. - cpCommand := String streamContents: [ :stream | - stream - << 'cp -a "'; - << srcFilename; - << '" "'; - << dstFilename; - << '"' ]. - proc := GtSubprocessWithInMemoryOutput new - shellCommand: cpCommand; - runAndWait. - proc isSuccess ifFalse: - [ error := PBPythonProcessError new - messageText: 'Unable to install PythonBridge runtime'; - application: application; - process: proc. - error signal ]. + srcDir resolve copyAllTo: appFolder resolve. self flag: 'From here to the end is a hack added by the Dynabook project'. defaultPipfile := (appFolder / 'Pipfile') ensureDelete ensureCreateFile asRlResource