Update of /cvsroot/btplusplus/BT++/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4449/src
Added Files:
BTConstants.py WT++.py
Log Message:
WebServer & Completed abstraction of LoaderManager
--- NEW FILE: BTConstants.py ---
false = 0
true = 1
LOG_TRIVIAL = 0
LOG_INFO = 1
LOG_ERROR = 2
LOG_CRITICAL = 3
--- NEW FILE: WT++.py ---
#!/usr/bin/python
from sys import argv, version, exit
from os import path, chdir
from shutil import copyfile
from ConfigFile import Config
from WebServer.BTWebServer import BTWebServer, BTWait
from threading import *
assert version >= '2', "Install Python 2.0 or greater"
if __name__ == '__main__':
# Change to the directory of BT++
chdir(
path.abspath(
path.dirname(argv[0])
)
)
# Copy torrent file
if len(argv) == 2:
try:
copyfile(argv[1], path.join(Config.Get('Paths', 'Torrent'), path.split(argv[1])[1]))
except:
pass
print ("Started")
httpd = BTWebServer()
httpdth = Thread(target = httpd.server)
httpdth.setDaemon(1)
httpdth.start()
BTWait.wait()
|