from __future__ import print_function

import sys
sys.path.insert(0, '..')

from pandaemonium import Daemon
import time

class Test(Daemon):
    def run(self):
        while True:
            print(time.time())
            time.sleep(5)

if __name__ == '__main__':
    daemon = Test(stdout=open('test.log', 'w'), pid_file='/usr/local/share/python/pandaemonium/test_pid')
    with daemon:
        print('still testing context managing')
