202508311715

main
Rebel Zhang 2025-08-31 17:15:55 +08:00
parent 1c196bef06
commit 826d2e589c
6 changed files with 42 additions and 0 deletions

0
LICENSE 100644 → 100755
View File

0
README.md 100644 → 100755
View File

18
initialisation.py 100755
View File

@ -0,0 +1,18 @@
#!/usr/bin/python3
import ressenger_exceptions
import pathlib
def initialise(password, username='default', force=False):
profile_path=pathlib.Path('~/.ressenger/').expanduser()
if profile_path.exists():
if (profile_path.is_file() or profile_path.is_symlink()):
if force:
profile_path.unlink()
else:
raise FileExistsError('Cannot create ~/.ressenger/ folder, is a file exists there?')
profile_path.mkdir(parents=True, exist_ok=True)
if __name__=="__main__":
initialise(password=input("Please set up a password for encryption: "))
exit()

View File

@ -0,0 +1 @@
#!/usr/bin/python3

View File

@ -0,0 +1,4 @@
#!/usr/bin/python3
class InitialisationError(Exception):
pass

19
server.py 100755
View File

@ -0,0 +1,19 @@
#!/usr/bin/python3
import socket, pickle, os, pathlib
def start_server(host='localhost', port=5273):
server_socket=socket.socket(socket.AF_INET, socket=SOCK_STREAM)
server_socket.bind((host, port))
server_socket.listen(1)
print(f"Listening on {host}:{port}...")
while True:
client_socket, client_address=server_socket.accept()
def main():
pass
if __name__=="__main__":
main()
exit()