Skip to content

Commit e86102c

Browse files
committed
from __future__ imports
docstring corrections xxx_ for extensions of existing packages
1 parent a8858e2 commit e86102c

File tree

201 files changed

+807
-573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+807
-573
lines changed

src/compas/cad/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class MeshGeometryInterface(GeometryInterface):
5353

5454

5555
# ==============================================================================
56-
# Testing
56+
# Main
5757
# ==============================================================================
5858

5959
if __name__ == "__main__":

src/compas/com/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
.. module:: compas.com
99
1010
11-
Interface(s) for communication with external software.
12-
13-
1411
Matlab
1512
======
1613
@@ -49,11 +46,11 @@ class Client(object):
4946
pass
5047

5148

52-
from .matlab import *
49+
from .matlab_ import *
5350
from .ssh import *
5451
# from .rhino import *
5552

56-
from .matlab import __all__ as a
53+
from .matlab_ import __all__ as a
5754
from .ssh import __all__ as b
5855
# from .rhino import __all__ as b
5956

File renamed without changes.

src/compas/com/matlab/client.py renamed to src/compas/com/matlab_/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from __future__ import print_function
22
from __future__ import absolute_import
3+
from __future__ import division
4+
5+
import sys
36

47
try:
58
import System
69
except ImportError:
7-
import platform
8-
if platform.python_implementation() == 'IronPython':
10+
if 'ironpython' in sys.version.lower():
911
raise
1012

1113

@@ -327,7 +329,7 @@ def get(self, name):
327329

328330

329331
# ==============================================================================
330-
# Testing
332+
# Main
331333
# ==============================================================================
332334

333335
if __name__ == "__main__":

src/compas/com/matlab/engine.py renamed to src/compas/com/matlab_/engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import print_function
22
from __future__ import absolute_import
3+
from __future__ import division
34

45

56
__author__ = ['Tom Van Mele <vanmelet@ethz.ch>', ]
@@ -177,7 +178,7 @@ def connect(self, name=None):
177178

178179

179180
# ==============================================================================
180-
# Testing
181+
# Main
181182
# ==============================================================================
182183

183184
if __name__ == "__main__":

src/compas/com/matlab/process.py renamed to src/compas/com/matlab_/process.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import print_function
22
from __future__ import absolute_import
3+
from __future__ import division
34

5+
import sys
46
import time
57

68
from subprocess import Popen
@@ -10,10 +12,9 @@
1012
from scipy.io import savemat
1113
from scipy.io import loadmat
1214
except ImportError:
13-
pass
14-
# import platform
15-
# if platform.python_implementation() != 'IronPython':
16-
# raise
15+
if 'ironpython' not in sys.version.lower():
16+
raise
17+
1718

1819
__author__ = ['Tom Van Mele <vanmelet@ethz.ch>', ]
1920
__copyright__ = 'Copyright 2014, Block Research Group - ETH Zurich'
@@ -182,7 +183,7 @@ def read_workspace(self):
182183

183184

184185
# ==============================================================================
185-
# Testing
186+
# Main
186187
# ==============================================================================
187188

188189
if __name__ == "__main__":

src/compas/com/matlab/session.py renamed to src/compas/com/matlab_/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import print_function
22
from __future__ import absolute_import
3+
from __future__ import division
34

45

56
__author__ = ['Tom Van Mele <vanmelet@ethz.ch>', ]
@@ -88,7 +89,7 @@ def connect(self, name=None):
8889

8990

9091
# ==============================================================================
91-
# Testing
92+
# Main
9293
# ==============================================================================
9394

9495
if __name__ == "__main__":

src/compas/com/rhino/client.py

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from __future__ import print_function
2+
from __future__ import absolute_import
3+
from __future__ import division
24

35
import time
46

@@ -7,7 +9,7 @@
79
from comtypes.client import GetModule
810
except ImportError:
911
import platform
10-
if platform.python_implementation() == 'IronPython':
12+
if 'windows' in platform.system().lower():
1113
raise
1214

1315

@@ -61,16 +63,33 @@ def wrapper(*args, **kwargs):
6163
raise RhinoClientError()
6264

6365
def start(self):
64-
self.app = CreateObject('Rhino5.Application')
65-
self.rsm = GetModule(['{75B1E1B4-8CAA-43C3-975E-373504024FDB}', 1, 0])
66+
# self.rsm = GetModule(['{75B1E1B4-8CAA-43C3-975E-373504024FDB}', 1, 0])
67+
# self.rsm = GetModule(['{1C7A3523-9A8F-4CEC-A8E0-310F580536A7}', 1, 0])
68+
# self.rsm = GetModule(['{814d908a-e25c-493d-97e9-ee3861957f49}', 1, 0])
69+
# self.rsm = GetModule(['{8ABB4303-8057-47AD-BAEB-263965E5565D}', 1, 0])
70+
# self.rsm = GetModule(['{75B1E1B4-8CAA-43C3-975E-373504024FDB}', 1, 0])
71+
R = GetModule(r"C:\Program Files\Rhinoceros 5\System\Rhino5.tlb")
72+
RS = GetModule(r"C:\Program Files\Rhinoceros 5\Plug-ins\RhinoScript.tlb")
73+
74+
print(dir(R))
75+
print(dir(RS))
76+
6677
print('loading script interface...')
78+
6779
attempts = 20
80+
81+
self.app = CreateObject('Rhino5x64.Application')
82+
6883
while attempts:
6984
try:
7085
print('attempt %s' % attempts)
71-
self.rsi = self.app.GetScriptObject.QueryInterface(self.rsm.IRhinoScript)
86+
# self.rsi = self.app.GetScriptObject.QueryInterface(self.rsm.IRhinoScript)
87+
# self.rsi = self.app.QueryInterface(self.rsm.IRhino5x64Application).GetScriptObject()
88+
o = self.app.QueryInterface(R.IRhino5x64Interface).GetScriptObject()
89+
self.rsi = o.QueryInterface(RS.IRhinoScript)
7290
break
73-
except Exception:
91+
except Exception as e:
92+
print(e)
7493
time.sleep(0.5)
7594
attempts -= 1
7695
if self.rsi is None:
@@ -89,8 +108,10 @@ def wait(self):
89108

90109

91110
# ==============================================================================
92-
# Testing
111+
# Main
93112
# ==============================================================================
94113

95114
if __name__ == "__main__":
96-
pass
115+
116+
client = RhinoClient()
117+
client.rsi.AddPoint([0, 0, 0])

src/compas/com/ssh/ssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def server_command(client, command):
141141

142142

143143
# ==============================================================================
144-
# Testing
144+
# Main
145145
# ==============================================================================
146146

147147
if __name__ == '__main__':

src/compas/datastructures/__init__.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,9 @@
1414
1515
Mesh
1616
Network
17+
FaceNetwork
1718
VolMesh
1819
19-
Mesh
20-
====
21-
22-
Network
23-
=======
24-
25-
VolMesh
26-
=======
27-
28-
2920
"""
3021

3122
from __future__ import print_function

0 commit comments

Comments
 (0)