feat(glob,nk): old files/dirs remove

This commit is contained in:
Jakub Jezek 2020-03-04 15:09:02 +01:00
parent 083d184250
commit a22ca26655
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
17 changed files with 0 additions and 940 deletions

View file

@ -1,54 +0,0 @@
'''
Simple socket server using threads
'''
import socket
import sys
import threading
import StringIO
import contextlib
import nuke
HOST = ''
PORT = 8888
@contextlib.contextmanager
def stdoutIO(stdout=None):
old = sys.stdout
if stdout is None:
stdout = StringIO.StringIO()
sys.stdout = stdout
yield stdout
sys.stdout = old
def _exec(data):
with stdoutIO() as s:
exec(data)
return s.getvalue()
def server_start():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(5)
while 1:
client, address = s.accept()
try:
data = client.recv(4096)
if data:
result = nuke.executeInMainThreadWithResult(_exec, args=(data))
client.send(str(result))
except SystemExit:
result = self.encode('SERVER: Shutting down...')
client.send(str(result))
raise
finally:
client.close()
t = threading.Thread(None, server_start)
t.setDaemon(True)
t.start()

View file

@ -1,6 +1,5 @@
import os
import sys
import atom_server
import KnobScripter
from pype.nuke.lib import (