~pvsr/qpm

762b429a05c0d081856493f1855dc63b5cd0988e — Peter Rice 3 months ago f60479f
readd list

closes #14
2 files changed, 14 insertions(+), 0 deletions(-)

M qpm/main.py
M qpm/operations.py
M qpm/main.py => qpm/main.py +3 -0
@@ 64,6 64,9 @@ def main() -> None:
        help="launch qutebrowser in the foreground and print its stdout and stderr to the console",
    )

    list_ = subparsers.add_parser("list", help="list existing qutebrowser profiles")
    list_.set_defaults(operation=lambda args: operations.list_())

    raw_args = parser.parse_known_args()
    args = raw_args[0]
    args.qb_args = raw_args[1]

M qpm/operations.py => qpm/operations.py +11 -0
@@ 1,8 1,11 @@
import os
import shutil
import subprocess
from pathlib import Path
from typing import Iterable, Optional

from xdg import BaseDirectory

from qpm import profiles
from qpm.profiles import Profile
from qpm.utils import error


@@ 49,3 52,11 @@ def launch(
            pass

    return True


DEFAULT_PROFILE_DIR = Path(BaseDirectory.xdg_data_home) / "qutebrowser-profiles"


def list_() -> None:
    for profile in DEFAULT_PROFILE_DIR.iterdir():
        print(profile.name)