1
from twisted.internet import glib2reactor
3
import twisted.internet.reactor
4
import cimple.core.storage.replication.http
5
import cimple.core.storage.purger
13
self.replication = cimple.core.storage.replication.http.ReplicationServer()
14
self.__start_httpd(self.replication.port)
15
self.replication.device_manager.register_device(self.replication.port)
16
self.store_purger = cimple.core.storage.purger.Purger(cimple.core.config.store_dir(), is_cache=False)
17
self.replication.advertiser.start()
18
#pylint: disable-msg=E1101
19
twisted.internet.reactor.run()
21
def __start_httpd(self, port):
22
port_path = os.path.join(os.environ['HOME'], '.env', 'REPLICATION_PORT')
23
handle = open(port_path, 'w')
24
handle.write(str(port))
26
print commands.getoutput("svc -t " + os.path.join(os.environ['HOME'], '.svscan', 'publicfile'))
31
if __name__ == "__main__":