forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyMatchNode.py
More file actions
31 lines (24 loc) · 724 Bytes
/
MyMatchNode.py
File metadata and controls
31 lines (24 loc) · 724 Bytes
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
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: MyMatchNode
@Time: 2025/3/7 23:54
@Desc:
"""
import time
from datetime import datetime
from PyCGraph import GNode, CStatus
from MyParams.MyParam import MyParam
class MyMatchNode(GNode):
def run(self):
time.sleep(1)
print("[{0}] run MyMatchNode: {1}".format(datetime.now(), self.getName()))
return CStatus()
def isMatch(self):
param: MyParam = self.getGParamWithNoEmpty('param1')
result = 0 != param.count % 2
if result:
print(' match, ready to run {0}'.format(self.getName()))
else:
print(' not match, will not run {0}'.format(self.getName()))
return result