Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tray/GUI support #4

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions assets/logo_base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
154 changes: 154 additions & 0 deletions assets/logo_error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ./derivation.nix {}
{ libsForQt5 ? import <nixpkgs> {} }:
libsForQt5.callPackage ./derivation.nix {}
18 changes: 12 additions & 6 deletions derivation.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{ lib, pkgs, python38Packages }:
{ lib, pkgs, python3Packages, qt5 }:

with python38Packages;
with python3Packages;

buildPythonApplication rec {
pname = "rs3fc";
version = "1.0.7";
pname = "rs3fc";
version = "1.0.7";

nativeBuildInputs = [ pkgs.sshfs pkgs.gocryptfs ];
src = ./.;

src = ./.;
buildInputs = [pkgs.sshfs pkgs.gettext];
propagatedBuildInputs = [ pyqt5 secretstorage ];
nativeBuildInputs = [ qt5.wrapQtAppsHook ];

preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
}
9 changes: 8 additions & 1 deletion rs3f/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import hashlib
import logging
import os
import re
import socket
import subprocess
from typing import Callable, Optional, Union
Expand All @@ -39,6 +40,12 @@
logger = logging.getLogger("rs3f")
logger.setLevel(logging.DEBUG)

# TODO needs to be more restrictive on the server extraction, but this isn't
# meant to be foolproof
RE_VOLUME = re.compile(
r"^(?P<volume>[a-z_][a-zA-Z0-9_-]{0,31})(@(?P<server>[^:@/]+?)(:(?P<port>\d{1,5}))?)?$"
)


class RS3FRuntimeError(RuntimeError):
"""Base runtime error class for all rs3f errors."""
Expand Down Expand Up @@ -161,7 +168,7 @@ def _get_remote_uid(target_user: str, server: str, port: Optional[int]) -> int:
+ (
[
"-P",
port,
str(port),
]
if port is not None
else []
Expand Down
9 changes: 1 addition & 8 deletions rs3fc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,14 @@
from configparser import ConfigParser
import logging
import os
import re
import sys
from typing import Optional

from rs3f import __version__, connect, disconnect, RS3FRuntimeError
from rs3f import __version__, connect, disconnect, RS3FRuntimeError, RE_VOLUME

from .passwordfetchers import fetch_password, get_default_fetchers_order


# TODO needs to be more restrictive on the server extraction, but this isn't
# meant to be foolproof
RE_VOLUME = re.compile(
r"^(?P<volume>[a-z_][a-zA-Z0-9_-]{0,31})(@(?P<server>[^:@/]+?)(:(?P<port>\d{1,5}))?)?$"
)

VERBOSE_FORMATTER = logging.Formatter(
"%(levelname)s %(filename)s+%(lineno)d %(funcName)s: %(message)s"
)
Expand Down
Loading