tchx84 / Portfolio

A minimalist file manager for those who want to use Linux mobile devices.
GNU General Public License v3.0
94 stars 23 forks source link

trash: Handle permissions-restricted mounts #200

Closed tchx84 closed 3 years ago

tchx84 commented 3 years ago

Closes #199

tchx84 commented 3 years ago

Ignore the CI error, it seems unrelated to contents of this PR.

Danct12 commented 3 years ago

Tested, now it makes a trash can in /boot.

Traceback (most recent call last):
  File "/usr/bin/dev.tchx84.Portfolio", line 40, in <module>
    from portfolio import main
  File "/usr/lib/python3.9/site-packages/portfolio/main.py", line 28, in <module>
    from .window import PortfolioWindow
  File "/usr/lib/python3.9/site-packages/portfolio/window.py", line 29, in <module>
    from .worker import PortfolioCutWorker
  File "/usr/lib/python3.9/site-packages/portfolio/worker.py", line 30, in <module>
    from .trash import default_trash
  File "/usr/lib/python3.9/site-packages/portfolio/trash.py", line 182, in <module>
    default_trash = PortfolioTrash()
  File "/usr/lib/python3.9/site-packages/portfolio/trash.py", line 43, in __init__
    self.setup()
  File "/usr/lib/python3.9/site-packages/portfolio/trash.py", line 57, in setup
    self._setup_trash_dir(trash_dir)
  File "/usr/lib/python3.9/site-packages/portfolio/trash.py", line 46, in _setup_trash_dir
    os.makedirs(os.path.join(trash_dir, "info"), exist_ok=True)
  File "/usr/lib/python3.9/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.9/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/boot/.Trash-1000'
tchx84 commented 3 years ago

arg, thanks for testing ill try something more elaborated tonight.

tchx84 commented 3 years ago

@Danct12 can you update branch and test again? :pray:

Danct12 commented 3 years ago

Hi. I tested your latest patch and now the application finally launched.

Tested out the trash can as well and it works.

tchx84 commented 3 years ago

Hi. I tested your latest patch and now the application finally launched.

Tested out the trash can as well and it works.

Thanks, ill need to work on this a bit more, but will keep you posted.

tchx84 commented 3 years ago

@Danct12 there are other details I will improve but this should be good enough.

Danct12 commented 3 years ago

Thank you very much!

tchx84 commented 3 years ago

@henry-nicolas @craftyguy in case you're experiencing the same issue, this fix is small enough for a pkg patch.

Ill improve a few more things and make a new release tomorrow or Saturday.