Files
hostpanel/ssh_manager/ssh_manager.py
ilkeral 342f1314c7 yeni
2025-07-21 13:49:36 +03:00

19 lines
574 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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