usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.53k stars 592 forks source link

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

Open Lvl4Sword opened 10 months ago

Lvl4Sword commented 10 months ago

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.

usmannasir commented 10 months ago

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

Lvl4Sword commented 10 months ago

@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.

usmannasir commented 10 months ago

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