202508311715
parent
1c196bef06
commit
826d2e589c
|
@ -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()
|
|
@ -0,0 +1 @@
|
|||
#!/usr/bin/python3
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
class InitialisationError(Exception):
|
||||
pass
|
|
@ -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()
|
Loading…
Reference in New Issue