more work on docs
This commit is contained in:
parent
097c57b97a
commit
a69e1d2d72
@ -31,6 +31,7 @@ class Onionr:
|
||||
In general, external programs and plugins should not use this class.
|
||||
|
||||
'''
|
||||
self.runningDaemon = False
|
||||
if os.path.exists('dev-enabled'):
|
||||
print('DEVELOPMENT MODE ENABLED (THIS IS LESS SECURE!)')
|
||||
self._developmentMode = True
|
||||
@ -106,12 +107,17 @@ class Onionr:
|
||||
shutil.rmtree('data/')
|
||||
return
|
||||
def daemon(self):
|
||||
''' Start the Onionr communication daemon
|
||||
'''
|
||||
if not os.environ.get("WERKZEUG_RUN_MAIN") == "true":
|
||||
subprocess.Popen(["./communicator.py", "run"])
|
||||
print('Started communicator')
|
||||
api.API(self.config, self.debug)
|
||||
return
|
||||
def killDaemon(self):
|
||||
if self.runningDaemon == False:
|
||||
onionrUtils.printErr('No known daemon is running')
|
||||
sys.exit(1)
|
||||
return
|
||||
def showStats(self):
|
||||
return
|
||||
|
@ -14,10 +14,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
'''
|
||||
# Misc functions that do not fit in the main api, but are useful
|
||||
import getpass
|
||||
import getpass, sys
|
||||
class OnionrUtils():
|
||||
def __init__(self):
|
||||
return
|
||||
def printErr(self, text='an error occured'):
|
||||
sys.stderr.write(text + '\n')
|
||||
def getPassword(self, message='Enter password: '):
|
||||
# Get a password safely with confirmation and return it
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user