break up package a little bit; start on MainWindow
This commit is contained in:
parent
725e241984
commit
2cb8bbece1
@ -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
|
||||
|
@ -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])
|
||||
|
@ -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()
|
||||
|
8
simplesvnbrowser/run_svn.py
Normal file
8
simplesvnbrowser/run_svn.py
Normal file
@ -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()
|
1
simplesvnbrowser/version.py
Normal file
1
simplesvnbrowser/version.py
Normal file
@ -0,0 +1 @@
|
||||
VERSION = "0.0.1"
|
Loading…
x
Reference in New Issue
Block a user