diff options
author | Karl Semich <0xloem@gmail.com> | 2016-08-27 06:20:06 -0400 |
---|---|---|
committer | Karl Semich <0xloem@gmail.com> | 2016-08-27 06:20:06 -0400 |
commit | 75a2cc7acb5a2a83dae172003b13729baf2e2756 (patch) | |
tree | 951701daedbae3cb3f6f43ad963da0eed5bb5ee0 /backend/resilient | |
parent | 682ab0b0ddf2ec4de8742a011e29f023c2a03990 (diff) | |
download | standingwithresilience-75a2cc7acb5a2a83dae172003b13729baf2e2756.tar.gz standingwithresilience-75a2cc7acb5a2a83dae172003b13729baf2e2756.zip |
added pyFreenet as a submodule
Diffstat (limited to 'backend/resilient')
-rw-r--r-- | backend/resilient/__init__.py | 4 | ||||
-rw-r--r-- | backend/resilient/freenet.py | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/backend/resilient/__init__.py b/backend/resilient/__init__.py index 818a6f5..fca9441 100644 --- a/backend/resilient/__init__.py +++ b/backend/resilient/__init__.py @@ -11,6 +11,7 @@ __all__ = ["freenet"] backend_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) auth_path = os.path.join(backend_path, 'auth') +dep_path = os.path.join(backend_path, 'dep') html_path = os.path.normpath(os.path.join(backend_path, '../html')) wiki_src_path = os.path.normpath(os.path.join(backend_path, '../wiki')) ikiwiki_setup_path = os.path.join(backend_path, 'ikiwiki.setup') @@ -35,6 +36,9 @@ class git: if not found: print("ERROR: git not found") exit(1) + else: + os.system("git submodule init") + os.system("git submodule update") def __init__(self, remote, push_remote = ""): self.remote = remote diff --git a/backend/resilient/freenet.py b/backend/resilient/freenet.py index 92affef..76ee33d 100644 --- a/backend/resilient/freenet.py +++ b/backend/resilient/freenet.py @@ -1,4 +1,4 @@ -from resilient import auth_path, git, ikiwiki, url200 +from resilient import auth_path, dep_path, git, ikiwiki, url200 import os running = url200('http://127.0.0.1:8888/') @@ -11,9 +11,13 @@ class gitocalypse(git): print("WARNING: gitocalypse not found, changes won't be synced with freenet") class freesitemgr(): - found = (os.system("freesitemgr --version") == 0) + binary = "freesitemgr" + found = (os.system("%s --version" % binary) == 0) if not found: - print("WARNING: freesitemgr/pyFreenet not found, public freesite won't be updated") + binary = "%s/pyFreenet/freesitemgr" % dep_path + found = (os.system("%s --version" % binary) == 0) + if not found: + print("WARNING: freesitemgr/pyFreenet not found. freesite won't be updated") def __init__(self): pass @@ -22,5 +26,5 @@ class freesitemgr(): if not ikiwiki.synced or not freesitemgr.found or not running: return False config_path = os.path.join(auth_path, 'freesitemgr') - status = os.system("freesitemgr -c '%s' -v -r 1 update" % config_path) + status = os.system("%s -c '%s' -v -r 1 update" % (freesitemgr.binary, config_path)) return status == 0 |