bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def get_bug_list(self): return self.bugs_closed.split(',')
def get_bug_list(self): return self.bugs_closed.split(',')
15,200
def parse_change_desc(changedesc, result_dict): summary = "" description = "" files = [] changedesc_keys = { 'QA Notes': "", 'Testing Done': "", 'Documentation Notes': "", 'Bug Number': "", 'Reviewed by': "", 'Approved by': "", 'Breaks vmcore compatibility': "", 'Breaks vmkernel compatibility': "", 'Breaks vmkdrivers ...
def parse_change_desc(changedesc, result_dict): summary = "" description = "" files = [] changedesc_keys = { 'QA Notes': "", 'Testing Done': "", 'Documentation Notes': "", 'Bug Number': "", 'Reviewed by': "", 'Approved by': "", 'Breaks vmcore compatibility': "", 'Breaks vmkernel compatibility': "", 'Breaks vmkdrivers ...
15,201
def new_review_request(request, template_name='reviews/new.html', changenum_path='changenum'): changedesc = "\
defnew_review_request(request,template_name='reviews/new.html',changenum_path='changenum'):changedesc="\
15,202
def new_review_request(request, template_name='reviews/new.html', changenum_path='changenum'): changedesc = "\
def new_review_request(request, template_name='reviews/new.html', changenum_path='changenum'): changedesc = "\
15,203
def testResponse(self): r = sip.Response(200, "OK") r.addHeader("foo", "bar") r.addHeader("Content-Length", "4") r.bodyDataReceived("1234") self.assertEquals(r.toString(), "SIP/2.0 200 OK\r\nFoo: bar\r\nContent-length: 4\r\n\r\n1234")
def testResponse(self): r = sip.Response(200, "OK") r.addHeader("foo", "bar") r.addHeader("Content-Length", "4") r.bodyDataReceived("1234") self.assertEquals(r.toString(), "SIP/2.0 200 OK\r\nFoo: bar\r\nContent-length: 4\r\n\r\n1234")
15,204
def testRegister(self): p = self.clientPort.getHost().port r = sip.Request("REGISTER", "sip:proxy.com") r.addHeader("to", "sip:joe@proxy.com") r.addHeader("from", "sip:joe@proxy.com") r.addHeader("contact", "sip:joe@127.0.0.1:%d" % p) r.addHeader("call-id", "8E0C617B69B2D91187C6000E35CE1034@proxy.com") r.addHeader("CSe...
def testRegister(self): p = self.clientPort.getHost().port r = sip.Request("REGISTER", "sip:proxy.com") r.addHeader("to", "sip:joe@proxy.com") r.addHeader("from", "sip:joe@proxy.com") r.addHeader("contact", "sip:joe@127.0.0.1:%d" % p) r.addHeader("call-id", "8E0C617B69B2D91187C6000E35CE1034@proxy.com") r.addHeader("CSe...
15,205
def endow(self, ticket, avatar): self.endowed += 1 la = avatar.parent.findFirst(userbase.LoginAccount, avatars=avatar.parent.getItemByID(avatar.idInParent))
def endow(self, ticket, avatar): self.endowed += 1 la = avatar.parent.findFirst(userbase.LoginAccount, avatars=avatar.parent.getItemByID(avatar.idInParent))
15,206
def getTabs(self): return [webnav.Tab('Voice', self.storeID, 0.0)]
def getTabs(self): return [webnav.Tab('Voice', self.storeID, 0.0)]
15,207
def readRecord(self): #FIXME this is not optimal since we need wo walk at least through 256*256 cells. It #would be better, if we reuse KSpread::Cell::firstCell()-iterator here. if self.rowidx <= self.sheet.lastRow(): record = [] for i in range(self.sheet.lastColumn() + 1, 1, -1): value = self.sheet.text(i, self.rowidx...
def readRecord(self): #FIXME this is not optimal since we need wo walk at least through 256*256 cells. It #would be better, if we reuse KSpread::Cell::firstCell()-iterator here. if self.rowidx <= self.sheet.lastRow(): record = [] for i in range(self.sheet.lastColumn() + 1, 1, -1): value = self.sheet.text(i, self.rowidx...
15,208
def __reset(self): self.alignment="1" #text alignment, left self.vgap=1 #line spacing
def __reset(self): self.alignment="1" #text alignment, left self.vgap=1 #line spacing
15,209
def __handlePage(self,parent,bgParent): self.__setBackground(bgParent) #set the background for this page self.pageCount=self.pageCount+1 objElem=self.document.createElement("OBJECT") #KPresenter text object objElem.setAttribute("type", "4")
def __handlePage(self,parent,bgParent): if (self.pageCount!=-1): self.__setBackground(bgParent) #set the background for this page self.pageCount=self.pageCount+1 objElem=self.document.createElement("OBJECT") #KPresenter text object objElem.setAttribute("type", "4")
15,210
def __setPaper(self,parent): paperElem=self.document.createElement("PAPER") paperElem.setAttribute("ptWidth", "680") paperElem.setAttribute("ptHeight", str(Y_OFFSET)) paperElem.setAttribute("orientation", "0") #landscape paperElem.setAttribute("format", "5") #screen paperElem.setAttribute("unit", "0") #mm
def __setPaper(self,parent): paperElem=self.document.createElement("PAPER") paperElem.setAttribute("ptWidth", str(PAGE_WIDTH)) paperElem.setAttribute("ptHeight", str(Y_OFFSET)) paperElem.setAttribute("orientation", "0") #landscape paperElem.setAttribute("format", "5") #screen paperElem.setAttribute("unit", "0") ...
15,211
def setUp(self): import krosstestpluginmodule self.pluginobject1 = krosstestpluginmodule.testpluginobject1() self.pluginobject2 = krosstestpluginmodule.testpluginobject2() self.assert_( self.pluginobject1 ) self.assert_( self.pluginobject2 )
def setUp(self): import krosstestpluginmodule self.pluginobject1 = krosstestpluginmodule.testpluginobject1() self.pluginobject2 = krosstestpluginmodule.testpluginobject2() self.assert_( self.pluginobject2 )
15,212
#def testExpectedFailures(self): # to less arguments #self.assertRaises(ValueError, self.pluginobject1.uintfunc) #self.assert_( self.pluginobject1.uintfunc() != 8465 )
#def testExpectedFailures(self): # to less arguments #self.assertRaises(ValueError, self.pluginobject1.uintfunc) #self.assert_( self.pluginobject1.uintfunc() != 8465 )
15,213
def __init__(self, scriptpath, parent): self.scriptpath = scriptpath self.filename = self.getFileName("myscript.py")
def __init__(self, scriptpath, parent): self.scriptpath = scriptpath self.filename = self.getFileName("myscript.py")
15,214
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount [from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id]) if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except_osv('...
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True): if to_currency_id==from_currency_id: return from_amount [from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id]) if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv....
15,215
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount [from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id]) if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except_osv('...
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount from_currency=self.browse(cr, uid, [from_currency_id])[0] to_currency = self.browse(cr, uid, [to_currency_id])[0] if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except...
15,216
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount [from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id]) if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except_osv('...
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount): if to_currency_id==from_currency_id: return from_amount [from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id]) if from_currency['rate'] == 0 or to_currency['rate'] == 0: raise osv.except_osv('...
15,217
def __init__(self, name, value, exc_type='warning'): self.name = name self.exc_type = exc_type self.value = value self.args = (exc_type,name)
def __init__(self, name, value, exc_type='warning'): self.name = name self.exc_type = exc_type self.value = value self.args = (exc_type,name)
15,218
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
15,219
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
15,220
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
15,221
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
def _tag_menuitem(self, cr, rec, data_node=None): rec_id = rec.getAttribute("id").encode('ascii') m_l = map(escape, escape_re.split(rec.getAttribute("name").encode('utf8'))) pid = False for idx, menu_elem in enumerate(m_l): if pid: cr.execute('select id from ir_ui_menu where parent_id=%d and name=%s', (pid, menu_elem))...
15,222
def _field_get(self, self2, cr, uid, prop): if not self.field_id: cr.execute('select id from ir_model_fields where name=%s and model=%s', (prop, self2._name)) res = cr.fetchone() self.field_id = res and res[0] return self.field_id
def _field_get(self, self2, cr, uid, prop): if not self.field_id.get(cr.dbname): cr.execute('select id from ir_model_fields where name=%s and model=%s', (prop, self2._name)) res = cr.fetchone() self.field_id = res and res[0] return self.field_id
15,223
def _field_get(self, self2, cr, uid, prop): if not self.field_id: cr.execute('select id from ir_model_fields where name=%s and model=%s', (prop, self2._name)) res = cr.fetchone() self.field_id = res and res[0] return self.field_id
def _field_get(self, self2, cr, uid, prop): if not self.field_id: cr.execute('select id from ir_model_fields where name=%s and model=%s', (prop, self2._name)) res = cr.fetchone() self.field_id = res and res[0] return self.field_id
15,224
def _auto_init(self, cr):
def _auto_init(self, cr):
15,225
for state_name, state_def in obj.states.iteritems(): if 'result' in state_def: result = state_def['result'] if result['type'] != 'form': break
for state_name, state_def in obj.states.iteritems(): if 'result' in state_def: result = state_def['result'] if result['type'] != 'form': break
15,226
def data_files(): '''Build list of data files to be installed''' files = [(opj('share', 'man', 'man1'), ['man/tinyerp-server.1']), (opj('share', 'man', 'man5'), ['man/terp_serverrc.5']), (opj('share','doc', 'tinyerp-server-%s' % version), [f for f in glob.glob('doc/*') if os.path.isfile(f)]), (opj('lib','python%s' % py...
def data_files(): '''Build list of data files to be installed''' files = [(opj('share', 'man', 'man1'), ['man/tinyerp-server.1']), (opj('share', 'man', 'man5'), ['man/terp_serverrc.5']), (opj('share','doc', 'tinyerp-server-%s' % version), [f for f in glob.glob('doc/*') if os.path.isfile(f)]), (opj('lib','python%s' % py...
15,227
def _code_get(self, cr, uid, context={}): cr.execute('select code, name from ir_sequence_type') return cr.fetchall()
def _code_get(self, cr, uid, context={}): cr.execute('select code, name from ir_sequence_type') return cr.fetchall()
15,228
def get_id(self, cr, uid, sequence_id, test='id=%d'): self.sequence_semaphore.acquire() cr.execute('select id,number_next,number_increment,prefix,suffix,padding from ir_sequence where '+test+' and active=True', (sequence_id,)) res = cr.dictfetchone() if res: cr.execute('update ir_sequence set number_next=number_next+nu...
def get_id(self, cr, uid, sequence_id, test='id=%d'): try: cr.execute('lock table ir_sequence') cr.execute('select id,number_next,number_increment,prefix,suffix,padding from ir_sequence where '+test+' and active=True', (sequence_id,)) res = cr.dictfetchone() if res: cr.execute('update ir_sequence set number_next=number...
15,229
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
15,230
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' demo = True for module in self.browse(cr, uid, ids): mdemo = True for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) mdemo = mdemo and self.state_chang...
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' demo = True for module in self.browse(cr, uid, ids): mdemo = True for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) mdemo = mdemo and self.state_chang...
15,231
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' ids_dest = [] for module in self.browse(cr, uid, ids): for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) for id in ids2: if (id not in ids_dest): ids_...
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' demo = True for module in self.browse(cr, uid, ids): for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) for id in ids2: if (id not in ids_dest): ids_de...
15,232
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' ids_dest = [] for module in self.browse(cr, uid, ids): for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) for id in ids2: if (id not in ids_dest): ids_...
def state_change(self, cr, uid, ids, newstate, context={}, level=50): if level<1: raise 'Recursion error in modules dependencies !' ids_dest = [] for module in self.browse(cr, uid, ids): for dep in module.dependencies_id: ids2 = self.search(cr, uid, [('name','=',dep.name)]) for id in ids2: if (id not in ids_dest): ids_...
15,233
def button_install_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'uninstalled'}) return True
def button_install_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False}) return True
15,234
def gen_next_ref(self, cr, uid, ids): if len(ids) != 1: return True # compute the next number ref cr.execute("select ref from res_partner where ref is not null order by char_length(ref) desc, ref desc limit 1") res = cr.dictfetchall() ref = res and res[0]['ref'] or '0' try: nextref = int(ref)+1 except e: raise osv.exc...
def gen_next_ref(self, cr, uid, ids): if len(ids) != 1: return True # compute the next number ref cr.execute("select ref from res_partner where ref is not null order by char_length(ref) desc, ref desc limit 1") res = cr.dictfetchall() ref = res and res[0]['ref'] or '0' try: nextref = int(ref)+1 except e: raise osv.exc...
15,235
def gen_next_ref(self, cr, uid, ids): if len(ids) != 1: return True # compute the next number ref cr.execute("select ref from res_partner where ref is not null order by char_length(ref) desc, ref desc limit 1") res = cr.dictfetchall() ref = res and res[0]['ref'] or '0' try: nextref = int(ref)+1 except e: raise osv.exc...
def gen_next_ref(self, cr, uid, ids): if len(ids) != 1: return True # compute the next number ref cr.execute("select ref from res_partner where ref is not null order by char_length(ref) desc, ref desc limit 1") res = cr.dictfetchall() ref = res and res[0]['ref'] or '0' try: nextref = int(ref)+1 except e: raise osv.exc...
15,236
def _get_interface(self, obj): try: if issubclass(obj, interface.Interface): return obj except: pass if callable(obj): return interface.implementedBy(obj) else: return interface.providedBy(obj)
def _get_interface(self, obj): try: if issubclass(obj, interface.Interface): return obj except: pass if callable(obj): return iter(interface.implementedBy(obj)).next() else: return interface.providedBy(obj)
15,237
def _get_interface(self, obj): try: if issubclass(obj, interface.Interface): return obj except: pass if callable(obj): return interface.implementedBy(obj) else: return interface.providedBy(obj)
def _get_interface(self, obj): try: if issubclass(obj, interface.Interface): return obj except: pass if callable(obj): return interface.implementedBy(obj) else: return iter(interface.providedBy(obj)).next()
15,238
def create(self,w=80,h=25): pid,fd=pty.fork() if pid==0: try: fdl=[int(i) for i in os.listdir('/proc/self/fd')] except OSError: fdl=range(256) for i in [i for i in fdl if i>2]: try: os.close(i) except OSError: pass if self.cmd: cmd=['/bin/sh','-c',self.cmd] elif os.getuid()==0: cmd=['/bin/login'] else: sys.stdout.write...
def create(self,w=80,h=25): pid,fd=pty.fork() if pid==0: try: fdl=[int(i) for i in os.listdir('/proc/self/fd')] except OSError: fdl=range(256) for i in [i for i in fdl if i>2]: try: os.close(i) except OSError: pass if self.cmd: cmd=['/bin/sh','-c',self.cmd] elif os.getuid()==0: cmd=['/bin/login'] else: sys.stdout.write...
15,239
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,240
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,241
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,242
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,243
def proc_kill(self,fd): if fd in self.proc: self.proc[fd]['time']=0 t=time.time() for i in self.proc.keys(): t0=self.proc[i]['time'] if (t-t0)>3600: try: os.close(i) os.kill(self.proc[i]['pid'],signal.SIGTERM) except (IOError,OSError): pass del self.proc[i]
def proc_kill(self,fd): if fd in self.proc: self.proc[fd]['time']=0 t=time.time() for i in self.proc.keys(): t0=self.proc[i]['time'] if (t-t0)>120: try: os.close(i) os.kill(self.proc[i]['pid'],signal.SIGTERM) except (IOError,OSError): pass del self.proc[i]
15,244
def csi_m(self,l): for i in l: if i==0: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff00ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
def csi_m(self,l): for i in l: if i==0 or i==39 or i==49 or i==27: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff00ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
15,245
def csi_m(self,l): for i in l: if i==0: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff00ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
def csi_m(self,l): for i in l: if i==0: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff08ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
15,246
def csi_m(self,l): for i in l: if i==0: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff00ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
def csi_m(self,l): for i in l: if i==0: self.sgr=0x000700 elif i>=30 and i<=37: c=i-30 self.sgr=(self.sgr&0xff00ff)|(c<<8) elif i>=40 and i<=47: c=i-40 self.sgr=(self.sgr&0x00ffff)|(c<<16)
15,247
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
def dumphtml(self,color=1): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(sp...
15,248
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg,span_fg=-1,-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
15,249
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) if color: bg,fg=divmod(q,256) else: bg,fg=0,7 if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,spa...
15,250
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg,fg=1,7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
15,251
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
def dumphtml(self): h=self.height w=self.width r="" span="" span_bg=-1 span_fg=-1 for i in range(h*w): q,c=divmod(self.scr[i],256) bg,fg=divmod(q,256) if i==self.cy*w+self.cx: bg=1 fg=7 if (bg!=span_bg or fg!=span_fg or i==h*w-1): if len(span): r+='<span class="f%d b%d">%s</span>'%(span_fg,span_bg,cgi.escape(span.trans...
15,252
def dump(self,fd): try: return self.proc[fd]['term'].dumphtml() except KeyError: return False
def dump(self,fd,color=1): try: return self.proc[fd]['term'].dumphtml() except KeyError: return False
15,253
def dump(self,fd): try: return self.proc[fd]['term'].dumphtml() except KeyError: return False
def dump(self,fd): try: return self.proc[fd]['term'].dumphtml(color) except KeyError: return False
15,254
def __call__(self, environ, start_response): req = qweb.QWebRequest(environ, start_response,session=None) if req.PATH_INFO.endswith('/u'): s=req.REQUEST["s"] k=req.REQUEST["k"] if s in self.session: term=self.session[s] else: term=self.session[s]=self.multi.create() if k: self.multi.proc_write(term,k) time.sleep(0.002)...
def __call__(self, environ, start_response): req = qweb.QWebRequest(environ, start_response,session=None) if req.PATH_INFO.endswith('/u'): s=req.REQUEST["s"] k=req.REQUEST["k"] if s in self.session: term=self.session[s] else: term=self.session[s]=self.multi.create() if k: self.multi.proc_write(term,k) time.sleep(0.002)...
15,255
def create(self,w=80,h=25): if self.cmd: cmd=['/bin/bash','-c',self.cmd] elif os.getuid()==0: cmd=['/bin/login'] else: cmd=['/usr/bin/ssh','-F/dev/null','-oPreferredAuthentications=password','-oNoHostAuthenticationForLocalhost=yes','localhost'] pid,fd=pty.fork() if pid==0: try: fdl=[int(i) for i in os.listdir('/proc/se...
def create(self,w=80,h=25): if self.cmd: cmd=['/bin/bash','-c',self.cmd] elif os.getuid()==0: cmd=['/bin/login'] else: cmd=['/usr/bin/ssh','-F/dev/null','-oPreferredAuthentications=password','-oNoHostAuthenticationForLocalhost=yes','localhost'] pid,fd=pty.fork() if pid==0: try: fdl=[int(i) for i in os.listdir('/proc/se...
15,256
def __init__(self, urlroot="/", zipname="",ziproot="/", listdir=1): StaticBase.__init__(self,urlroot,listdir) self.zipfile=zipfile.ZipFile(zipname) self.zipmtime=os.path.getmtime(zipname) self.ziproot=path_clean(ziproot) self.zipdir={} self.zipentry={}
def __init__(self, urlroot="/", zipname="",ziproot="/", listdir=1): StaticBase.__init__(self,urlroot,listdir) self.zipfile=zipfile.ZipFile(zipname) self.zipmtime=os.path.getmtime(zipname) self.ziproot=path_clean(ziproot) self.zipdir={} self.zipentry={}
15,257
def fs_stat(self,path): fs_path=os.path.join(self.ziproot,path) if fs_path in self.zipentry: return self.zipentry[fs_path] elif fs_path in self.zipdir: return Entry(path,"dir",self.zipmtime,0) else: return None
def fs_stat(self,path): fs_path=os.path.join(self.ziproot,path).strip('/') if fs_path in self.zipentry: return self.zipentry[fs_path] elif fs_path in self.zipdir: return Entry(path,"dir",self.zipmtime,0) else: return None
15,258
def fs_getfile(self,path): fs_path = self.ziproot[1:]+path return self.zipfile.read(fs_path)
def fs_getfile(self,path): fs_path = os.path.join(self.ziproot,path).strip('/') return self.zipfile.read(fs_path)
15,259
def fs_listdir(self,path): fs_path = self.ziproot[1:]+path return self.zipdir[fs_path].values()
def fs_listdir(self,path): fs_path = os.path.join(self.ziproot,path).strip('/') return self.zipdir[fs_path].values()
15,260
def init(self): self.esc_seq={ "\x00": None, "\x05": self.esc_da, "\x07": None, "\x08": self.esc_0x08, "\x09": self.esc_0x09, "\x0a": self.esc_0x0a, "\x0b": self.esc_0x0a, "\x0c": self.esc_0x0a, "\x0d": self.esc_0x0d, "\x0e": None, "\x0f": None, "\x1b#8": None, "\x1b=": None, "\x1b>": None, "\x1b(0": None, "\x1b(A": No...
def init(self): self.esc_seq={ "\x00": None, "\x05": self.esc_da, "\x07": None, "\x08": self.esc_0x08, "\x09": self.esc_0x09, "\x0a": self.esc_0x0a, "\x0b": self.esc_0x0a, "\x0c": self.esc_0x0a, "\x0d": self.esc_0x0d, "\x0e": None, "\x0f": None, "\x1b#8": None, "\x1b=": None, "\x1b>": None, "\x1b(0": None, "\x1b(A": No...
15,261
def csi_c(self,l): self.esc_da(0)
def csi_c(self,l): self.esc_da(0)
15,262
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,263
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
def main(): parser = optparse.OptionParser() parser.add_option("-p", "--port", dest="port", default="8022", help="Set the TCP port (default: 8022)") parser.add_option("-c", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)") parser.add_option("-l", "--log", action="store...
15,264
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,265
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,266
def Join_Version_Revision(v, r) : return (v+'-'+r).strip('-')
def Join_Version_Revision(v, r) : if r : return v+'-'+r else : return v
15,267
def getGoboVariable(name, filename = 'GoboPath', isList = False) : if filename != 'GoboPath' : goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboScriptsDefaults = goboPrograms+'/Scripts/Current/Resources/Defaults/Settings/' goboManagerDefaults = goboPrograms+'/Manager/Cu...
def getGoboVariable(name, filename = 'GoboPath', isList = False) : if filename != 'GoboPath' : goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboScriptsDefaults = goboPrograms+'/Scripts/Current/Resources/Defaults/Settings/' goboManagerDefaults = goboPrograms+'/Manager/Cu...
15,268
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,269
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,270
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,271
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
15,272
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Settings/Compile/Compile.conf", goboSettings + "/Compile/Compile.conf", gobo...
def getCompileOptions() : import os goboSettings = getGoboVariable('goboSettings') goboPrograms = getGoboVariable('goboPrograms') goboCompileDefaults = goboPrograms+'/Compile/Current/Resources/Defaults/Settings/' compileSettingsFiles = [ "~/.Setti...
15,273
def controller_scan(directory): """ Scan a directory for python files and use them as controllers """ def find_controllers(dirname, prefix=''): controllers = [] for fname in os.listdir(dirname): filename = os.path.join(dirname, fname) if os.path.isfile(filename) and re.match('^[^_]{1,1}.*\.py$', fname): controllers.app...
def controller_scan(directory=None): """ Scan a directory for python files and use them as controllers """ def find_controllers(dirname, prefix=''): controllers = [] for fname in os.listdir(dirname): filename = os.path.join(dirname, fname) if os.path.isfile(filename) and re.match('^[^_]{1,1}.*\.py$', fname): controller...
15,274
def makeregexp(self, clist): """ Create a regular expression for matching purposes, this MUST be called before match can function properly. clist should be a list of valid controller strings that can be matched, for this reason makeregexp should be called by the web framework after it knows all available controllers t...
def makeregexp(self, clist): """ Create a regular expression for matching purposes, this MUST be called before match can function properly. clist should be a list of valid controller strings that can be matched, for this reason makeregexp should be called by the web framework after it knows all available controllers t...
15,275
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not moregaps: gaps = True...
15,276
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, noreqs, allblank) = ('', True, True) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(...
15,277
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, noreqs, allblank) = self.buildnextreg(path[1:], clist) if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not moregap...
15,278
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var): gaps = True partreg = '(?P<' + var + '>...
15,279
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,280
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,281
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,282
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,283
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,284
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
def buildnextreg(self, path, clist): default = '[^/]+' part = path[0] reg = '' (rest, moregaps) = ('', False) if len(path[1:]) > 0: (rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False if part.startswith(':'): var = part[1:] partreg = '' if self.reqs.has_key(var) and self.defaults.has_key(var) and not mor...
15,285
def load_wsgi_environ(self, environ): """ Load the protocol/server info from the environ and store it. Also, match the incoming URL if there's already a mapper, and store the resulting match dict in mapper_dict. """ if environ.get('HTTPS'): self.__shared_state.protocol = 'https' else: self.__shared_state.protocol = 'ht...
def load_wsgi_environ(self, environ): """ Load the protocol/server info from the environ and store it. Also, match the incoming URL if there's already a mapper, and store the resulting match dict in mapper_dict. """ if environ.get('HTTPS'): self.__shared_state.protocol = 'https' else: self.__shared_state.protocol = 'ht...
15,286
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth]} return opts
15,287
def __call__(self, environ, start_response): config = request_config() config.mapper = self.mapper old_method = None if self.use_method_override: req = WSGIRequest(environ) if '_method' in environ.get('QUERY_STRING', '') and '_method' in req.GET: old_method = environ['REQUEST_METHOD'] environ['REQUEST_METHOD'] = req.G...
def __call__(self, environ, start_response): config = request_config() config.mapper = self.mapper old_method = None if self.use_method_override: req = WSGIRequest(environ) if '_method' in environ.get('QUERY_STRING', '') and '_method' in req.GET: old_method = environ['REQUEST_METHOD'] environ['REQUEST_METHOD'] = req.G...
15,288
def __call__(self, environ, start_response): config = request_config() config.mapper = self.mapper old_method = None if self.use_method_override: req = WSGIRequest(environ) if '_method' in environ.get('QUERY_STRING', '') and '_method' in req.GET: old_method = environ['REQUEST_METHOD'] environ['REQUEST_METHOD'] = req.G...
def __call__(self, environ, start_response): config = request_config() config.mapper = self.mapper old_method = None if self.use_method_override: req = WSGIRequest(environ) if '_method' in environ.get('QUERY_STRING', '') and '_method' in req.GET: old_method = environ['REQUEST_METHOD'] environ['REQUEST_METHOD'] = req.G...
15,289
def match(self, url, environ=None): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the callin...
def match(self, url, environ=None): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the callin...
15,290
def match(self, url): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the calling function sho...
def match(self, url): """Match a url to our regexp. While the regexp might match, this operation isn't guaranteed as there's other factors that can cause a match to fail even though the regexp succeeds (Default that was relied on wasn't given, requirement regexp doesn't pass, etc.). Therefore the calling function sho...
15,291
def _match(self, url): """Internal Route matcher Matches a URL against a route, and returns a tuple of the match dict and the route object if a match is successfull, otherwise it returns empty. For internal use only. """ if not self._created_regs and self.controller_scan: self.create_regs() elif not self._created_re...
def _match(self, url): """Internal Route matcher Matches a URL against a route, and returns a tuple of the match dict and the route object if a match is successfull, otherwise it returns empty. For internal use only. """ if not self._created_regs and self.controller_scan: self.create_regs() elif not self._created_re...
15,292
def match(self, url): """Match a URL against against one of the routes contained. Will return None if no valid match is found. resultdict = m.match('/joe/sixpack') """ result = self._match(url) if result: return result[0] return None
def match(self, url): """Match a URL against against one of the routes contained. Will return None if no valid match is found. resultdict = m.match('/joe/sixpack') """ result = self._match(url) if self.debug: return result[0], result[1], result[2] if result[0]: return result[0] return None
15,293
def routematch(self, url): """Match a URL against against one of the routes contained. Will return None if no valid match is found, otherwise a result dict and a route object is returned. resultdict, route_obj = m.match('/joe/sixpack') """ result = self._match(url) if result: return result[0], result[1] return None ...
def routematch(self, url): """Match a URL against against one of the routes contained. Will return None if no valid match is found, otherwise a result dict and a route object is returned. resultdict, route_obj = m.match('/joe/sixpack') """ result = self._match(url) if self.debug: return result[0], result[1], result[...
15,294
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth.upper()]} return opts
def requirements_for(meth): """Returns a new dict to be used for all route creation as the route options""" opts = options.copy() if method != 'any': opts['conditions'] = {'method':[meth.upper()]} return opts
15,295
def longest_first(a, b): return cmp(len(b), len(a))
def longest_first(a, b): return cmp(len(b), len(a))
15,296
def load_wsgi_environ(self, environ): """ Load the protocol/server info from the environ and store it. Also, match the incoming URL if there's already a mapper, and store the resulting match dict in mapper_dict. """ port_info = '' if environ.get('HTTPS'): self.__shared_state.protocol = 'https' if environ.get('SERVER_PO...
def load_wsgi_environ(self, environ): """ Load the protocol/server info from the environ and store it. Also, match the incoming URL if there's already a mapper, and store the resulting match dict in mapper_dict. """ port_info = '' if environ.get('HTTPS'): self.__shared_state.protocol = 'https' if environ.get('SERVER_PO...
15,297
def generate(self,**kargs): """Generate a URL from ourself given a set of keyword arguments Toss an exception if this set of keywords would cause a gap in the url. """ # Verify that our args pass any regexp requirements for key in self.reqs.keys(): val = kargs.get(key) if val and not self.req_regs[key].match(str(val)...
def generate(self,**kargs): """Generate a URL from ourself given a set of keyword arguments Toss an exception if this set of keywords would cause a gap in the url. """ # Verify that our args pass any regexp requirements for key in self.reqs.keys(): val = kargs.get(key) if val and not self.req_regs[key].match(str(val)...
15,298
def swap(dct, newdct): for key, val in dct.iteritems(): newdct.setdefault(val, []).append(key) return newdct
def swap(dct, newdct): for key, val in dct.iteritems(): newdct.setdefault(val, []).append(key) return newdct
15,299