forked from ObjectProfile/PythonBridge
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPBProxyObject.class.st
More file actions
66 lines (56 loc) · 1.28 KB
/
PBProxyObject.class.st
File metadata and controls
66 lines (56 loc) · 1.28 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
Class {
#name : #PBProxyObject,
#superclass : #PBObject,
#instVars : [
'pythonClass',
'application'
],
#category : #'PythonBridge-Core'
}
{ #category : #'instance creation' }
PBProxyObject class >> pythonClass: pythonClass pythonVar: pyVar application: application [
| proxyClass |
proxyClass := self subclasses
detect: [ :each | each pythonClass = pythonClass ]
ifNone: [ self ].
^ proxyClass new
pythonVariable: pyVar;
pythonClass: pythonClass;
application: application;
yourself
]
{ #category : #accessing }
PBProxyObject >> application [
^ application
]
{ #category : #accessing }
PBProxyObject >> application: anObject [
application := anObject
]
{ #category : #accessing }
PBProxyObject >> applicationClass [
^ self application class
]
{ #category : #hooks }
PBProxyObject >> createObject [
self shouldNotImplement
]
{ #category : #printing }
PBProxyObject >> printOn: str [
str
<< (pythonClass asString first isVowel ifTrue: ['an '] ifFalse: ['a ']);
<< pythonClass asString;
<< ' (Proxy)'
]
{ #category : #accessing }
PBProxyObject >> pythonClass [
^ pythonClass
]
{ #category : #accessing }
PBProxyObject >> pythonClass: anObject [
pythonClass := anObject
]
{ #category : #accessing }
PBProxyObject >> pythonVariable: pyVar [
pythonVariable := pyVar
]