version 0.2.0, new lib for bitcoin ecc, dont display or track notify errors, dont reload again within 1 sec, null peer ip fix, signingmoved to ContentManager, content.json include support, content.json multisig ready, content.json proper bitcoincore compatible signing, content.json include permissions, multithreaded publish, publish timeout 60s, no exception on invalid bitcoin address, testcase for new lib, bip32 based persite privatekey generation, multiuser ready, simple json database query command, websocket api fileGet, wrapper loading title stuck bugfix
This commit is contained in:
parent
cfe2cfaf09
commit
639b9f4961
44 changed files with 4061 additions and 293 deletions
|
@ -1,22 +1,36 @@
|
|||
import gevent, sys
|
||||
from Config import config
|
||||
|
||||
last_error = None
|
||||
|
||||
# Store last error, ignore notify, allow manual error logging
|
||||
def handleError(*args):
|
||||
global last_error
|
||||
if not args: # Called explicitly
|
||||
if not args: # Manual called
|
||||
args = sys.exc_info()
|
||||
silent = True
|
||||
else:
|
||||
silent = False
|
||||
print "Error catched", args
|
||||
last_error = args
|
||||
if not silent and args[0].__name__ != "Notify": sys.__excepthook__(*args)
|
||||
if args[0].__name__ != "Notify": last_error = args
|
||||
if not silent and args[0].__name__ != "Notify":
|
||||
sys.__excepthook__(*args)
|
||||
|
||||
|
||||
# Ignore notify errors
|
||||
def handleErrorNotify(*args):
|
||||
if args[0].__name__ != "Notify": sys.__excepthook__(*args)
|
||||
|
||||
|
||||
OriginalGreenlet = gevent.Greenlet
|
||||
class ErrorhookedGreenlet(OriginalGreenlet):
|
||||
def _report_error(self, exc_info):
|
||||
handleError(exc_info[0], exc_info[1], exc_info[2])
|
||||
|
||||
sys.excepthook = handleError
|
||||
if config.debug:
|
||||
sys.excepthook = handleError
|
||||
else:
|
||||
sys.excepthook = handleErrorNotify
|
||||
|
||||
gevent.Greenlet = gevent.greenlet.Greenlet = ErrorhookedGreenlet
|
||||
reload(gevent)
|
||||
reload(gevent)
|
||||
|
|
|
@ -11,6 +11,7 @@ except Exception, err:
|
|||
|
||||
class DebugReloader:
|
||||
def __init__ (self, callback, directory = "/"):
|
||||
self.last_chaged = 0
|
||||
if pyfilesystem:
|
||||
self.directory = directory
|
||||
self.callback = callback
|
||||
|
@ -29,7 +30,8 @@ class DebugReloader:
|
|||
|
||||
|
||||
def changed(self, evt):
|
||||
if not evt.path or evt.path.endswith("pyc"): return False # Ignore *.pyc changes
|
||||
if not evt.path or evt.path.endswith("pyc") or time.time()-self.last_chaged < 1: return False # Ignore *.pyc changes and no reload within 1 sec
|
||||
#logging.debug("Changed: %s" % evt)
|
||||
time.sleep(0.1) # Wait for lock release
|
||||
self.callback()
|
||||
self.last_chaged = time.time()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue