cyberpanel icon indicating copy to clipboard operation
cyberpanel copied to clipboard

[Feature] Cleaning up filemanager.py and using pathlib instead

Open Lvl4Sword opened this issue 8 months ago • 3 comments

Describe the feature There's a lot of stuff in filemanager.py that generally doesn't need to be there. Iterating through multiple indexes just isn't a great look, honestly. Pathlib is in the standard library, is designed to work with paths, and will generally make filemanager.py so much more readable.

I plan on working on this. Just putting this here for documentation purposes.

Lvl4Sword avatar Nov 22 '23 19:11 Lvl4Sword

It may not be able to run as user... ?

usmannasir avatar Nov 23 '23 17:11 usmannasir

@usmannasir Why do you say that? Even though both /usr/local/CyberPanel/bin/pip freeze / /usr/local/CyberCP/bin/pip freeze don't show pathlib, you can still run either interpreter and import pathlib works, since pathlib is part of the standard library.

Lvl4Sword avatar Nov 24 '23 15:11 Lvl4Sword

The reason we use commands are to make sure code run as the user.

usmannasir avatar Nov 29 '23 06:11 usmannasir