rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return self.bugs_closed.split(',')
bugs = self.bugs_closed.split(',') bugs.sort(cmp=lambda x,y: int(x) - int(y)) return bugs
def get_bug_list(self): return self.bugs_closed.split(',')
3a22e515c9eaba49586a9446d3d06a202fb9e702 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1600/3a22e515c9eaba49586a9446d3d06a202fb9e702/models.py
", ".join(re.split(r"[, ]+", changedesc_keys['Bug Number']))
", ".join(re.split(r"[, ]+", changedesc_keys['Bug Number'])).strip()
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 ...
2b1e78d93b460392f1c45a43c8787c7e47800ff0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1600/2b1e78d93b460392f1c45a43c8787c7e47800ff0/views.py
def new_review_request(request, template_name='reviews/new.html', changenum_path='changenum'): changedesc = "\
2b1e78d93b460392f1c45a43c8787c7e47800ff0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1600/2b1e78d93b460392f1c45a43c8787c7e47800ff0/views.py
changenum = request.POST['changenum'] if changenum:
if request.POST.has_key('changenum'): changenum = request.POST['changenum']
def new_review_request(request, template_name='reviews/new.html', changenum_path='changenum'): changedesc = "\
2b1e78d93b460392f1c45a43c8787c7e47800ff0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1600/2b1e78d93b460392f1c45a43c8787c7e47800ff0/views.py
self.assertEquals(r.toString(), "SIP/2.0 200 OK\r\nFoo: bar\r\nContent-length: 4\r\n\r\n1234")
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")
b1ee060a816f8fbd1f7232060199441e1c2161d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6979/b1ee060a816f8fbd1f7232060199441e1c2161d7/test_sip.py
Content-length: 0\r
Content-Length: 0\r
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...
b1ee060a816f8fbd1f7232060199441e1c2161d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6979/b1ee060a816f8fbd1f7232060199441e1c2161d7/test_sip.py
la = avatar.parent.findFirst(userbase.LoginAccount, avatars=avatar.parent.getItemByID(avatar.idInParent))
la = avatar.parent.findFirst( userbase.LoginAccount, 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))
0de92762adf2f380e4922f6ea0c5fa9e0c203b62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6979/0de92762adf2f380e4922f6ea0c5fa9e0c203b62/sipserver.py
return [webnav.Tab('Voice', self.storeID, 0.0)]
return [webnav.Tab('Voice', self.storeID, 0.75)]
def getTabs(self): return [webnav.Tab('Voice', self.storeID, 0.0)]
12cdf3749078c08d579123d4f908692ec3cd1c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6979/12cdf3749078c08d579123d4f908692ec3cd1c8f/sipserver.py
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...
064a3b928f06883577daf0a3540569d8598a014e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/064a3b928f06883577daf0a3540569d8598a014e/htmlexport.py
self.bctype="0"
self.bctype="0"
def __reset(self): self.alignment="1" #text alignment, left self.vgap=1 #line spacing
ae3ba91c5fa7f5d0cde0814f996bd990021eff11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/ae3ba91c5fa7f5d0cde0814f996bd990021eff11/mgp2kpr.py
self.__setBackground(bgParent)
if (self.pageCount!=-1): self.__setBackground(bgParent)
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")
ae3ba91c5fa7f5d0cde0814f996bd990021eff11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/ae3ba91c5fa7f5d0cde0814f996bd990021eff11/mgp2kpr.py
paperElem.setAttribute("ptWidth", "680")
paperElem.setAttribute("ptWidth", str(PAGE_WIDTH))
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
ae3ba91c5fa7f5d0cde0814f996bd990021eff11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/ae3ba91c5fa7f5d0cde0814f996bd990021eff11/mgp2kpr.py
self.assert_( self.pluginobject1 )
def setUp(self): import krosstestpluginmodule self.pluginobject1 = krosstestpluginmodule.testpluginobject1() self.pluginobject2 = krosstestpluginmodule.testpluginobject2() self.assert_( self.pluginobject1 ) self.assert_( self.pluginobject2 )
709dcf73a39047e96138474ab2dc4ae54a206438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/709dcf73a39047e96138474ab2dc4ae54a206438/testcase.py
print "__name = %s" % __name__
print "__name__ = %s" % __name__
#def testExpectedFailures(self): # to less arguments #self.assertRaises(ValueError, self.pluginobject1.uintfunc) #self.assert_( self.pluginobject1.uintfunc() != 8465 )
709dcf73a39047e96138474ab2dc4ae54a206438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/709dcf73a39047e96138474ab2dc4ae54a206438/testcase.py
self.setCaption("Actions")
self.setCaption("Script Editor")
def __init__(self, scriptpath, parent): self.scriptpath = scriptpath self.filename = self.getFileName("myscript.py")
fe9fe58d375f2cd71b421c1948345f0991620829 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1674/fe9fe58d375f2cd71b421c1948345f0991620829/ScriptEditor.py
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount):
def compute(self, cr, uid, from_currency_id, to_currency_id, from_amount, round=True):
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('...
4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9/res_currency.py
[from_currency]=self.read(cr, uid, [from_currency_id]) [to_currency] = self.read(cr, uid, [to_currency_id])
from_currency=self.browse(cr, uid, [from_currency_id])[0] to_currency = self.browse(cr, uid, [to_currency_id])[0]
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('...
4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9/res_currency.py
return self.round(cr, uid, to_currency, from_amount * from_currency['rate']/to_currency['rate'])
if round: return self.round(cr, uid, to_currency, from_amount * from_currency.rate/to_currency.rate) else: return (from_amount * from_currency.rate/to_currency.rate)
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('...
4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/4cbcb3ede718249b78b46ac0572d0e6c6c8c88b9/res_currency.py
obj_pool = {} module_object_list = {}
def __init__(self, name, value, exc_type='warning'): self.name = name self.exc_type = exc_type self.value = value self.args = (exc_type,name)
e7d25212a04af55cd41efe807e4b0e5a2c591d07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/e7d25212a04af55cd41efe807e4b0e5a2c591d07/osv.py
print 'INDENT'
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))...
29a1e47fb1295ff56a6f74368f7337fbbb92177b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/29a1e47fb1295ff56a6f74368f7337fbbb92177b/convert.py
print 'FILL'
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))...
29a1e47fb1295ff56a6f74368f7337fbbb92177b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/29a1e47fb1295ff56a6f74368f7337fbbb92177b/convert.py
print 'COLOR'
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))...
29a1e47fb1295ff56a6f74368f7337fbbb92177b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/29a1e47fb1295ff56a6f74368f7337fbbb92177b/convert.py
print values
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))...
29a1e47fb1295ff56a6f74368f7337fbbb92177b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/29a1e47fb1295ff56a6f74368f7337fbbb92177b/convert.py
if not self.field_id:
if not self.field_id.get(cr.dbname):
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
7361d410cefc08e39f421aa1e054c2ad659dca1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/7361d410cefc08e39f421aa1e054c2ad659dca1e/fields.py
self.field_id = res and res[0] return self.field_id
self.field_id[cr.dbname] = res and res[0] return self.field_id[cr.dbname]
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
7361d410cefc08e39f421aa1e054c2ad659dca1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/7361d410cefc08e39f421aa1e054c2ad659dca1e/fields.py
q = """SELECT c.relname,a.attname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,t.typname,CASE WHEN a.attlen=-1 THEN a.atttypmod-4 ELSE a.attlen END as size FROM pg_class c,pg_attribute a,pg_type t WHERE c.relname='%s' AND a.attname='%s' AND c.oid=a.attrelid AND a.atttypid=t.oid""" % (self._table, k)
q = """SELECT c.relname,a.attname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,t.typname,CASE WHEN a.attlen=-1 THEN a.atttypmod-4 ELSE a.attlen END as size FROM pg_class c,pg_attribute a,pg_type t WHERE c.relname='%s' AND a.attname='%s' AND c.oid=a.attrelid AND a.atttypid=t.oid""" % (self._table, k.lower())
def _auto_init(self, cr):
e16892125bb30199beae037b390dbcb59e3d3220 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/e16892125bb30199beae037b390dbcb59e3d3220/orm.py
break
continue
for state_name, state_def in obj.states.iteritems(): if 'result' in state_def: result = state_def['result'] if result['type'] != 'form': break
e655fa851f3d7553757cb5b47bd319e4e7b6e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/e655fa851f3d7553757cb5b47bd319e4e7b6e0a6/translate.py
(opj('lib','python%s' % py_short_version, 'site-package', 'tinyerp-server', 'i18n'),
(opj('lib','python%s' % py_short_version, 'site-packagess', 'tinyerp-server', 'i18n'),
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...
8fbfdcc407cb826e45e736571136c2830eae700d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/8fbfdcc407cb826e45e736571136c2830eae700d/setup.py
sequence_semaphore = threading.Semaphore()
def _code_get(self, cr, uid, context={}): cr.execute('select code, name from ir_sequence_type') return cr.fetchall()
26ccfdf34d69db923397793a5164265937fce0b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/26ccfdf34d69db923397793a5164265937fce0b8/ir_sequence.py
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+number_increment where id=%d and active=True', (res['id'...
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_next+number_increment where id=%d and active=True', (...
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...
26ccfdf34d69db923397793a5164265937fce0b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/26ccfdf34d69db923397793a5164265937fce0b8/ir_sequence.py
def set(self, cr, uid, code, next_number): self.sequence_semaphore.acquire() cr.execute('update ir_sequence set number_next=%d where code=%s and active=True', (next_number, code,)) self.sequence_semaphore.release() return True
def get(self, cr, uid, code): return self.get_id(cr, uid, code, test='code=%s')
26ccfdf34d69db923397793a5164265937fce0b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/26ccfdf34d69db923397793a5164265937fce0b8/ir_sequence.py
self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo})
if module.state=='uninstalled': self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo})
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...
71e1305eee7782e62b8f694a6f5eb7b6d385672d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/71e1305eee7782e62b8f694a6f5eb7b6d385672d/module.py
ids_dest = []
demo = True
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_...
645b23c57702b08dff8279cd3ad4049ef07cc9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/645b23c57702b08dff8279cd3ad4049ef07cc9fb/module.py
for id in ids2: if (id not in ids_dest): ids_dest.append(id) if module.state=='uninstalled': self.write(cr, uid, [module.id], {'state': newstate}) if ids_dest: self.state_change(cr, uid, ids_dest, newstate, context, level-1) for module in self.browse(cr, uid, ids): if module.state!='installed': demo=True for dep in mo...
mdemo = mdemo and self.state_change(cr, uid, ids2, newstate, context, level-1) if not module.dependencies_id: mdemo = module.demo self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo}) demo = demo and mdemo return demo
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_...
645b23c57702b08dff8279cd3ad4049ef07cc9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/645b23c57702b08dff8279cd3ad4049ef07cc9fb/module.py
self.write(cr, uid, ids, {'state': 'uninstalled'})
self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False})
def button_install_cancel(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'uninstalled'}) return True
645b23c57702b08dff8279cd3ad4049ef07cc9fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/645b23c57702b08dff8279cd3ad4049ef07cc9fb/module.py
'iban': fields.char('Account number', size=64),
'iban': fields.char('Account Number', size=64),
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...
85dc8f276458aefe78047117ec543f9d1fd81adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/85dc8f276458aefe78047117ec543f9d1fd81adc/partner.py
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...
85dc8f276458aefe78047117ec543f9d1fd81adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12853/85dc8f276458aefe78047117ec543f9d1fd81adc/partner.py
return interface.implementedBy(obj)
return iter(interface.implementedBy(obj)).next()
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)
353b24771e0396c239a2672e17ef1c22b2bf0d52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2278/353b24771e0396c239a2672e17ef1c22b2bf0d52/application.py
return interface.providedBy(obj)
return iter(interface.providedBy(obj)).next()
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)
353b24771e0396c239a2672e17ef1c22b2bf0d52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2278/353b24771e0396c239a2672e17ef1c22b2bf0d52/application.py
cmd=['ssh','-oPreferredAuthentications=keyboard-interactive,password','-oNoHostAuthenticationForLocalhost=yes','-F/dev/null'] cmd+=['-l',login,'localhost']
cmd=['ssh'] cmd+=['-oPreferredAuthentications=keyboard-interactive,password'] cmd+=['-oNoHostAuthenticationForLocalhost=yes'] cmd+=['-oLogLevel=FATAL'] cmd+=['-F/dev/null','-l',login,'localhost']
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...
bb46bfd77130f0cc726ad5cc0238df29d33c9b37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/bb46bfd77130f0cc726ad5cc0238df29d33c9b37/ajaxterm.py
sys.stdin = open('/dev/null', 'r') sys.stdout = open('/dev/null', 'w') sys.stderr = open('/dev/null', 'w')
nullin = file('/dev/null', 'r') nullout = file('/dev/null', 'w') os.dup2(nullin.fileno(), sys.stdin.fileno()) os.dup2(nullout.fileno(), sys.stdout.fileno()) os.dup2(nullout.fileno(), sys.stderr.fileno()) if os.getuid()==0 and o.uid: try: os.setuid(int(o.uid)) except: os.setuid(pwd.getpwnam(o.uid).pw_uid)
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...
bb46bfd77130f0cc726ad5cc0238df29d33c9b37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/bb46bfd77130f0cc726ad5cc0238df29d33c9b37/ajaxterm.py
pid_file = '/var/run/ajaxterm.pid'
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...
bb46bfd77130f0cc726ad5cc0238df29d33c9b37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/bb46bfd77130f0cc726ad5cc0238df29d33c9b37/ajaxterm.py
open(pid_file,'w+').write(str(pid)+'\n')
file(o.pidfile,'w+').write(str(pid)+'\n')
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...
bb46bfd77130f0cc726ad5cc0238df29d33c9b37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/bb46bfd77130f0cc726ad5cc0238df29d33c9b37/ajaxterm.py
print 'Cannot store pid in %s' % pid_file
pass
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...
bb46bfd77130f0cc726ad5cc0238df29d33c9b37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/bb46bfd77130f0cc726ad5cc0238df29d33c9b37/ajaxterm.py
if (t-t0)>3600:
if (t-t0)>120:
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]
ee47be0f2054695e7e6d7e82ca8f47195820430f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/ee47be0f2054695e7e6d7e82ca8f47195820430f/ajaxterm.py
if i==0:
if i==0 or i==39 or i==49 or i==27:
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)
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
self.sgr=(self.sgr&0xff00ff)|(c<<8)
self.sgr=(self.sgr&0xff08ff)|(c<<8)
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)
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
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)
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
def dumphtml(self):
def dumphtml(self,color=1):
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...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
span_bg=-1 span_fg=-1
span_bg,span_fg=-1,-1
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...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
bg,fg=divmod(q,256)
if color: bg,fg=divmod(q,256) else: bg,fg=0,7
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...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
bg=1 fg=7
bg,fg=1,7
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...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
span_bg=bg span_fg=fg
span_bg,span_fg=bg,fg
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...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
def dump(self,fd):
def dump(self,fd,color=1):
def dump(self,fd): try: return self.proc[fd]['term'].dumphtml() except KeyError: return False
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
return self.proc[fd]['term'].dumphtml()
return self.proc[fd]['term'].dumphtml(color)
def dump(self,fd): try: return self.proc[fd]['term'].dumphtml() except KeyError: return False
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
dump=self.multi.dump(term)
dump=self.multi.dump(term,c)
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)...
9006feef9ed1aece90fd903313a881c66d0a3c47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/9006feef9ed1aece90fd903313a881c66d0a3c47/ajaxterm.py
fcntl.ioctl(fd, termios.TIOCSWINSZ , struct.pack("HHHH",h,w,0,0))
fcntl.ioctl(fd, struct.unpack('i',struct.pack('I',termios.TIOCSWINSZ))[0], struct.pack("HHHH",w,h,0,0))
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...
c6f48362e286b70d561c2a46038698263e893bfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/c6f48362e286b70d561c2a46038698263e893bfb/ajaxterm.py
self.zipentry[zi.filename]=Entry(zi.filename,"file",self.zipmtime,zi.file_size)
if not zi.filename.endswith('/'): self.zipentry[zi.filename]=Entry(zi.filename,"file",self.zipmtime,zi.file_size)
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={}
f84de619110a259b4248d76650d24d96a59436d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/f84de619110a259b4248d76650d24d96a59436d0/static.py
fs_path=os.path.join(self.ziproot,path)
fs_path=os.path.join(self.ziproot,path).strip('/')
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
f84de619110a259b4248d76650d24d96a59436d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/f84de619110a259b4248d76650d24d96a59436d0/static.py
fs_path = self.ziproot[1:]+path
fs_path = os.path.join(self.ziproot,path).strip('/')
def fs_getfile(self,path): fs_path = self.ziproot[1:]+path return self.zipfile.read(fs_path)
f84de619110a259b4248d76650d24d96a59436d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/f84de619110a259b4248d76650d24d96a59436d0/static.py
fs_path = self.ziproot[1:]+path
fs_path = os.path.join(self.ziproot,path).strip('/')
def fs_listdir(self,path): fs_path = self.ziproot[1:]+path return self.zipdir[fs_path].values()
f84de619110a259b4248d76650d24d96a59436d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/f84de619110a259b4248d76650d24d96a59436d0/static.py
"\x1b[?1c": None, "\x1b[?0c": None,
"\x1b[c": self.esc_da, "\x1b[0c": self.esc_da,
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...
a0defa78229e6a90151e2677e6b80236d573b921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/a0defa78229e6a90151e2677e6b80236d573b921/ajaxterm.py
self.esc_da(0)
pass
def csi_c(self,l): self.esc_da(0)
a0defa78229e6a90151e2677e6b80236d573b921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/a0defa78229e6a90151e2677e6b80236d573b921/ajaxterm.py
print 'AjaxTerm serving at http://localhost:%s/'%o.port
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...
d1babae662f71a1951464c1659c2cb5de814f952 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/d1babae662f71a1951464c1659c2cb5de814f952/ajaxterm.py
print 'AjaxTerm running with pid: %d' % pid
print 'AjaxTerm at http://localhost:%s/ pid: %d' % (o.port,pid)
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...
d1babae662f71a1951464c1659c2cb5de814f952 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13009/d1babae662f71a1951464c1659c2cb5de814f952/ajaxterm.py
compileRecipeDirs = os.popen("/bin/sh -c '. " +file+" 2> /dev/null; for i in ${compileRecipeDirs[@]}; do echo $i; done'").read().strip('\n').split() if compileRecipeDirs :
compileRecipeDirs = os.popen("/bin/sh -c '. " +file+" 2> /dev/null; for i in \"${compileRecipeDirs[@]}\"; do echo $i; done'").read().strip('\n').split('\n') if compileRecipeDirs and compileRecipeDirs[0] :
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...
d46fce0d0456fb0937bfbefc4c875cdd88708921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/d46fce0d0456fb0937bfbefc4c875cdd88708921/PythonUtils.py
getRecipeStores = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; for i in ${getRecipeStores[@]}; do echo $i; done'").read().strip('\n').split() if getRecipeStores :
getRecipeStores = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; for i in \"${getRecipeStores[@]}\"; do echo $i; done'").read().strip('\n').split('\n') if getRecipeStores and getRecipeStores[0] :
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...
d46fce0d0456fb0937bfbefc4c875cdd88708921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/d46fce0d0456fb0937bfbefc4c875cdd88708921/PythonUtils.py
return (v+'-'+r).strip('-')
if r : return v+'-'+r else : return v
def Join_Version_Revision(v, r) : return (v+'-'+r).strip('-')
68f4d60c7fd16b0ff2134d9e1da72fbe118c270e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/68f4d60c7fd16b0ff2134d9e1da72fbe118c270e/PythonUtils.py
os.environ[name] = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; echo -n $"+name+"'").read()
os.environ[name] = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; for i in ${"+name+"[@]}; do echo $i; done'").read().strip('\n')
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
compileRecipeDirs = os.environ['compileRecipeDirs'].split()
compileRecipeDirs = os.environ['compileRecipeDirs'].strip('\n').split()
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
compileRecipeDirs = os.popen("/bin/sh -c '. " +file+" 2> /dev/null; for i in ${compileRecipeDirs[@]}; do echo $i; done'").readlines()
compileRecipeDirs = os.popen("/bin/sh -c '. " +file+" 2> /dev/null; for i in ${compileRecipeDirs[@]}; do echo $i; done'").read().strip('\n').split()
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
getRecipeStores = os.environ['getRecipeStores'].split()
getRecipeStores = os.environ['getRecipeStores'].strip('\n').split('\n')
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
getRecipeStores = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; for i in ${getRecipeStores[@]}; do echo $i; done'").readlines()
getRecipeStores = os.popen("/bin/sh -c '. " + file +" 2> /dev/null; for i in ${getRecipeStores[@]}; do echo $i; done'").read().strip('\n').split()
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
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...
e913be36383005c3b2c4b3f4ba5a327c4ea5bff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5186/e913be36383005c3b2c4b3f4ba5a327c4ea5bff5/PythonUtils.py
def controller_scan(directory):
def controller_scan(directory=None):
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...
17852673013dc8f7e611d644472e67fe0b9a49ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/17852673013dc8f7e611d644472e67fe0b9a49ff/util.py
(reg, gaps) = self.buildnextreg(self.routelist, clist) print reg
(reg, noreqs, allblank) = self.buildnextreg(self.routelist, clist)
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
default = '[^/]+'
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
(rest, moregaps) = ('', False)
(rest, noreqs, allblank) = ('', True, True)
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
(rest, moregaps) = self.buildnextreg(path[1:], clist) gaps = False
(rest, noreqs, allblank) = self.buildnextreg(path[1:], clist)
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
if self.reqs.has_key(var) and self.defaults.has_key(var) and not moregaps: gaps = True reg = '(/(?P<' + var + '>' + self.reqs[var] + ')?' reg = reg + rest elif self.reqs.has_key(var) and self.defaults.has_key(var) and moregaps: gaps = True reg = '(/(?P<' + var + '>' + self.reqs[var] + ')' reg = reg + rest elif self.req...
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
gaps = True
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
gaps = True
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
partreg = '(?P<' + var + '>' + default + ')' if self.defaults.has_key(var) and not moregaps: reg = '(/' + partreg + ')?'
partreg = '(?P<' + var + '>[^/]+)' if self.reqs.has_key(var): noreqs = False if noreqs: if self.reqs.has_key(var) and self.defaults.has_key(var): reg = '(/' + partreg + rest + ')?' elif self.reqs.has_key(var): allblank = False reg = '(/' + partreg + ')' + rest elif self.defaults.has_key(var): reg = '(/' + part...
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
reg = '/' + partreg
if allblank and self.defaults.has_key(var): reg = '(/' + partreg + rest + ')?' else: reg = '/' + partreg + rest
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
reg = '(/' + '(?P<' + var + '>.*))*'
reg = '(/' + '(?P<' + var + '>.*))*' + rest
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
gaps = True reg = '/' + part if moregaps and gaps: reg = '(' + reg + rest + ')?' else: reg = reg + rest return (reg, gaps)
noreqs = False allblank = False reg = '/' + part + rest return (reg, noreqs, allblank)
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...
d81bae157cb6d2bb0c6c006f5ed0836b19d297a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/d81bae157cb6d2bb0c6c006f5ed0836b19d297a3/base.py
if environ.get('SERVER_PORT', 80) != 80: self.__shared_state.host += ':' + environ['SERVER_PORT']
self.__shared_state.host += port_info
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...
c77e5d08759788cfa307eaa143e44a445cea801b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/c77e5d08759788cfa307eaa143e44a445cea801b/__init__.py
primary = (method != 'GET' and lst.pop(0)) or None
if method not in ['POST', 'GET', 'any']: primary = lst.pop(0) else: primary = None
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
31b71a664a34f649b1ec2d6a0bdb62b44b668467 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/31b71a664a34f649b1ec2d6a0bdb62b44b668467/base.py
return self.not_found(environ, start_response)
match = {}
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...
85dba5c21d94b2ed6fe4ce2a5a0e1395ad4007c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/85dba5c21d94b2ed6fe4ce2a5a0e1395ad4007c6/middleware.py
def not_found(self, environ, start_response): start_response('404 Not Found', [('Content-type', 'text/plain')]) return ['Not found']
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...
85dba5c21d94b2ed6fe4ce2a5a0e1395ad4007c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/85dba5c21d94b2ed6fe4ce2a5a0e1395ad4007c6/middleware.py
self.conditions['method'] != environ.get('HTTP_METHOD'):
self.conditions['method'] != environ.get('REQUEST_METHOD'):
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...
857a922f8c462bbdb254daa98b21c913ce78d09d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/857a922f8c462bbdb254daa98b21c913ce78d09d/base.py
for key in self.reqs.keys(): if key not in matchdict.keys() or matchdict[key] is None: try: result[key] = self.defaults[key] except: return False else: value = matchdict[key] or (self.defaults.has_key(key) and self.defaults[key]) or '' if not re.compile('^' + self.reqs[key] + '$').match(value): return False
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...
9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827/base.py
if match: return (match, route) return None
if self.debug: matchlog.append(dict(route=route, regexp=bool(match))) if match: return (match, route, matchlog) return (None, None, matchlog)
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...
9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827/base.py
if result:
if self.debug: return result[0], result[1], result[2] if result[0]:
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
9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827/base.py
if result:
if self.debug: return result[0], result[1], result[2] if result[0]:
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 ...
9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/9a22764f5fd66c9658b08c3e78d9fb0c5ef3a827/base.py
self.connect("formatted_" + route_name, "%s.:(format);%s")
self.connect("formatted_" + route_name, "%s.:(format);%s" % (collection_path, action))
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
5e8cbbf7317f33a71e3467e0afcc27299fc8af2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/5e8cbbf7317f33a71e3467e0afcc27299fc8af2f/base.py
controllers.sort(cmp=longest_first)
controllers.sort(longest_first)
def longest_first(a, b): return cmp(len(b), len(a))
b23e47aaed5f75703e808d07d3739bf1e3b10afc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/b23e47aaed5f75703e808d07d3739bf1e3b10afc/util.py
if environ.get('SERVER_PORT') != '80':
if environ.get('SERVER_PORT', '80') != '80':
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...
8c7211d4f3d3dbc7bf3a8a1114c50a04f091d89c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/8c7211d4f3d3dbc7bf3a8a1114c50a04f091d89c/__init__.py
if meth: kargs['_method'] = meth if meth not in self.conditions.get('method', [meth]): return False
if meth: kargs['_method'] = meth
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)...
da7004651758a3ba73f50c2731e2b08ce10f1730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/da7004651758a3ba73f50c2731e2b08ce10f1730/base.py
new_path = path_prefix + "/new" member_path = path_prefix + "/:id"
new_path = path + "/new" member_path = path + "/:(id)"
def swap(dct, newdct): for key, val in dct.iteritems(): newdct.setdefault(val, []).append(key) return newdct
da7004651758a3ba73f50c2731e2b08ce10f1730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/da7004651758a3ba73f50c2731e2b08ce10f1730/base.py