diff options
author | Karl Semich <0xloem@gmail.com> | 2016-06-09 18:08:08 -0400 |
---|---|---|
committer | Karl Semich <0xloem@gmail.com> | 2016-06-09 18:08:08 -0400 |
commit | 804aa45fbbaf034b09b0f63ebe75630f02b32052 (patch) | |
tree | 20a4b17c529795a18576a104e38a3f9844c09e53 /backend/resilient/freenet.py | |
parent | ab25cea9c6502c6e923860665ee024f1ad0af1a5 (diff) | |
download | standingwithresilience-804aa45fbbaf034b09b0f63ebe75630f02b32052.tar.gz standingwithresilience-804aa45fbbaf034b09b0f63ebe75630f02b32052.zip |
Convert update.py to use more python
Diffstat (limited to 'backend/resilient/freenet.py')
-rw-r--r-- | backend/resilient/freenet.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/backend/resilient/freenet.py b/backend/resilient/freenet.py new file mode 100644 index 0000000..ea72760 --- /dev/null +++ b/backend/resilient/freenet.py @@ -0,0 +1,30 @@ +from resilient import auth_path, git, ikiwiki, url200 +import os + +running = url200('http://127.0.0.1:8888/') +if not running: + print("WARNING: freenet not running, changes won't be synced with freenet") + +class gitocalypse(git): + found = (os.system("git-remote-freenet") == 256) + if not found: + print("WARNING: gitocalypse not found, changes won't be synced with freenet") + + def __init__(self, pull_remote, push_remote = None): + self.remote = pull_remote + self.push_remote = push_remote + +class freesitemgr(): + found = (os.system("freesitemgr --version") == 0) + if not found: + print("WARNING: freesitemgr/pyFreenet not found, public freesite won't be updated") + + def __init__(self): + pass + + def push(self): + if not ikiwiki.synced: + return False + config_path = os.path.join(auth_path, 'freesitemgr') + status = os.system("freesitemgr -c '%s' -v -r 1 update" % config_path) + return status == 0 |