Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Example 84: Supply an optional root_dir parameter so that the app can…

… be run from __main__ and main.py
commit 4bb02bc906479662ee3948977180f1e9da2650fd 1 parent 1dce47b
@buchuki authored
Showing with 6 additions and 5 deletions.
  1. +1 −1  orkiv/__main__.py
  2. +4 −3 orkiv/main.py
  3. +1 −1  orkiv/orkiv.kv
View
2  orkiv/__main__.py
@@ -1,2 +1,2 @@
from main import main
-main()
+main("orkiv/")
View
7 orkiv/main.py
@@ -217,8 +217,9 @@ def on_mode(self, widget, mode):
class Orkiv(App):
- def __init__(self):
+ def __init__(self, root_dir):
super(Orkiv, self).__init__()
+ self.root_dir = root_dir
self.xmpp = None
def connect_to_jabber(self, jabber_id, password):
@@ -241,8 +242,8 @@ def on_stop(self):
self.disconnect_xmpp()
-def main():
- Orkiv().run()
+def main(root_dir=""):
+ Orkiv(root_dir).run()
if __name__ == "__main__":
main()
View
2  orkiv/orkiv.kv
@@ -65,7 +65,7 @@ OrkivRoot:
Label:
text: root.full_name
Image:
- source: "icons/" + root.online_status + ".png"
+ source: app.root_dir + "icons/" + root.online_status + ".png"
<BuddyList>:

0 comments on commit 4bb02bc

Please sign in to comment.
Something went wrong with that request. Please try again.