This commit is contained in:
Amber 2024-06-12 16:30:08 +02:00
parent e399f2e9f9
commit a9f0394696
6 changed files with 31 additions and 17 deletions

View File

@ -19,7 +19,7 @@ def downLoadFile(sftp, remotePath, localPath):
sftp.get(fileattr.filename, os.path.join(localPath, fileattr.filename))
'''
class SyncAgent(BaseAgent):
class SftpClientAgent(BaseAgent):
'''
it give to you a sftp client for using to compute remote hash
and basic ftp command to synchronize local and remote

View File

@ -9,14 +9,14 @@ import gzip
import asyncio
import functools
from lib.sclient.agent import SyncAgent
from lib.sclient.agent import SftpClientAgent
class RHAgent():
def __init__(self, hostname, username):
## load ssh config and read the ip of hostname
self.hostname = hostname
self.username = username
self.agent = SyncAgent(hostname, username)
self.agent = SftpClientAgent(hostname, username)
def get_sftp_client():
a = self.agent

28
src/project_structure.txt Normal file
View File

@ -0,0 +1,28 @@
.
├─ project_structure.txt
├─ testing
│ ├─ diff_snap.py
│ └─ sync.py
├─ lib
│ ├─ sclient
│ │ ├─ agent.py
│ │ └─ base_agent.py
│ ├─ snapshot
│ │ ├─ generate
│ │ │ ├─ remote.py
│ │ │ └─ local.py
│ │ └─ dump.py
│ └─ diff
│ ├─ mdiff.py
│ └─ fdiff.py
├─ tools
│ ├─ pretty_print.py
│ ├─ tree_repr.py
│ └─ parse_conf.py
├─ iface
│ ├─ snap.py
│ ├─ sync
│ └─ sync_manager.py
├─ masync.py
└─ conf
└─ snapshot.conf

View File

@ -1,14 +0,0 @@
src
├── lib - contains low level libraries
│ │
│ │
│ ├── snapshot - libraries for generating, dumping and read snapshot
│ │ │
│ │ ├── generate - dump the snapshot
│ │ │
│ │ │
│ └── dump.py - dump the snapshot
└── iface
└──snap.py - Interface to low level library