yeni
This commit is contained in:
19
ssh_manager/ssh_manager.py
Normal file
19
ssh_manager/ssh_manager.py
Normal file
@ -0,0 +1,19 @@
|
||||
def read_requirements_file(self, binary=False):
|
||||
"""
|
||||
Requirements dosyasını oku
|
||||
binary=True ise binary modda okur
|
||||
"""
|
||||
try:
|
||||
command = f'cat "{self.project_path}/req.txt"'
|
||||
stdin, stdout, stderr = self.client.exec_command(command)
|
||||
|
||||
if binary:
|
||||
# Binary modda oku
|
||||
return stdout.read()
|
||||
else:
|
||||
# Text modda oku
|
||||
return stdout.read().decode('utf-8', errors='replace')
|
||||
|
||||
except Exception as e:
|
||||
logger.exception("req.txt okunamadı")
|
||||
return None
|
||||
Reference in New Issue
Block a user