parent
2e73292fc6
commit
4c31b27bf6
@ -1,20 +1,87 @@
|
|||||||
import subprocess
|
def subprocess():
|
||||||
lCMD = "for /l %x in (1, 1, 5) do echo %x && ping 127.0.0.1 -n 2"
|
import subprocess
|
||||||
lCMD = "git status"
|
lCMD = "for /l %x in (1, 1, 5) do echo %x && ping 127.0.0.1 -n 2"
|
||||||
proc = subprocess.Popen(f'cmd /c {lCMD}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
lCMD = "git status"
|
||||||
# proc = subprocess.Popen('notepad', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
proc = subprocess.Popen(f'cmd /c {lCMD}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
#proc = subprocess.Popen('cmd /c git status', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
# proc = subprocess.Popen('notepad', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
#proc = subprocess.run(f'cmd /c {lCMD}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
#proc = subprocess.Popen('cmd /c git status', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
print(123)
|
#proc = subprocess.run(f'cmd /c {lCMD}', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
#import pdb
|
print(123)
|
||||||
#pdb.set_trace()
|
#import pdb
|
||||||
#tmp = proc.stdout.read()
|
#pdb.set_trace()
|
||||||
lListenBool = True
|
#tmp = proc.stdout.read()
|
||||||
while lListenBool:
|
lListenBool = True
|
||||||
tmp = proc.stdout.readline()
|
while lListenBool:
|
||||||
if tmp == b"":
|
tmp = proc.stdout.readline()
|
||||||
lListenBool = False
|
if tmp == b"":
|
||||||
#tmp = proc.stdout
|
lListenBool = False
|
||||||
#print(tmp)
|
#tmp = proc.stdout
|
||||||
print(tmp.decode("cp866"))
|
#print(tmp)
|
||||||
print("Happy end")
|
print(tmp.decode("cp866"))
|
||||||
|
print("Happy end")
|
||||||
|
|
||||||
|
def merge(a, b, path=None):
|
||||||
|
"merges b into a"
|
||||||
|
if path is None: path = []
|
||||||
|
for key in b:
|
||||||
|
if key in a:
|
||||||
|
if isinstance(a[key], dict) and isinstance(b[key], dict):
|
||||||
|
merge(a[key], b[key], path + [str(key)])
|
||||||
|
elif a[key] == b[key]:
|
||||||
|
pass # same leaf value
|
||||||
|
else:
|
||||||
|
raise Exception('Conflict at %s' % '.'.join(path + [str(key)]))
|
||||||
|
else:
|
||||||
|
a[key] = b[key]
|
||||||
|
return a
|
||||||
|
|
||||||
|
# works
|
||||||
|
#print(merge({1:{"a":"A"},2:{"b":"B"}}, {2:{"c":"C"},3:{"d":"D"}}))
|
||||||
|
# has conflict
|
||||||
|
#merge({1:{"a":"A"},2:{"b":"B"}}, {1:{"a":"A"},2:{"u":"C"}})
|
||||||
|
|
||||||
|
lUACClientDictOld = {
|
||||||
|
"pyOpenRPADict": {
|
||||||
|
"CPKeyDict": { # Empty dict - all access
|
||||||
|
"yy":1,
|
||||||
|
"Test":12
|
||||||
|
# "CPKeyStr"{
|
||||||
|
# }
|
||||||
|
},
|
||||||
|
"RDPKeyDict": { # Empty dict - all access
|
||||||
|
# "RDPKeyStr"{
|
||||||
|
# "FullscreenBool": True,
|
||||||
|
# "IgnoreBool":True,
|
||||||
|
# "ReconnectBool": True
|
||||||
|
# "NothingBool": True # USe option if you dont want to give some access to the RDP controls
|
||||||
|
# }
|
||||||
|
},
|
||||||
|
"AgentKeyDict": { # Empty dict - all access
|
||||||
|
# "AgentKeyStr"{
|
||||||
|
# }
|
||||||
|
},
|
||||||
|
"AdminDict": { # Empty dict - all access
|
||||||
|
"LogViewerBool": True, # Show log viewer on the web page
|
||||||
|
"CMDInputBool": True, # Execute CMD on the server side and result to the logs
|
||||||
|
"ScreenshotViewerBool": True, # Show button to look screenshots
|
||||||
|
"RestartOrchestratorBool": True, # Restart orchestrator activity
|
||||||
|
"RestartOrchestratorGITPullBool": True, # Turn off (RDP remember) orc + git pull + Turn on (rdp remember)
|
||||||
|
"RestartPCBool": True, # Send CMD to restart pc
|
||||||
|
"NothingBool": True # USe option if you dont want to give some access to the RDP controls
|
||||||
|
},
|
||||||
|
"ActivityDict": { # Empty dict - all access
|
||||||
|
"ActivityListExecuteBool": True, # Execute activity at the current thread
|
||||||
|
"ActivityListAppendProcessorQueueBool": True # Append activity to the processor queue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
lUACClientDictNew = {
|
||||||
|
"pyOpenRPADict": {
|
||||||
|
"CPKeyDict": { # Empty dict - all access
|
||||||
|
"Test":True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print(merge(lUACClientDictOld, lUACClientDictNew))
|
Loading…
Reference in new issue