Skip to content

Commit 1a84a2e

Browse files
committed
Changed "(:/!)" to "(:!!)"
1 parent e30f211 commit 1a84a2e

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,36 +422,36 @@ Sample User Apps/Modules/Scripts
422422
{
423423
"(://)": "http://service1",
424424
"(...)": {"svc1-arg1": "arg1 of service1 payload ..." },
425-
"(:/!)": 600
425+
"(:!!)": 600
426426
},
427427
{
428428
"(://)": "http://service2",
429429
"(.|.)": {"svc2-arg1": "arg1 of service2 payload ..." },
430-
"(:/!)": 600
430+
"(:!!)": 600
431431
},
432432
{
433433
"[###]": [
434434
{
435435
"(://)": "http://service3",
436436
"(...)": {"svc3-arg1": "arg1 of service3 payload ..." },
437-
"(:/!)": 1800
437+
"(:!!)": 1800
438438
},
439439
{
440440
"(://)": "http://service4",
441441
"(...)": {"svc4-arg1": "arg1 of service4 payload ..." },
442-
"(:/!)": 1800
442+
"(:!!)": 1800
443443
},
444444
{
445445
"(://)": "http://service5",
446446
"(...)": {"svc5-arg1": "arg1 of service5 payload ..." },
447-
"(:/!)": 1800
447+
"(:!!)": 1800
448448
}
449449
]
450450
},
451451
{
452452
"(://)": "http://service6",
453453
"(...)": {"svc6-arg1": "arg1 of service6 payload ..." },
454-
"(:/!)": 600
454+
"(:!!)": 600
455455
}
456456
]
457457
}
@@ -472,7 +472,7 @@ Sample User Apps/Modules/Scripts
472472
{
473473
"(://)": "http://service1",
474474
"(...)": {"svc1-arg1": "arg1 of service1 payload ..." },
475-
"(:/!)": timeout seconds
475+
"(:!!)": timeout seconds
476476
}
477477
478478
Or
@@ -482,13 +482,13 @@ Sample User Apps/Modules/Scripts
482482
{
483483
"(://)": "http://service2",
484484
"(.|.)": {"svc2-arg1": "arg1 of service2 payload ..." },
485-
"(:/!)": timeout seconds
485+
"(:!!)": timeout seconds
486486
}
487487
488488
+ "``(://)``" - *Key : Value* - "URL of the service call"
489489
+ "``(...)``" - *Key : Value* - {A dictionary of arguments (payload) for the service call}
490490
+ "``(.|.)``" - *Key : Value* - {Merge the results of the previous service as pipeline arguments into this dictionary of arguments}
491-
+ "``(:/!)``" - *Key : Value* - timeout seconds (optional) *How many seconds to wait for the REST service to respond before giving up*
491+
+ "``(:!!)``" - *Key : Value* - timeout seconds (optional) *How many seconds to wait for the REST service to respond before giving up*
492492

493493
Each service is an executable/callable unit, let's have a convention to use a rounded rectangle as its graphical symbol.
494494

Sample/UserApps/ServicesGrouping/rest_grouping.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
_reserved_key_rest_url : str = "(://)"
2323
_reserved_key_payload : str = "(...)"
2424
_reserved_key_payload_with_pipe : str = "(.|.)"
25-
_reserved_key_timeout : str = "(:/!)"
25+
_reserved_key_timeout : str = "(:!!)"
2626

2727

2828
def _task_func(url:str, data:dict=None, timeout:float=None):
@@ -54,6 +54,15 @@ def create_base_container(self) -> TaskContainer:
5454
return TaskContainer(_task_func, _pipeargs_merge_fn, self.thread_pool)
5555

5656

57+
@staticmethod
58+
def _get_timeout(task_node:Dict[str, Any])->float:
59+
timeout = task_node.get(_reserved_key_timeout)
60+
if isinstance(timeout, (int, float)) and timeout > 0:
61+
return timeout
62+
else:
63+
return None
64+
65+
5766
def extract_single_task(self, task_node:Dict[str, Any]) -> Tuple[tuple, Dict[str, Any], bool]:
5867
url = task_node.get(_reserved_key_rest_url)
5968
if url:
@@ -69,8 +78,7 @@ def extract_single_task(self, task_node:Dict[str, Any]) -> Tuple[tuple, Dict[str
6978
else:
7079
with_pipe = False
7180

72-
timeout = task_node.get(_reserved_key_timeout)
73-
81+
timeout = self._get_timeout(task_node)
7482
return ((), {'url': url, 'data': data, 'timeout': timeout}, with_pipe)
7583
else:
7684
return None
@@ -86,7 +94,7 @@ def extract_parallel_group(self, task_node:Dict[str, Any]) -> List[Dict[str, Any
8694

8795
def load(self, task_tree:Dict[str, Any]) -> TaskContainer:
8896
container = super().load(task_tree)
89-
container.timeout = task_tree.get(_reserved_key_timeout)
97+
container.timeout = self._get_timeout(task_tree)
9098
return container
9199

92100

Utilities.PyPI/dbdatareader.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@
55
----
66
77
**dbDataReader** is a simple data reader for reading .NET ``System.Data.IDataReader``-like forward-only streams.
8+
89
The returned data model depends on the type of data container passed in.
910
10-
4 built-in container classes
11-
- ``ListOfList``, ``DictOfList``, ``ListOfDict`` and ``SqlTvp`` are shipped with this package.
12-
Please refer to the MDX reader example in
13-
https://github.com/DataBooster/PyWebApi/blob/master/Sample/UserApps/MdxReader/adomd_client.py
14-
for quick details.
11+
4 built-in container classes:
12+
13+
- ``ListOfList``
14+
- ``DictOfList``
15+
- ``ListOfDict``
16+
- ``SqlTvp``
17+
18+
are shipped with this package.
1519
16-
|
20+
Please refer to the `MDX Reader <https://github.com/DataBooster/PyWebApi/blob/master/Sample/UserApps/MdxReader/adomd_client.py>`__
21+
example and its `product documentation <https://github.com/DataBooster/PyWebApi#mdx-reader>`__ for quick details.
22+
23+
----
1724
1825
| Homepage and documentation: https://github.com/DataBooster/PyWebApi
1926
| Copyright (c) 2020 Abel Cheng
@@ -383,4 +390,4 @@ def read_all_results(self, result_set_class, *args, **kwargs) -> list:
383390

384391

385392

386-
__version__ = "0.1a7"
393+
__version__ = "0.1a8"

0 commit comments

Comments
 (0)