cloudpss 4.5.14__tar.gz → 4.5.16__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.14 → cloudpss-4.5.16}/PKG-INFO +1 -1
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/job.py +13 -12
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/messageStreamReceiver.py +5 -4
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/messageStreamSender.py +4 -2
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/EMTResult.py +8 -2
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/model.py +8 -7
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/revision.py +4 -4
- cloudpss-4.5.16/cloudpss/utils/graphqlUtil.py +11 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/httprequests.py +2 -1
- cloudpss-4.5.16/cloudpss/version.py +1 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss.egg-info/PKG-INFO +1 -1
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss.egg-info/SOURCES.txt +2 -1
- cloudpss-4.5.16/test/testkey.py +3 -0
- cloudpss-4.5.14/cloudpss/utils/graphqlUtil.py +0 -11
- cloudpss-4.5.14/cloudpss/version.py +0 -1
- {cloudpss-4.5.14 → cloudpss-4.5.16}/README.md +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/job/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/job/job.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/model/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/model/model.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/model/revision.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/model/topology.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/utils/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/dataManageModel.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/dslab.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/files/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/files/curveData.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/files/files.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/dslab/financialAnalysisModel.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/function/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/function/function.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/function/functionExecution.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/function/job.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/DataManageModel.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/EvaluationModel.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/IESLabOpt.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/IESLabPlan.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/IESLabSimulation.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/PlanModel.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/ieslab/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/TemplateCompiler.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/TemplateManager.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/jobReceiver.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/IESResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/PowerFlowResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/job/result/result.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/implements/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/implements/component.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/implements/diagram.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/implements/implement.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/jobDefinitions.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/model/topology.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/project/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/project/project.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/DSLabResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/IESLabPlanResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/MessageStreamReceiver.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/receiver.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/result.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/runner.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/storage.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/runner/transform.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/IO.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/__init__.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/dataEncoder.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/matlab.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/utils/yamlLoader.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss/verify.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss.egg-info/dependency_links.txt +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss.egg-info/requires.txt +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/cloudpss.egg-info/top_level.txt +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/setup.cfg +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/setup.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-async.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-async2.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-async3.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-plot.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-plot1.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-sdk.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-sdk1.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-snapshot.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-topology.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-topology1.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test-yield.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test11.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test12.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test7950.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testAsync.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testEvent.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testRt-test.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testRt.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testRt2.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testSend.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test_in_new_web_1.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test_modepower_ampratio(3).py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test_ws.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test_ws2.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/test_ws3.py +0 -0
- {cloudpss-4.5.14 → cloudpss-4.5.16}/test/testb.py +0 -0
@@ -65,6 +65,7 @@ class Job(Generic[T]):
|
|
65
65
|
input,
|
66
66
|
output,
|
67
67
|
position,
|
68
|
+
**kwargs
|
68
69
|
):
|
69
70
|
super(Job, self).__init__()
|
70
71
|
self.id = id
|
@@ -84,9 +85,10 @@ class Job(Generic[T]):
|
|
84
85
|
self.__receiver = None
|
85
86
|
self.__sender = None
|
86
87
|
self._result = None
|
88
|
+
self.baseUrl = kwargs.get("baseUrl", None)
|
87
89
|
|
88
90
|
@staticmethod
|
89
|
-
def fetch(id):
|
91
|
+
def fetch(id, **kwargs):
|
90
92
|
"""
|
91
93
|
获取job信息
|
92
94
|
"""
|
@@ -94,11 +96,10 @@ class Job(Generic[T]):
|
|
94
96
|
raise Exception("id is None")
|
95
97
|
|
96
98
|
variables = {"_a": {"id": id}}
|
97
|
-
|
98
|
-
r = graphql_request(Job.__jobQuery, variables)
|
99
|
+
r = graphql_request(Job.__jobQuery, variables,**kwargs)
|
99
100
|
if "errors" in r:
|
100
101
|
raise Exception(r["errors"])
|
101
|
-
return Job(**r["data"]["job"])
|
102
|
+
return Job(**r["data"]["job"],**kwargs)
|
102
103
|
|
103
104
|
|
104
105
|
# @staticmethod
|
@@ -162,7 +163,7 @@ class Job(Generic[T]):
|
|
162
163
|
}
|
163
164
|
return variables
|
164
165
|
@staticmethod
|
165
|
-
def create(revisionHash, job, config, name=None, rid=None, policy=None,
|
166
|
+
def create(revisionHash, job, config, name=None, rid=None, policy=None, **kwargs):
|
166
167
|
"""
|
167
168
|
创建一个运行任务
|
168
169
|
|
@@ -177,11 +178,11 @@ class Job(Generic[T]):
|
|
177
178
|
>>> runner = Runner.runRevision(revision,job,config,'')
|
178
179
|
"""
|
179
180
|
variables=Job.__createJobVariables(job, config, revisionHash, rid=rid, policy=policy, **kwargs)
|
180
|
-
r = graphql_request(Job.__createJobQuery, variables)
|
181
|
+
r = graphql_request(Job.__createJobQuery, variables,**kwargs)
|
181
182
|
if "errors" in r:
|
182
183
|
raise Exception(r["errors"])
|
183
184
|
id = r["data"]["job"]["id"]
|
184
|
-
return Job.fetch(id)
|
185
|
+
return Job.fetch(id,**kwargs)
|
185
186
|
|
186
187
|
|
187
188
|
|
@@ -202,7 +203,7 @@ class Job(Generic[T]):
|
|
202
203
|
if receiver is not None:
|
203
204
|
self.__receiver = receiver
|
204
205
|
if self.__receiver is None:
|
205
|
-
self.__receiver = MessageStreamReceiver(self.output)
|
206
|
+
self.__receiver = MessageStreamReceiver(self.output,baseUrl=self.baseUrl)
|
206
207
|
self.__receiver.connect(**kwargs)
|
207
208
|
return self.__receiver
|
208
209
|
|
@@ -216,7 +217,7 @@ class Job(Generic[T]):
|
|
216
217
|
if sender is not None:
|
217
218
|
self.__sender = sender
|
218
219
|
if self.__sender is None:
|
219
|
-
self.__sender = MessageStreamSender(self.input)
|
220
|
+
self.__sender = MessageStreamSender(self.input,baseUrl=self.baseUrl)
|
220
221
|
self.__sender.connect_legacy(**kwargs)
|
221
222
|
return self.__sender
|
222
223
|
|
@@ -265,7 +266,7 @@ class Job(Generic[T]):
|
|
265
266
|
|
266
267
|
|
267
268
|
|
268
|
-
def abort(self,timeout=3):
|
269
|
+
def abort(self,timeout=3,**kwargs):
|
269
270
|
"""
|
270
271
|
中断当前运行实例
|
271
272
|
"""
|
@@ -278,8 +279,8 @@ class Job(Generic[T]):
|
|
278
279
|
'''
|
279
280
|
variables = {
|
280
281
|
'input': {
|
281
|
-
'id': self.
|
282
|
+
'id': self.id,
|
282
283
|
'timeout': timeout
|
283
284
|
}
|
284
285
|
}
|
285
|
-
graphql_request(query, variables)
|
286
|
+
graphql_request(query, variables,**kwargs)
|
@@ -24,10 +24,13 @@ class Message(object):
|
|
24
24
|
|
25
25
|
|
26
26
|
class MessageStreamReceiver(JobReceiver):
|
27
|
-
def __init__(self, output):
|
27
|
+
def __init__(self, output,**kwargs):
|
28
28
|
super().__init__()
|
29
29
|
self.id = output
|
30
|
-
|
30
|
+
print(kwargs)
|
31
|
+
self.origin = kwargs.get("baseUrl",None)
|
32
|
+
if self.origin is None:
|
33
|
+
self.origin =os.environ.get("CLOUDPSS_API_URL", "https://cloudpss.net/")
|
31
34
|
self.__hasOpen = False
|
32
35
|
self.templates=TemplateManager()
|
33
36
|
self.timeOffset=0
|
@@ -74,7 +77,6 @@ class MessageStreamReceiver(JobReceiver):
|
|
74
77
|
pass
|
75
78
|
|
76
79
|
templateMessage = self.templates.invoke(msg)
|
77
|
-
# print(templateMessage)
|
78
80
|
for m in templateMessage:
|
79
81
|
self.messages.append(m)
|
80
82
|
return
|
@@ -85,7 +87,6 @@ class MessageStreamReceiver(JobReceiver):
|
|
85
87
|
self.messages.append(msg)
|
86
88
|
return msg
|
87
89
|
except Exception as e:
|
88
|
-
print(msg)
|
89
90
|
self.ws.close()
|
90
91
|
return None
|
91
92
|
|
@@ -12,10 +12,12 @@ import logging
|
|
12
12
|
|
13
13
|
|
14
14
|
class MessageStreamSender:
|
15
|
-
def __init__(self, input):
|
15
|
+
def __init__(self, input,**kwargs):
|
16
16
|
super().__init__()
|
17
17
|
self.input = input
|
18
|
-
self.origin =
|
18
|
+
self.origin = kwargs.get("baseUrl",None)
|
19
|
+
if self.origin is None:
|
20
|
+
self.origin =os.environ.get("CLOUDPSS_API_URL", "https://cloudpss.net/")
|
19
21
|
self.__hasOpen = False
|
20
22
|
|
21
23
|
def __on_message(self, ws, message):
|
@@ -145,15 +145,21 @@ class EMTResult(Result):
|
|
145
145
|
else:
|
146
146
|
raise Exception('transmitter is None')
|
147
147
|
|
148
|
-
def send(self,message):
|
148
|
+
def send(self,message=None):
|
149
149
|
"""
|
150
150
|
发送消息
|
151
151
|
"""
|
152
152
|
if self._sender is not None:
|
153
|
-
val =
|
153
|
+
val ={
|
154
|
+
"type": 'virtual_input',
|
155
|
+
"data": message,
|
156
|
+
}
|
154
157
|
if type(message) is VirtualInput:
|
155
158
|
val = message.toJson()
|
156
159
|
|
160
|
+
if message is None:
|
161
|
+
val = self.virtualInput.toJson()
|
162
|
+
|
157
163
|
self._sender.write(val)
|
158
164
|
else:
|
159
165
|
raise Exception('transmitter is None')
|
@@ -298,7 +298,7 @@ class Model(object):
|
|
298
298
|
return config
|
299
299
|
|
300
300
|
@staticmethod
|
301
|
-
def fetchMany(name=None, cursor=[], pageSize=10,owner=None):
|
301
|
+
def fetchMany(name=None, cursor=[], pageSize=10,owner=None,**kwargs):
|
302
302
|
"""
|
303
303
|
获取用户可以运行的项目列表
|
304
304
|
|
@@ -332,13 +332,13 @@ class Model(object):
|
|
332
332
|
if name is not None:
|
333
333
|
variables["_search"] = name
|
334
334
|
|
335
|
-
data = graphql_request(Model.__models_query, {"input": variables})
|
335
|
+
data = graphql_request(Model.__models_query, {"input": variables},**kwargs)
|
336
336
|
if "errors" in data:
|
337
337
|
raise Exception(data["errors"][0]["message"])
|
338
338
|
return data["data"]["models"]['items']
|
339
339
|
|
340
340
|
@staticmethod
|
341
|
-
def fetch(rid):
|
341
|
+
def fetch(rid,**kwargs):
|
342
342
|
"""
|
343
343
|
获取项目
|
344
344
|
|
@@ -349,7 +349,7 @@ class Model(object):
|
|
349
349
|
>>> model=Model.fetch('model/Demo/test')
|
350
350
|
|
351
351
|
"""
|
352
|
-
data = graphql_request(Model.__model_query, {"rid": rid})
|
352
|
+
data = graphql_request(Model.__model_query, {"rid": rid},**kwargs)
|
353
353
|
if "errors" in data:
|
354
354
|
raise Exception(data["errors"][0]["message"])
|
355
355
|
return Model(data["data"]["model"])
|
@@ -464,7 +464,7 @@ class Model(object):
|
|
464
464
|
|
465
465
|
|
466
466
|
@staticmethod
|
467
|
-
def create(model):
|
467
|
+
def create(model,**kwargs):
|
468
468
|
"""
|
469
469
|
新建项目
|
470
470
|
|
@@ -506,12 +506,13 @@ class Model(object):
|
|
506
506
|
},
|
507
507
|
}
|
508
508
|
},
|
509
|
+
**kwargs
|
509
510
|
)
|
510
511
|
|
511
512
|
|
512
513
|
|
513
514
|
@staticmethod
|
514
|
-
def update(model):
|
515
|
+
def update(model,**kwargs):
|
515
516
|
"""
|
516
517
|
更新项目
|
517
518
|
|
@@ -555,7 +556,7 @@ class Model(object):
|
|
555
556
|
'tags': tags,
|
556
557
|
"permissions": permissions,
|
557
558
|
}
|
558
|
-
})
|
559
|
+
},**kwargs)
|
559
560
|
if "errors" in r:
|
560
561
|
raise Exception(r["errors"][0]["message"])
|
561
562
|
return r
|
@@ -75,7 +75,8 @@ class ModelRevision(object):
|
|
75
75
|
|
76
76
|
>>> revision.run(revision,job,config,'')
|
77
77
|
"""
|
78
|
-
|
78
|
+
|
79
|
+
revision= ModelRevision.create(self,**kwargs)
|
79
80
|
if stop_on_entry is not None:
|
80
81
|
job['args']['stop_on_entry'] = stop_on_entry
|
81
82
|
return Job.create(
|
@@ -84,7 +85,7 @@ class ModelRevision(object):
|
|
84
85
|
|
85
86
|
|
86
87
|
@staticmethod
|
87
|
-
def create(revision, parentHash=None):
|
88
|
+
def create(revision, parentHash=None, **kwargs):
|
88
89
|
"""
|
89
90
|
创建一个新版本
|
90
91
|
|
@@ -95,12 +96,11 @@ class ModelRevision(object):
|
|
95
96
|
>>> ModelRevision.create(model.revision)
|
96
97
|
{hash:'4043acbddb9ce0c6174be65573c0380415bc48186c74a459f88865313743230c'}
|
97
98
|
"""
|
98
|
-
|
99
99
|
r = revision.toJSON()
|
100
100
|
if 'hash' in r:
|
101
101
|
del r['hash']
|
102
102
|
variables = {'a': {**r, 'parent': parentHash}}
|
103
|
-
r = graphql_request(ModelRevision.__createModelRevisionQuery, variables)
|
103
|
+
r = graphql_request(ModelRevision.__createModelRevisionQuery, variables,**kwargs)
|
104
104
|
if 'errors' in r:
|
105
105
|
raise Exception(r['errors'])
|
106
106
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# coding=UTF-8
|
2
|
+
import json
|
3
|
+
from cloudpss.utils import request
|
4
|
+
|
5
|
+
|
6
|
+
def graphql_request(query, variables=None, baseUrl=None,token=None,**kwargs):
|
7
|
+
payload = {'query': query, 'variables': variables}
|
8
|
+
|
9
|
+
r = request('POST', 'graphql', data=json.dumps(payload),baseUrl=baseUrl,token=token, **kwargs)
|
10
|
+
|
11
|
+
return json.loads(r.text)
|
@@ -12,7 +12,8 @@ def request(method, uri, baseUrl=None, params={}, token=None, **kwargs):
|
|
12
12
|
if baseUrl == None:
|
13
13
|
baseUrl = os.environ.get('CLOUDPSS_API_URL', 'https://cloudpss.net/')
|
14
14
|
url = requests.compat.urljoin(baseUrl,uri)
|
15
|
-
token
|
15
|
+
if token is None:
|
16
|
+
token = os.environ.get('CLOUDPSS_TOKEN', None)
|
16
17
|
|
17
18
|
if token:
|
18
19
|
headers = {
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '4.5.16'
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# coding=UTF-8
|
2
|
-
import json
|
3
|
-
from cloudpss.utils import request
|
4
|
-
|
5
|
-
|
6
|
-
def graphql_request(query, variables=None, **kwargs):
|
7
|
-
payload = {'query': query, 'variables': variables}
|
8
|
-
|
9
|
-
r = request('POST', 'graphql', data=json.dumps(payload), **kwargs)
|
10
|
-
|
11
|
-
return json.loads(r.text)
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '4.5.14'
|
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
|
File without changes
|
File without changes
|
File without changes
|