cloudpss 4.5.7__tar.gz → 4.5.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudpss-4.5.7 → cloudpss-4.5.9}/PKG-INFO +1 -1
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/function/functionExecution.py +37 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/topology.py +17 -5
- cloudpss-4.5.9/cloudpss/version.py +1 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss.egg-info/PKG-INFO +1 -1
- cloudpss-4.5.7/cloudpss/version.py +0 -1
- {cloudpss-4.5.7 → cloudpss-4.5.9}/README.md +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/job/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/job/job.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/model/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/model/model.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/model/revision.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/model/topology.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/utils/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/function/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/function/function.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/function/job.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/DataManageModel.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/EvaluationModel.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/IESLabOpt.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/IESLabPlan.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/IESLabSimulation.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/PlanModel.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/ieslab/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/job.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/jobReceiver.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/EMTResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/IESResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/PowerFlowResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/job/result/result.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/implements/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/implements/component.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/implements/diagram.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/implements/implement.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/jobDefinitions.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/model.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/model/revision.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/project/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/project/project.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/IESLabPlanResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/MessageStreamReceiver.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/receiver.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/result.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/runner.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/storage.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/runner/transform.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/IO.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/__init__.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/dataEncoder.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/graphqlUtil.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/httprequests.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/matlab.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/utils/yamlLoader.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss/verify.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss.egg-info/SOURCES.txt +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss.egg-info/dependency_links.txt +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss.egg-info/requires.txt +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/cloudpss.egg-info/top_level.txt +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/setup.cfg +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/setup.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-async.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-async2.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-async3.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-plot.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-plot1.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-sdk.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-sdk1.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-snapshot.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-topology.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-topology1.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test-yield.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test11.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test12.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test7950.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testAsync.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testEvent.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testRt-test.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testRt.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testRt2.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testSend.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test_in_new_web_1.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test_modepower_ampratio(3).py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test_ws.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test_ws2.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/test_ws3.py +0 -0
- {cloudpss-4.5.7 → cloudpss-4.5.9}/test/testb.py +0 -0
@@ -4,6 +4,8 @@ import json
|
|
4
4
|
import signal
|
5
5
|
import sys
|
6
6
|
from ..utils import MatlabDataEncoder
|
7
|
+
import threading
|
8
|
+
import queue
|
7
9
|
|
8
10
|
|
9
11
|
class EventSample(object):
|
@@ -23,7 +25,23 @@ class EventSample(object):
|
|
23
25
|
eventHandlerKwargs] in self.__eventHandlerSample:
|
24
26
|
eventHandlerSample(*eventHandlerArgs, **eventHandlerKwargs)
|
25
27
|
|
28
|
+
class EventInput(object):
|
29
|
+
def __init__(self):
|
30
|
+
self.__eventHandlerSample = []
|
26
31
|
|
32
|
+
def __iadd__(self, EventHandler):
|
33
|
+
self.__eventHandlerSample.append(EventHandler)
|
34
|
+
return self
|
35
|
+
|
36
|
+
def __isub__(self, EventHandler):
|
37
|
+
self.__eventHandlerSample.remove(EventHandler)
|
38
|
+
return self
|
39
|
+
|
40
|
+
def __call__(self, *args, **kwargs):
|
41
|
+
for [eventHandlerSample] in self.__eventHandlerSample:
|
42
|
+
# 调用事件处理程序
|
43
|
+
if eventHandlerSample:
|
44
|
+
eventHandlerSample(*args, **kwargs)
|
27
45
|
class Args(dict):
|
28
46
|
"""
|
29
47
|
参数类
|
@@ -87,7 +105,9 @@ class FunctionExecution(object):
|
|
87
105
|
self.token = kwargs.get('token', None)
|
88
106
|
self.functionToken = kwargs.get('functionToken', None)
|
89
107
|
self.__abortedEvents = EventSample()
|
108
|
+
self.__inputEvents = EventInput()
|
90
109
|
self._args = None
|
110
|
+
self.__input_thread = None
|
91
111
|
signal.signal(signal.SIGINT, self._on_abort)
|
92
112
|
|
93
113
|
@property
|
@@ -185,6 +205,23 @@ class FunctionExecution(object):
|
|
185
205
|
'''
|
186
206
|
sys.exit(code)
|
187
207
|
|
208
|
+
def input_thread(self):
|
209
|
+
while True:
|
210
|
+
user_input = input()
|
211
|
+
self.__inputEvents(user_input)
|
212
|
+
|
213
|
+
def on_input(self, func):
|
214
|
+
"""
|
215
|
+
监听input事件
|
216
|
+
|
217
|
+
:params func 响应后的回调函数
|
218
|
+
"""
|
219
|
+
if self.__input_thread is None:
|
220
|
+
self.__input_thread = threading.Thread(target=self.input_thread, args=())
|
221
|
+
self.__input_thread.start()
|
222
|
+
self.log('cloudpss input stream is ready', 'debug')
|
223
|
+
self.__inputEvents += [func]
|
224
|
+
|
188
225
|
def print(self, data):
|
189
226
|
print(json.dumps(data, cls=MatlabDataEncoder)+'\n', flush=True)
|
190
227
|
|
@@ -17,14 +17,16 @@ class ModelTopology():
|
|
17
17
|
mappings 拓扑分析后的一些映射数据
|
18
18
|
|
19
19
|
|
20
|
+
"""
|
21
|
+
__ReqParam="""
|
22
|
+
components
|
23
|
+
mappings
|
20
24
|
"""
|
21
25
|
__modelTopologyQuery = """
|
22
26
|
query($a:ModelTopologyInput!){
|
23
27
|
modelTopology(input:$a){
|
24
|
-
|
25
|
-
|
26
|
-
ports
|
27
|
-
}}
|
28
|
+
|
29
|
+
|
28
30
|
"""
|
29
31
|
__All__ = ['ModelTopology']
|
30
32
|
|
@@ -77,7 +79,17 @@ class ModelTopology():
|
|
77
79
|
'maximumDepth': maximumDepth
|
78
80
|
}
|
79
81
|
}
|
80
|
-
|
82
|
+
|
83
|
+
ports = kwargs.get('ports', False)
|
84
|
+
if ports:
|
85
|
+
ModelTopology.__ReqParam += """
|
86
|
+
ports
|
87
|
+
"""
|
88
|
+
del kwargs['ports']
|
89
|
+
query = ModelTopology.__modelTopologyQuery + ModelTopology.__ReqParam + "}}"
|
90
|
+
|
91
|
+
|
92
|
+
data = graphql_request(query, variables, **kwargs)
|
81
93
|
if 'errors' in data:
|
82
94
|
raise Exception(data['errors'][0]['message'])
|
83
95
|
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '4.5.9'
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '4.5.7'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|