Compare commits

..

No commits in common. "main" and "5.1.1" have entirely different histories.
main ... 5.1.1

6 changed files with 10 additions and 55 deletions

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='PyserSSH',
version='5.1.4',
version='5.1.1',
license='MIT',
author='DPSoftware Foundation',
author_email='contact@damp11113.xyz',
@ -37,8 +37,7 @@ setup(
"keyboard",
"Brotli",
"pillow",
"numpy",
"opencv-python"
"numpy"
],
}
)

View File

@ -240,14 +240,8 @@ class Server:
if echo:
channel.send(replace_enter_with_crlf(self.client_handlers[channel.getpeername()]["prompt"] + " "))
isConnect = True
while isConnect:
isConnect = expect(self, self.client_handlers[channel.getpeername()], echo)
self._handle_event("disconnected", self.client_handlers[peername])
channel.close()
bh_session.close()
while True:
expect(self, self.client_handlers[channel.getpeername()], echo)
except KeyboardInterrupt:
self._handle_event("disconnected", self.client_handlers[peername])
channel.close()
@ -258,7 +252,6 @@ class Server:
finally:
self._handle_event("disconnected", self.client_handlers[peername])
channel.close()
bh_session.close()
else:
if self.sftpena:
logger.info("user is sftp")

View File

@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
#import serial
import serial
import socket
import paramiko
from abc import ABC, abstractmethod

View File

@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
version = "5.1.4"
version = "5.1.1"
system_banner = (
f"\033[36mPyserSSH V{version} \033[0m"

View File

@ -212,7 +212,8 @@ def expect(self, client, echo=True):
finally:
try:
if not byte:
return False
return True
logger.info(f"{peername} is disconnected")
self._handle_event("disconnected", self.client_handlers[peername])
except:
return False
logger.info(f"{peername} is disconnected")
self._handle_event("disconnected", self.client_handlers[peername])

View File

@ -1,38 +0,0 @@
"""
PyserSSH - A Scriptable SSH server. For more info visit https://github.com/DPSoftware-Foundation/PyserSSH
Copyright (C) 2023-present DPSoftware Foundation (MIT)
Visit https://github.com/DPSoftware-Foundation/PyserSSH
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
"""
note
ansi cursor arrow
up - \x1b[A
down - \x1b[B
left - \x1b[D
right - \x1b[C
https://en.wikipedia.org/wiki/ANSI_escape_code
"""