messages and merge

This commit is contained in:
Rushabh Mehta 2012-02-28 17:44:19 +05:30
commit dedb766d97
5 changed files with 27 additions and 11 deletions

View file

@ -1234,8 +1234,8 @@ _f.ButtonField.prototype.make_input = function() { var me = this;
// make the input
this.input = $btn(this.button_area,
me.df.label.substr(0,20) + ((me.df.label.length>20) ? '..' : ''), null,
{maxWidth:'170px', fontWeight:'bold'}, null, 1)
me.df.label, null,
{fontWeight:'bold'}, null, 1)
this.input.onclick = function() {
if(me.not_in_form) return;

View file

@ -106,7 +106,7 @@ _f.Grid.prototype.insert_column = function(doctype, fieldname, fieldtype, label,
col.doctype = doctype; // for report (fields may be from diff doctypes)
col.fieldname = fieldname;
col.fieldtype = fieldtype;
col.innerHTML = '<div>'+label+'</div>';
col.innerHTML = '<div data-grid-fieldname = "'+doctype+'-'+fieldname+'">'+label+'</div>';
col.label = label;
if(reqd)
col.childNodes[0].style.color = "#D22";

View file

@ -64,6 +64,12 @@ class UnknownDomainError(Exception):
self.value = value
def __str__(self):
return repr(self.value)
class SessionStopped(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def getTraceback():
import utils

View file

@ -60,7 +60,12 @@ class HTTPRequest:
# check status
if webnotes.conn.get_global("__session_status")=='stop':
webnotes.msgprint(webnotes.conn.get_global("__session_status_message"))
<<<<<<< HEAD
raise Exception
=======
raise webnotes.SessionStopped('Session Stopped')
#raise webnotes.ValidationError(webnotes.conn.get_global("__session_status_message"))
>>>>>>> fe327620e090d5a47a431a3ed8cc8e9aa0345672
# write out cookies if sid is supplied (this is a pre-logged in redirect)
if webnotes.form_dict.get('sid'):

View file

@ -67,6 +67,9 @@ def execute():
if now.weekday()==0:
out.append('weekly:' + trigger('execute_weekly'))
if now.hour != last.hour:
out.append('hourly:' + trigger('execute_hourly'))
out.append('all:' + trigger('execute_all'))
webnotes.conn.set_global('scheduler_last_event', nowtime.strftime(format))
@ -85,16 +88,18 @@ def trigger(method):
return 'ok'
except Exception, e:
webnotes.conn.rollback()
traceback = webnotes.getTraceback()
log(method, traceback)
return traceback
def log(method, error):
return log(method)
def log(method):
"""log error in patch_log"""
webnotes.conn.rollback()
traceback = webnotes.getTraceback()
import webnotes.utils
webnotes.conn.sql("""insert into __SchedulerLog (`timestamp`, method, error)
values (%s, %s, %s)""", (webnotes.utils.now_datetime(), method, error))
values (%s, %s, %s)""", (webnotes.utils.now_datetime(), method, traceback))
return traceback
if __name__=='__main__':
execute()