Skip to content

Conversation

@Cyber-Syntax
Copy link
Owner

add command, facade patterns
increase security on openssl command

@Cyber-Syntax Cyber-Syntax self-assigned this Mar 1, 2025
@Cyber-Syntax
Copy link
Owner Author

@CodiumAI-Agent /improve --pr_code_suggestions.commitable_code_suggestions=true

Comment on lines 453 to 457
# HACK: Use ContextManager class to pass _password_context and _safe_cleanup methods
# TODO: Is there a better way to handle this?
# NOTE: Python’s garbage collector or internal caching might still have copies elsewhere??
# TODO: mmap or mlock, cryptography, ctypes, or C extension for better memory handling
class ContextManager:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Initialize a logger in the ContextManager to prevent attribute errors in _password_context. [possible issue, importance: 8]

Suggested change
# HACK: Use ContextManager class to pass _password_context and _safe_cleanup methods
# TODO: Is there a better way to handle this?
# NOTE: Python’s garbage collector or internal caching might still have copies elsewhere??
# TODO: mmap or mlock, cryptography, ctypes, or C extension for better memory handling
class ContextManager:
class ContextManager:
def __init__(self):
self.logger = logging.getLogger(__name__)
@contextmanager
def _password_context(self):
try:
password = getpass.getpass("Enter file encryption password: ")
if not password:
self.logger.error("Empty password rejected")
yield None
return
password_bytes = bytearray(password.encode("utf-8"))
yield password_bytes.decode("utf-8")
finally:
if "password_bytes" in locals():
for i in range(len(password_bytes)):
password_bytes[i] = 0
password_bytes = None
del password_bytes

Comment on lines 135 to 155
def _show_spinner(self):
spinner = itertools.cycle(["/", "-", "\\", "|"])
start_time = time.time()

def run_spinner():
while not hasattr(self, "process_complete"):
sys.stdout.write(next(spinner) + " ")
sys.stdout.flush()
sys.stdout.write("\b\b")
time.sleep(0.1)

spinner_thread = threading.Thread(target=run_spinner)
spinner_thread.start()

# Simulated process - replace with actual process monitoring
try:
subprocess.run(cmd, shell=True, check=True)
finally:
self.process_complete = True
spinner_thread.join()
sys.stdout.write("\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Refactor the spinner in BackupCommand to remove the duplicate subprocess.run call and resolve the undefined variable "cmd". [possible issue, importance: 8]

Suggested change
def _show_spinner(self):
spinner = itertools.cycle(["/", "-", "\\", "|"])
start_time = time.time()
def run_spinner():
while not hasattr(self, "process_complete"):
sys.stdout.write(next(spinner) + " ")
sys.stdout.flush()
sys.stdout.write("\b\b")
time.sleep(0.1)
spinner_thread = threading.Thread(target=run_spinner)
spinner_thread.start()
# Simulated process - replace with actual process monitoring
try:
subprocess.run(cmd, shell=True, check=True)
finally:
self.process_complete = True
spinner_thread.join()
sys.stdout.write("\n")
def _show_spinner(self, process):
spinner = itertools.cycle(["/", "-", "\\", "|"])
while process.poll() is None:
sys.stdout.write(next(spinner) + " ")
sys.stdout.flush()
sys.stdout.write("\b\b")
time.sleep(0.1)

refactor calculation class and outputs
- add github action for releases
- add copilot instructions for python
# BREAKING CHANGES:
Current config file location moved to `~/.config/autotarcompress/config.json`. Please review example config file and update it for your needs.

- Update example config file paths to reflect new structure.
- Enhance BackupConfig class to include config verification and improved documentation.
@Cyber-Syntax Cyber-Syntax merged commit 98b63f2 into main Apr 13, 2025
@Cyber-Syntax Cyber-Syntax deleted the refactor/design-pattern branch April 13, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants