Merge branch 'testing' bug fix for remoteDriver
This commit is contained in:
commit
f18c31df6c
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ dist/
|
|||||||
build/
|
build/
|
||||||
*.kate-swp
|
*.kate-swp
|
||||||
.directory
|
.directory
|
||||||
|
CLAUDE.md
|
||||||
|
@ -79,10 +79,12 @@ class command():
|
|||||||
# Pattern 1b: Time/token activity (not percentage-based, so use single beep)
|
# Pattern 1b: Time/token activity (not percentage-based, so use single beep)
|
||||||
timeMatch = re.search(r'(\d+)s\s', text)
|
timeMatch = re.search(r'(\d+)s\s', text)
|
||||||
tokenMatch = re.search(r'(\d+)\s+tokens', text)
|
tokenMatch = re.search(r'(\d+)\s+tokens', text)
|
||||||
# Pattern 1c: Curl-style transfer data (bytes, speed indicators)
|
# Pattern 1c: dd command output (bytes copied with transfer rate)
|
||||||
|
ddMatch = re.search(r'\d+\s+bytes.*copied.*\d+\s+s.*[kMGT]?B/s', text)
|
||||||
|
# Pattern 1d: Curl-style transfer data (bytes, speed indicators)
|
||||||
curlMatch = re.search(r'(\d+\s+\d+\s+\d+\s+\d+.*?(?:k|M|G)?.*?--:--:--|Speed)', text)
|
curlMatch = re.search(r'(\d+\s+\d+\s+\d+\s+\d+.*?(?:k|M|G)?.*?--:--:--|Speed)', text)
|
||||||
|
|
||||||
if timeMatch or tokenMatch or curlMatch:
|
if timeMatch or tokenMatch or ddMatch or curlMatch:
|
||||||
# For non-percentage progress, use a single activity beep every 2 seconds
|
# For non-percentage progress, use a single activity beep every 2 seconds
|
||||||
if currentTime - self.env['commandBuffer']['lastProgressTime'] >= 2.0:
|
if currentTime - self.env['commandBuffer']['lastProgressTime'] >= 2.0:
|
||||||
self.env['runtime']['debug'].writeDebugOut("Playing activity beep for transfer progress", debug.debugLevel.INFO)
|
self.env['runtime']['debug'].writeDebugOut("Playing activity beep for transfer progress", debug.debugLevel.INFO)
|
||||||
|
@ -45,28 +45,17 @@ class driver(remoteDriver):
|
|||||||
continue
|
continue
|
||||||
if self.fenrirSock in r:
|
if self.fenrirSock in r:
|
||||||
client_sock, client_addr = self.fenrirSock.accept()
|
client_sock, client_addr = self.fenrirSock.accept()
|
||||||
response = "ERROR: Failed to process command\n"
|
|
||||||
try:
|
try:
|
||||||
rawdata = client_sock.recv(8129)
|
rawdata = client_sock.recv(8129)
|
||||||
data = rawdata.decode("utf-8").rstrip().lstrip()
|
|
||||||
if data:
|
|
||||||
# Process the command and get response
|
|
||||||
result = self.env['runtime']['remoteManager'].handleRemoteIncommingWithResponse(data)
|
|
||||||
if result['success']:
|
|
||||||
response = f"OK: {result['message']}\n"
|
|
||||||
else:
|
|
||||||
response = f"ERROR: {result['message']}\n"
|
|
||||||
else:
|
|
||||||
response = "ERROR: Empty command\n"
|
|
||||||
except Exception as e:
|
|
||||||
response = f"ERROR: {str(e)}\n"
|
|
||||||
|
|
||||||
# Send response back to client
|
|
||||||
try:
|
|
||||||
client_sock.send(response.encode("utf-8"))
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
data = rawdata.decode("utf-8").rstrip().lstrip()
|
||||||
|
eventQueue.put({"Type":fenrirEventType.RemoteIncomming,
|
||||||
|
"Data": data
|
||||||
|
})
|
||||||
|
except:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
client_sock.close()
|
client_sock.close()
|
||||||
except:
|
except:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user