diff --git a/simplesvnbrowser/__init__.py b/simplesvnbrowser/__init__.py index 3439a8c..7cf09a2 100644 --- a/simplesvnbrowser/__init__.py +++ b/simplesvnbrowser/__init__.py @@ -1,9 +1,3 @@ -from simplesvnbrowser.main_window import MainWindow -import subprocess - -def run_svn(args): - completed_process = subprocess.run( - ["svn", "--non-interactive"] + args, - stdout = subprocess.PIPE, - stderr = subprocess.PIPE) - return completed_process.stdout.decode(), completed_process.stderr.decode() +from .main_window import MainWindow +from .run_svn import run_svn +from .version import VERSION diff --git a/simplesvnbrowser/cli.py b/simplesvnbrowser/cli.py index 599a3a3..2b531d5 100644 --- a/simplesvnbrowser/cli.py +++ b/simplesvnbrowser/cli.py @@ -11,7 +11,8 @@ def run(argv): wc_path = argv[1] if url is None: url = determine_url_from_wc(wc_path) - # TODO: start with url + mw = simplesvnbrowser.MainWindow(url) + mw.run() def determine_url_from_wc(path): stdout, _ = simplesvnbrowser.run_svn(["info", path]) diff --git a/simplesvnbrowser/main_window.py b/simplesvnbrowser/main_window.py index 1c2840e..6f47415 100644 --- a/simplesvnbrowser/main_window.py +++ b/simplesvnbrowser/main_window.py @@ -1,3 +1,18 @@ -class MainWindow: - def __init__(self): - pass +import gi +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk +from .version import VERSION +from .run_svn import run_svn + +class MainWindow(Gtk.Window): + def __init__(self, url): + super().__init__(title = "Simple SVN Browser v%s" % VERSION) + + button = Gtk.Button(label = "content") + self.add(button) + + self.connect("delete-event", Gtk.main_quit) + self.show_all() + + def run(self): + Gtk.main() diff --git a/simplesvnbrowser/run_svn.py b/simplesvnbrowser/run_svn.py new file mode 100644 index 0000000..c109aa2 --- /dev/null +++ b/simplesvnbrowser/run_svn.py @@ -0,0 +1,8 @@ +import subprocess + +def run_svn(args): + completed_process = subprocess.run( + ["svn", "--non-interactive"] + args, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE) + return completed_process.stdout.decode(), completed_process.stderr.decode() diff --git a/simplesvnbrowser/version.py b/simplesvnbrowser/version.py new file mode 100644 index 0000000..901e511 --- /dev/null +++ b/simplesvnbrowser/version.py @@ -0,0 +1 @@ +VERSION = "0.0.1"