qutebrowser profile manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

some types

+7 -7
+3 -3
qbpm/main.py
··· 13 13 DEFAULT_PROFILE_DIR = Path(BaseDirectory.xdg_data_home) / "qutebrowser-profiles" 14 14 15 15 16 - def main(mock_args=None) -> None: 16 + def main(mock_args: Optional[list[str]] = None) -> None: 17 17 parser = argparse.ArgumentParser(description="qutebrowser profile manager") 18 18 parser.set_defaults(operation=lambda args: parser.print_help(), passthrough=False) 19 19 parser.add_argument( ··· 154 154 155 155 156 156 class ThenLaunchAction(argparse.Action): 157 - def __init__(self, option_strings, dest, nargs=0, **kwargs): 157 + def __init__(self, option_strings, dest, nargs=0, **kwargs) -> None: 158 158 super(ThenLaunchAction, self).__init__( 159 159 option_strings, dest, nargs=nargs, **kwargs 160 160 ) 161 161 162 - def __call__(self, parser, namespace, values, option_string=None): 162 + def __call__(self, parser, namespace, values, option_string=None) -> None: 163 163 setattr(namespace, "passthrough", True) 164 164 if operation := getattr(namespace, self.dest): 165 165 setattr(namespace, self.dest, lambda args: then_launch(args, operation))
+1 -1
qbpm/operations.py
··· 127 127 return True 128 128 129 129 130 - def menu_command(menu: str, profiles, args: argparse.Namespace) -> str: 130 + def menu_command(menu: str, profiles: List[str], args: argparse.Namespace) -> str: 131 131 arg_string = " ".join(args.qb_args) 132 132 if menu == "applescript": 133 133 profile_list = '", "'.join(profiles)
+3 -3
qbpm/profiles.py
··· 1 1 from functools import partial 2 2 from pathlib import Path 3 3 from sys import platform 4 - from typing import List, Optional 4 + from typing import Optional 5 5 6 6 from xdg import BaseDirectory # type: ignore 7 7 from xdg.DesktopEntry import DesktopEntry # type: ignore ··· 42 42 def exists(self) -> bool: 43 43 return self.root.exists() and self.root.is_dir() 44 44 45 - def cmdline(self) -> List[str]: 45 + def cmdline(self) -> list[str]: 46 46 macos_app = "/Applications/qutebrowser.app/Contents/MacOS/qutebrowser" 47 47 if platform == "darwin" and Path(macos_app).exists(): 48 48 qb = macos_app ··· 94 94 application_dir = Path(BaseDirectory.xdg_data_home) / "applications" / "qbpm" 95 95 96 96 97 - def create_desktop_file(profile: Profile): 97 + def create_desktop_file(profile: Profile) -> None: 98 98 desktop = DesktopEntry(str(application_dir / f"{profile.name}.desktop")) 99 99 desktop.set("Name", f"{profile.name} (qutebrowser profile)") 100 100 # TODO allow passing in an icon value