rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def __init__(self, columns=None, transaction=None, searcher=None, **kwargs):
def __init__(self, columns=None, cls=None, searcher=None, **kwargs):
def __init__(self, columns=None, transaction=None, searcher=None, **kwargs): """ @param columns: A list of Columns. Only the C{read} attribute needs to be set.
41cb05d3c0bc79154577310cba5e527648e6d7cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/41cb05d3c0bc79154577310cba5e527648e6d7cb/search.py
@param transaction: A transaction that will be used to search the values().
@param cls: The class that we'll want to look for with C{searcher}.
def __init__(self, columns=None, transaction=None, searcher=None, **kwargs): """ @param columns: A list of Columns. Only the C{read} attribute needs to be set.
41cb05d3c0bc79154577310cba5e527648e6d7cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/41cb05d3c0bc79154577310cba5e527648e6d7cb/search.py
self.trans = transaction
self.cls = cls
def __init__(self, columns=None, transaction=None, searcher=None, **kwargs): """ @param columns: A list of Columns. Only the C{read} attribute needs to be set.
41cb05d3c0bc79154577310cba5e527648e6d7cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/41cb05d3c0bc79154577310cba5e527648e6d7cb/search.py
self.value = self.searcher.values(self.trans, **data)
self.value = self.searcher.search(self.cls, **data)
def doSearch(self, *ignore): """ Performs the abstract search. The result ends up in aSearch.value as a list and returns the length of the list. """ data = {} for i in xrange(len(self.columns)): e = self.entries[i] c = self.columns[i] if e.value != '': # '' means `don't filter by me' data[c.attribute] = e.value
41cb05d3c0bc79154577310cba5e527648e6d7cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/41cb05d3c0bc79154577310cba5e527648e6d7cb/search.py
print code
code= """def %(methodName)s (self, control, *ignore): print control.value self.value.%(methodName)s(control.value)"""
e2752afa2d8bcde35c45a1444c141bf3c9ca542b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e2752afa2d8bcde35c45a1444c141bf3c9ca542b/testController.py
print dir(CountryEditor)
def __init__(self, *a, **kw): print dir(CountryEditor) return super(CountryEditor, self).__init__(*a, **kw)
e2752afa2d8bcde35c45a1444c141bf3c9ca542b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e2752afa2d8bcde35c45a1444c141bf3c9ca542b/testController.py
self.widget.newModel (Country)
self.widget.newModel (self.widget, Country)
def testNew (self): self.widget.newModel (Country) self.assert_ (isinstance (self.widget.value, Country))
e2752afa2d8bcde35c45a1444c141bf3c9ca542b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e2752afa2d8bcde35c45a1444c141bf3c9ca542b/testController.py
def values(cls, trans, **qual): ans = trans.search(cls, **qual) return ans values = classmethod(values)
def setattr(self, attr, value): """ Find the attribute referred to by 'attr', and set it to 'value'. """ pos = attr.rfind('.') if pos > -1: path = attr[:pos] attr = attr[pos+1:] obj = traverse(self, path) else: obj = self return setattr(obj, attr, value)
991e416fa170c99b3ea68287cf3b8cee613b62d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/991e416fa170c99b3ea68287cf3b8cee613b62d7/__init__.py
self.trans= Transaction ()
self.trans = Transaction()
def __init__(self, **kw): super(StockAdjustmentWindow, self).__init__(**kw) self.win.title = "Stock Adjustment" self.trans= Transaction () v= cimarron.skin.VBox (parent=self.win)
c0d18c8c0cfdd3b0f886fc17bf603bce222b7184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/c0d18c8c0cfdd3b0f886fc17bf603bce222b7184/stockAdjustment.py
v= cimarron.skin.VBox (parent=self.win)
v = cimarron.skin.VBox(parent=self.win)
def __init__(self, **kw): super(StockAdjustmentWindow, self).__init__(**kw) self.win.title = "Stock Adjustment" self.trans= Transaction () v= cimarron.skin.VBox (parent=self.win)
c0d18c8c0cfdd3b0f886fc17bf603bce222b7184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/c0d18c8c0cfdd3b0f886fc17bf603bce222b7184/stockAdjustment.py
def save(self, ignore):
def save(self, *ignore):
def save(self, ignore): self.trans.save()
c0d18c8c0cfdd3b0f886fc17bf603bce222b7184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/c0d18c8c0cfdd3b0f886fc17bf603bce222b7184/stockAdjustment.py
def discard(self, ignore):
def discard(self, *ignore):
def discard(self, ignore): self.trans.discard() self.stockEditor.refresh()
c0d18c8c0cfdd3b0f886fc17bf603bce222b7184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/c0d18c8c0cfdd3b0f886fc17bf603bce222b7184/stockAdjustment.py
print 'total amount ', self.amount super(Invoice, self).addToDetails(detail) print 'here', addToDetails
def addToDetails(self, detail): self.amount += detail.amount print 'total amount ', self.amount super(Invoice, self).addToDetails(detail)
a28febbfe3021b3cd4a223c186691a994409109b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/a28febbfe3021b3cd4a223c186691a994409109b/document.py
print 'total amount ', self.amount super(Invoice, self).removeFromDetails(detail)
def removeFromDetails(self, detail): self.amount -= detail.amount print 'total amount ', self.amount super(Invoice, self).removeFromDetails(detail)
a28febbfe3021b3cd4a223c186691a994409109b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/a28febbfe3021b3cd4a223c186691a994409109b/document.py
self.trans= Transaction ()
self.trans = Transaction()
def __init__(self, **kw): super(StockAdjustmentWindow, self).__init__(**kw) self.win.title = "Stock Adjustment" self.trans= Transaction () v= cimarron.skin.VBox (parent=self.win)
df5d1f9f4f5184fda279169a100cc2898d5fd1b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/df5d1f9f4f5184fda279169a100cc2898d5fd1b8/stockAdjustment.py
v= cimarron.skin.VBox (parent=self.win)
v = cimarron.skin.VBox(parent=self.win)
def __init__(self, **kw): super(StockAdjustmentWindow, self).__init__(**kw) self.win.title = "Stock Adjustment" self.trans= Transaction () v= cimarron.skin.VBox (parent=self.win)
df5d1f9f4f5184fda279169a100cc2898d5fd1b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/df5d1f9f4f5184fda279169a100cc2898d5fd1b8/stockAdjustment.py
def save(self, ignore):
def save(self, *ignore):
def save(self, ignore): self.trans.save()
df5d1f9f4f5184fda279169a100cc2898d5fd1b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/df5d1f9f4f5184fda279169a100cc2898d5fd1b8/stockAdjustment.py
def discard(self, ignore):
def discard(self, *ignore):
def discard(self, ignore): self.trans.discard() self.stockEditor.refresh()
df5d1f9f4f5184fda279169a100cc2898d5fd1b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/df5d1f9f4f5184fda279169a100cc2898d5fd1b8/stockAdjustment.py
def _schedule(timeout, callback, repeat=False): def cb(): gobject.timeout_add(timeout, callback) if repeat: cb() cb()
def _schedule(timeout, callback, repeat=0): if repeat: def cb(): callback() gobject.timeout_add(timeout, cb) else: cb = callback gobject.timeout_add(timeout, cb)
def _schedule(timeout, callback, repeat=False): def cb(): gobject.timeout_add(timeout, callback) if repeat: cb() cb()
20c9965c2a51a3c0fe53bec28222516565f18c9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/20c9965c2a51a3c0fe53bec28222516565f18c9a/__init__.py
size, prec= numeric.group (1, 2)
prec, size= numeric.group (1, 2)
def field (self, field): fieldName= self.__fieldName__ (field.name) contents= ["'%s'" % fieldName] try: try: relation= field.get_reference () type= 'RToOne' contents+= ["'%s'" % self.__tableName__ (relation.name)] if field.inverse: # contents+= ["inverse='%s'" % self.__pluralFieldName__ (field.inverse)] contents+= ["in...
e1a38513f719fbb64c93dcd5555b423cd4c6dc53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e1a38513f719fbb64c93dcd5555b423cd4c6dc53/Mod.py
v = cimarron.skin.VBox(parent=self.window) h1 = cimarron.skin.HBox(parent=v) h2 = cimarron.skin.HBox(parent=v)
v = cimarron.skin.VBox(parent=self.window, expand=True, fill=True) h1 = cimarron.skin.HBox(parent=v, expand=False, fill=True) h2 = cimarron.skin.HBox(parent=v, expand=False, fill=False)
def __init__(self, **kw): super(ReceiptWindow, self).__init__(**kw) self.window.title = "Receipt Generation" self.trans = Transaction() self.target=Receipt(date=today()) self.trans.track(self.target)
50e48369c1dddb3f535319a763d5fce37976474a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/50e48369c1dddb3f535319a763d5fce37976474a/receipt.py
actionContainer = cimarron.skin.HBox(parent=v)
actionContainer = cimarron.skin.HBox(parent=v, expand=False, fill=False)
def __init__(self, **kw): super(ReceiptWindow, self).__init__(**kw) self.window.title = "Receipt Generation" self.trans = Transaction() self.target=Receipt(date=today()) self.trans.track(self.target)
50e48369c1dddb3f535319a763d5fce37976474a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/50e48369c1dddb3f535319a763d5fce37976474a/receipt.py
onAction= self.updateData,
onAction= self.selected,
def refresh (self): for i in xrange (len (self.data)): if len (self.labels)<=i: # the row does not exist, so we add it h= cimarron.skin.HBox (parent=self.widget) b= cimarron.skin.Label ( parent= h, text= ' ', row= i )
e1fb1b82adbe070d6396621e5d155280b09af156 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e1fb1b82adbe070d6396621e5d155280b09af156/__init__.py
entry.onAction ()
self.updateData (entry)
def will_focus_out (self, entry, *ignore): entry.onAction ()
e1fb1b82adbe070d6396621e5d155280b09af156 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/e1fb1b82adbe070d6396621e5d155280b09af156/__init__.py
def concreteParenter (self, child): super (Notebook, self).concreteParenter (child)
def _concreteParenter (self, child): super (Notebook, self)._concreteParenter (child)
def concreteParenter (self, child): super (Notebook, self).concreteParenter (child) if getattr (child, '_widget', None): label= gtk.Label() label.set_text (child.label) self._widget.set_tab_label (child._widget, label)
b08ab555c65e5b53b2c9a0972daaec1a4102d712 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/b08ab555c65e5b53b2c9a0972daaec1a4102d712/container.py
for aRow in [[['7', self.numberButton], ['4', self.numberButton], ['1', self.numberButton], ['C', self.clear]], [['8', self.numberButton], ['5', self.numberButton], ['2', self.numberButton], ['0', self.numberButton]], [['9', self.numberButton], ['6', self.numberButton], ['3', self.numberButton], ['.', self.numberButton...
for aRow in ((('7', self.numberButton), ('4', self.numberButton), ('1', self.numberButton), ('C', self.clear)), (('8', self.numberButton), ('5', self.numberButton), ('2', self.numberButton), ('0', self.numberButton)), (('9', self.numberButton), ('6', self.numberButton), ('3', self.numberButton), ('.', self.numberButton...
def __init__(self, **kw): super(CalculatorController, self).__init__(**kw) self.win.title = 'Calculator' vbox = cimarron.skin.VBox(parent=self.win) self.display = cimarron.skin.Label(parent=vbox, text='0') hbox = cimarron.skin.HBox(parent=vbox) for aRow in [[['7', self.numberButton], ['4', self.numberButton], ['1', sel...
bfdbd0cfbc563ae1233f45c62dbb1dee16054b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/bfdbd0cfbc563ae1233f45c62dbb1dee16054b81/calculator.py
if self.op == None: self.X = float(self.display.text) else: if self.op == '+': self.X = self.X + float(self.display.text) elif self.op == '-': self.X = self.X - float(self.display.text) elif self.op == '*': self.X = self.X * float(self.display.text) elif self.op == '/': self.X = self.X / float(self.display.text) self.d...
val = float(self.display.text) if self.op is not None: val = self.op(self.X, val) self.display.text = str(val) self.resetInput = True self.X = val self.op = self.operations[sender.label]
def operate(self, sender=None): if not self.resetInput: if self.op == None: self.X = float(self.display.text) else: if self.op == '+': self.X = self.X + float(self.display.text) elif self.op == '-': self.X = self.X - float(self.display.text) elif self.op == '*': self.X = self.X * float(self.display.text) elif self.op =...
bfdbd0cfbc563ae1233f45c62dbb1dee16054b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/bfdbd0cfbc563ae1233f45c62dbb1dee16054b81/calculator.py
search= crud.newChild (None, 'Search', None)
search= crud.newChild (None, 'SearchEntry', None)
def export(self, xot, **opts): """return the xml document to create the screen represented by the xot""" self.xot= xot
615d4783694081a61062f380e45f479cfeadf918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/615d4783694081a61062f380e45f479cfeadf918/CimarronXMLui.py
search.setProp ('searcher', KindName)
search.setProp ('cls', KindName)
def export(self, xot, **opts): """return the xml document to create the screen represented by the xot""" self.xot= xot
615d4783694081a61062f380e45f479cfeadf918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/615d4783694081a61062f380e45f479cfeadf918/CimarronXMLui.py
def export(self, xot, **opts): """return the xml document to create the screen represented by the xot""" self.xot= xot
615d4783694081a61062f380e45f479cfeadf918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/615d4783694081a61062f380e45f479cfeadf918/CimarronXMLui.py
entry.setProp ('name', FieldName)
entry.setProp('name', FieldName)
def makeTab (self, xmlObj, crud): kind_name= xmlObj.prop ('name') KindName= MakeFieldName (kind_name) kind = self.xot.tables[kind_name]
615d4783694081a61062f380e45f479cfeadf918 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/615d4783694081a61062f380e45f479cfeadf918/CimarronXMLui.py
for aRow in ((('7', self.numberButton), ('4', self.numberButton), ('1', self.numberButton), ('C', self.clear)), (('8', self.numberButton), ('5', self.numberButton), ('2', self.numberButton), ('0', self.numberButton)), (('9', self.numberButton), ('6', self.numberButton), ('3', self.numberButton), ('.', self.numberButton...
for aRow in (({'label': '7', 'onAction': self.numberButton}, {'label': '4', 'onAction': self.numberButton}, {'label': '1', 'onAction': self.numberButton}, {'label': 'C', 'onAction': self.clear}), ({'label': '8', 'onAction': self.numberButton}, {'label': '5', 'onAction': self.numberButton}, {'label': '2', 'onAction': se...
def __init__(self, **kw): super(CalculatorController, self).__init__(**kw) self.win.title = 'Calculator' vbox = cimarron.skin.VBox(parent=self.win) self.display = cimarron.skin.Label(parent=vbox, text='0') hbox = cimarron.skin.HBox(parent=vbox) for aRow in ((('7', self.numberButton), ('4', self.numberButton), ('1', sel...
27e16bbdd0150637761796a1255cdc8f3b935731 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/27e16bbdd0150637761796a1255cdc8f3b935731/calculator.py
for aLabel, anAction in aRow: cimarron.skin.Button(parent=vbox, label=aLabel, onAction=anAction)
for parms in aRow: cimarron.skin.Button(parent=vbox, **parms)
def __init__(self, **kw): super(CalculatorController, self).__init__(**kw) self.win.title = 'Calculator' vbox = cimarron.skin.VBox(parent=self.win) self.display = cimarron.skin.Label(parent=vbox, text='0') hbox = cimarron.skin.HBox(parent=vbox) for aRow in ((('7', self.numberButton), ('4', self.numberButton), ('1', sel...
27e16bbdd0150637761796a1255cdc8f3b935731 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/27e16bbdd0150637761796a1255cdc8f3b935731/calculator.py
operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.div }
def clear(self, sender=None): self.op = None self.display.text = '0' self.X = 0 self.resetInput = True
27e16bbdd0150637761796a1255cdc8f3b935731 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/27e16bbdd0150637761796a1255cdc8f3b935731/calculator.py
if not self.resetInput: val = float(self.display.text) if self.op is not None: val = self.op(self.X, val) self.display.text = str(val) self.resetInput = True self.X = val self.op = self.operations[sender.label]
try: if not self.resetInput: val = float(self.display.text) if self.op is not None: val = self.op(self.X, val) self.display.text = str(val) self.X = val self.resetInput = True self.op = sender.calcOp except: self.clear() self.display.text = '-- Error --'
def operate(self, sender=None): if not self.resetInput: val = float(self.display.text) if self.op is not None: val = self.op(self.X, val) self.display.text = str(val) self.resetInput = True self.X = val self.op = self.operations[sender.label]
27e16bbdd0150637761796a1255cdc8f3b935731 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/27e16bbdd0150637761796a1255cdc8f3b935731/calculator.py
Although currently a function, L{config} will probably become a class
Although currently a function, L{_config} will probably become a class
def _config(skin_name=DEFAULT_SKIN_NAME): """ Although currently a function, L{config} will probably become a class because we strongly suspect people will want to actually do some configuration loading here. In fact, one thing we learned while implementing the first Cimarrón is that a lot of functionality is actually...
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
and thus the only work done by L{config} is the choosing of the
and thus the only work done by L{_config} is the choosing of the
def _config(skin_name=DEFAULT_SKIN_NAME): """ Although currently a function, L{config} will probably become a class because we strongly suspect people will want to actually do some configuration loading here. In fact, one thing we learned while implementing the first Cimarrón is that a lot of functionality is actually...
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
class skin_module(new.module): def __repr__(self): return '<skin lazymodule %r>' % self.__name__ def __init__(self, *a, **kw): super(skin_module, self).__init__(*a, **kw)
class _lazy_skin_module(new.module): """ An instance of _lazy_skin_module stands in for the real skin module, and becomes a Borg of the real skin as soon as an unknown attribute is requested (i.e., as soon as __getattr__ is called). """
def _config(skin_name=DEFAULT_SKIN_NAME): """ Although currently a function, L{config} will probably become a class because we strongly suspect people will want to actually do some configuration loading here. In fact, one thing we learned while implementing the first Cimarrón is that a lot of functionality is actually...
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
def __getattr__(self, attr): # are we a hack, or what? _config() for k in self.__dict__: if k not in skin.__dict__: del self.__dict__[k] for k, v in skin.__dict__.items(): self.__dict__[k] = v return getattr(skin, attr)
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
for k in self.__dict__: if k not in skin.__dict__: del self.__dict__[k] for k, v in skin.__dict__.items(): self.__dict__[k] = v
self.__dict__.clear() self.__dict__.update(skin.__dict__)
def __getattr__(self, attr): # are we a hack, or what? _config() for k in self.__dict__: if k not in skin.__dict__: del self.__dict__[k] for k, v in skin.__dict__.items(): self.__dict__[k] = v return getattr(skin, attr)
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
skin = skin_module('fvl.cimarron.skin')
skin = _lazy_skin_module('<lazy>')
def __getattr__(self, attr): # are we a hack, or what? _config() for k in self.__dict__: if k not in skin.__dict__: del self.__dict__[k] for k, v in skin.__dict__.items(): self.__dict__[k] = v return getattr(skin, attr)
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
print skin
def __getattr__(self, attr): # are we a hack, or what? _config() for k in self.__dict__: if k not in skin.__dict__: del self.__dict__[k] for k, v in skin.__dict__.items(): self.__dict__[k] = v return getattr(skin, attr)
d1d89432891529a6990918d37e735aa901d7d247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/d1d89432891529a6990918d37e735aa901d7d247/__init__.py
def __init__(self, columns=None, **kwargs): from fvl.cimarron import skin if columns is None: columns = [] super(SelectionWindow, self).__init__(parent=self.parent, title='Select', size=(40, 25), **kwargs) vbox = skin.VBox(parent=self.window) self.grid = skin.SelectionGrid(parent=vbox, columns=columns, onAction=self.o...
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
def attributesToConnect(cls): """ See L{XmlMixin.attributesToConnect <fvl.cimarron.skins.common.XmlMixin.attributesToConnect>} """ attrs = super (Search, cls).attributesToConnect() return attrs+['searcher']
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
def _set_columns(self, columns): logger.debug (`columns`) if columns is not None: from fvl.cimarron.skin import Label, Button for column in columns: # build label and entry Label(text=column.name+":", parent=self.h) entryConstr = column.entry entry = entryConstr(parent=self.h, onAction=self.search) entry.delegates.appe...
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
logger.debug ('searching %r, %r', self.searcher, qual)
logger.debug ('searching %r, %r', self.cls, qual)
def doSearch(self, *ignore): """ Performs the abstract search. The result ends up in aSearch.value as a list and returns the length of the list. """ self.window.disable() try: qual = None for i in xrange(len(self.columns)): e = self.entries[i] if e.value != '' and e.value is not None: value = e.value c = self.columns[i...
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
def selectedValue(cell, path, colNo, *ignore): logger.debug(self.value) # update the grid grid._cell_edited(cell, path, self.value, colNo)
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
def _get_columns(self): return super(SearchEntry, self)._get_columns()
6a130e3d6ff5446572b3b36238ccc17f6f0d4d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/6a130e3d6ff5446572b3b36238ccc17f6f0d4d13/search.py
def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self.name)
f1ddec9dc0a05f4c8280145d7333fa729d8d4e64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/f1ddec9dc0a05f4c8280145d7333fa729d8d4e64/__init__.py
L{Control} is...
L{Control} is a Widget that can be interacted with. L{Control}s have an action, that is a callback that is called when a L{Control}-specific event happens. For example, L{Button<gtk2.Button>}s fire the action when you press or click them, whereas L{Entry<gtk2.Entry>}s do so when they have focus and enter is pressed, or...
def skeleton(self, parent=None): skel = super(Container, self).skeleton(parent) for child in self.children: child.skeleton(skel) return skel
f1ddec9dc0a05f4c8280145d7333fa729d8d4e64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/f1ddec9dc0a05f4c8280145d7333fa729d8d4e64/__init__.py
theReceipt = Receipt() self.target = theReceipt self.trans.track(theReceipt)
self.target=Receipt(date=today()) self.trans.track(self.target)
def __init__(self, **kw): super(ReceiptWindow, self).__init__(**kw) self.win.title = "Receipt Generation" self.trans = Transaction() #self.commitValue(Receipt()) theReceipt = Receipt() self.target = theReceipt #self.target = Receipt() #self.trans.track(self.value) self.trans.track(theReceipt)
3a466567f02cb91d8e0a7f8a79ff6322f7092fad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/3a466567f02cb91d8e0a7f8a79ff6322f7092fad/receipt.py
self.target = None self.refresh()
self.newTarget(Receipt(date=today())) self.trans.track(self.target)
def discard(self, *ignore): self.trans.discard() self.target = None self.refresh()
3a466567f02cb91d8e0a7f8a79ff6322f7092fad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/3a466567f02cb91d8e0a7f8a79ff6322f7092fad/receipt.py
self.target = dict(foo=1, bar=2, baz=3)
def setUp (self): self.target = dict(foo=1, bar=2, baz=3)
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self.widget= FooController (parent=self.win, target=self.target) self.value= 'quux:5' self.attribute= None
self.widget= FooController (parent=self.win) self.setUpControl (dict(foo=1, bar=2, baz=3), None)
def setUp (self): self.target = dict(foo=1, bar=2, baz=3)
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self.widget.target = dict(quux='-13')
self.widget.newTarget (dict(quux='-13'))
def testSetValue(self): """ This assumes that setting the value re-fires refresh() """ self.widget.entry.value = 'quux' self.widget.target = dict(quux='-13') self.assertEqual(self.widget.label.text, '-13')
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self.widget.target= self.target= Person ( "Freeman", "Newman",
person= Person ("Freeman", "Newman",
def setUp (self): super (TestCRUDController, self).setUp () self.widget= CRUDController.fromXmlFile ('test/testCrud.xml') self.widget.parent= self.parent= self.app self.widget.target= self.target= Person ( "Freeman", "Newman", [Address (text="San luis 870"), Address (text="San luis 594 2D")] ) self.attribute= 'name' se...
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self.attribute= 'name' self.value= 'Freeman'
self.setUpControl (target= person)
def setUp (self): super (TestCRUDController, self).setUp () self.widget= CRUDController.fromXmlFile ('test/testCrud.xml') self.widget.parent= self.parent= self.app self.widget.target= self.target= Person ( "Freeman", "Newman", [Address (text="San luis 870"), Address (text="San luis 594 2D")] ) self.attribute= 'name' se...
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self.widget.target= self.target
def testRefresh (self): self.widget.target= self.target self.assertEqual (self.widget.editors[0].target, self.target) self.assertEqual (self.widget.editors[1].target, self.target.getAddresses ())
4311476e20bdff0a323cee73480da6acc1fbeb0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/4311476e20bdff0a323cee73480da6acc1fbeb0f/testController.py
self._innerWidget = self.note._outerWidget
def __init__ (self, cls=None, searchColumns=None, editorClass=None, filename=None, store=None, **kwargs): from fvl.cimarron.skin import Notebook, VBox, Button
fbef1a24e27f0cfbfb285fdb5468026f1c27622c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/fbef1a24e27f0cfbfb285fdb5468026f1c27622c/crud.py
"S simple query interface."
"A simple query interface."
def search(query, operator='and'): """Execute a search given by 'query' as a list/tuple of filter ids. 'operator' can be 'and' or 'or' to search for matches in all or any filter.
ba4de4148895ac9a58f1754954826b1d75e25b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9704/ba4de4148895ac9a58f1754954826b1d75e25b2a/__init__.py
import re
def _text2list(text): # Helper: splitter input may be a string or a list of strings try: text + u"" except: return text else: return [text]
133243cd975aac6c417bc6495b12d36fb924cdeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9704/133243cd975aac6c417bc6495b12d36fb924cdeb/lexicon.py
docu = re.compile(r' *<h2> (Documentation |Inheritance:)</h2>') public = re.compile(r'<DT><h3>Public')
docu = re.compile(r' *<h2> (Documentation|Inheritance) </h2>') public = re.compile(r'<DL>\s*?<DT><B><BR>Public')
headingTypedef = re.compile(r'typedef')
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra.gif"></a>' \ r'</th></tr>\n</table>\n'
r'<th align=right ><a href="index.html">' + vigraLogo + \ r'</a></th></tr>\n</table>\n'
headingTypedef = re.compile(r'typedef')
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
r'<IMG BORDER=0 SRC="documents/pfeilGross.gif"></A>\n' \ r'</th>\n<th width=100%><font size="+2">' docuReplacement = r'<table bgcolor=" r'<th align=left ><font size=+2> \1 </font></th>\n' \ r'<tr>\n</table>' publicReplacement = r'</DL></DL>\n' \ r'<table bgcolor=" r'<th align=left ><font size=+2> Members </font></th>...
r'<IMG BORDER=0 ALT="details" SRC="documents/pfeilGross.gif"></A>\n' \ r'</th>\n<th width="100%"><font size="+2">' docuReplacement = r'<table bgcolor=" r'<th align=left ><font size="+2"> \1 </font></th>\n' \ r'</tr>\n</table>' publicReplacement = r'<table bgcolor=" r'<th align=left ><font size="+2"> Member Index </fo...
headingTypedef = re.compile(r'typedef')
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
text = arrow.sub(r'<IMG BORDER=0 SRC="documents/pfeil.gif"></A>', text) text = bullet.sub(r'<IMG BORDER=0 SRC="documents/bullet.gif">', text)
text = arrow.sub(r'<IMG BORDER=0 ALT="+" SRC="documents/pfeil.gif"></A>', text) text = bullet.sub(r'<IMG BORDER=0 ALT="-" SRC="documents/bullet.gif">', text)
def convertBody(text): text = body.sub(bodyReplacement, text, 1) text = callOperator.sub(r'operator()', text) text = tag.sub(r'<\1>', text) text = atag.sub(r'<a name="\1">', text) text = umlaut.sub(r'&\1;', text) text = squared.sub(r'&#178', text) text = cube.sub(r'&#179', text) text = footer.sub(r'', text, 1) text = s...
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
r'<table bgcolor=" r'<th align=left width=100%><font size=+3>Table of Contents</font></th>\n' \ r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra.gif"></a>' \ r'<tr>\n</table>',
r'<table bgcolor=" r'<th align=left width="100%"><font size="+3">Table of Contents</font></th>\n' \ r'<th align=right ><a href="index.html">' + vigraLogo + \ r'</a><tr>\n</table>',
def convertAIndex(text): text = re.sub(r'<H2>Variables</H2>', r'<H2>typedefs</H2>', text) text = re.sub(r'<H1>Table of contents</H1>', r'<table bgcolor="#e0d090" width=100% cellpadding=5>\n<tr>\n' \ r'<th align=left width=100%><font size=+3>Table of Contents</font></th>\n' \ r'<th align=right ><a href="index.html"><IM...
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
r'<table bgcolor=" r'<th align=left width=100%><font size=+3>\1</font></th>\n' \ r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra.gif"></a>' \ r'<tr>\n</table>',
r'<table bgcolor=" r'<th align=left width="100%"><font size="+3">\1</font></th>\n' \ r'<th align=right ><a href="index.html">' + vigraLogo + \ r'</a><tr>\n</table>',
def convertHIER(text): text = re.sub(r'<H1>(.*?)</H1>', r'<table bgcolor="#e0d090" width=100% cellpadding=5>\n<tr>\n' \ r'<th align=left width=100%><font size=+3>\1</font></th>\n' \ r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra.gif"></a>' \ r'<tr>\n</table>', text) return text
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
text = heading.sub(newHeadingText, text)
text = heading.sub(newHeadingText, text)
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() text = convertBody(text) if fileName == str(sys.argv[1]) + '/index.html': text = convertIndex(text, str(sys.argv[2])) if fileName == str(sys.argv[1]) + '/aindex.html': text = convertAIndex(text) elif fileName == str(sys.argv[1]) + ...
6a37979285b6676bcc5235bfce9be42497c36af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/6a37979285b6676bcc5235bfce9be42497c36af8/postprocessing.py
text = heading.sub( r'<table cellpadding=5 bgcolor=" r'</font></th>\n' + r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra3.gif"></a>' + r'</th></tr>\n</table>\n', text) text = headingArrow.sub( r'<th align=right valign=top>\n' + r'<br><A HREF =" r'<IMG BORDER=0 width=30 height=20 SRC="document...
text = heading.sub(headingTableReplacement, text) text = headingArrow.sub(headingArrowReplacement, text)
def convertHeading(text): # create a table for the heading (with down arrow at left and VIGRA logo at right) text = heading.sub( r'<table cellpadding=5 bgcolor="#e0d090">\n<tr>\n\1\n' + r'</font></th>\n' + r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra3.gif"></a>' + r'</th></tr>\n</table>\n'...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
text = docu.sub(r'<table bgcolor=" r'<th align=left ><font size=+2> \1 </font></th>\n' + r'<tr>\n</table>', text) text = public.sub(r'</DL></DL>\n' + r'<table bgcolor=" r'<th align=left ><font size=+2> Members </font></th>\n' + r'<tr>\n</table>\n' + r'<DL><DL>\n<DT><h3>Public', text, 1) text = arrow.sub(r'<IMG BORDER...
text = docu.sub(docuReplacement, text) text = public.sub(publicReplacement, text, 1) text = arrow.sub(r'<IMG BORDER=0 SRC="documents/pfeil.gif"></A>', text) text = bullet.sub(r'<IMG BORDER=0 SRC="documents/bullet.gif">', text) text = bullet2.sub('', text) text = fixDocBaselinkBug(text)
def convertBody(text): text = body.sub(r'<body bgcolor="#f8f0e0" link="#0040b0" vlink="#a00040">', text, 1) text = callOperator.sub(r'operator()', text) text = tag.sub(r'<\1>', text) text = atag.sub(r'<a name="\1">', text) text = umlaut.sub(r'&\1;', text) text = squared.sub(r'&#178', text) text = cube.sub(r'&#179', te...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
def convertBody(text): text = body.sub(r'<body bgcolor="#f8f0e0" link="#0040b0" vlink="#a00040">', text, 1) text = callOperator.sub(r'operator()', text) text = tag.sub(r'<\1>', text) text = atag.sub(r'<a name="\1">', text) text = umlaut.sub(r'&\1;', text) text = squared.sub(r'&#178', text) text = cube.sub(r'&#179', te...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
return re.sub(r'<H2>Variables</H2>', r'<H2>typedefs</H2>', text)
text = re.sub(r'<H2>Variables</H2>', r'<H2>typedefs</H2>', text) text = re.sub(r'<H1>Table of contents</H1>', r'<table bgcolor=" r'<th align=left width=100%><font size=+3>Table of Contents</font></th>\n' \ r'<th align=right ><a href="index.html"><IMG border=0 SRC="documents/vigra.gif"></a>' \ r'<tr>\n</table>', text) ...
def convertAIndex(text): return re.sub(r'<H2>Variables</H2>', r'<H2>typedefs</H2>', text)
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text)
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text) text = convertBody(text) if fileName == str(sys.argv[1]) + '/aindex.html': text = convertAIndex(text) if fileName ...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
if fileName == str(sys.argv[1]) + '/index.html': text = convertIndex(text, str(sys.argv[2]))
elif fileName == str(sys.argv[1]) + '/HIER.html': text = convertHIER(text) else: headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text)
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text) text = convertBody(text) if fileName == str(sys.argv[1]) + '/aindex.html': text = convertAIndex(text) if fileName ...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() headingText = findHeading(text) newHeadingText = convertHeading(headingText) text = heading.sub(newHeadingText, text) text = convertBody(text) if fileName == str(sys.argv[1]) + '/aindex.html': text = convertAIndex(text) if fileName ...
d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/d5a8b3ed8a73c01dabe549211dd2f52c0d2cde00/postprocessing.py
m = re.search(r'Declarations?:[^\(]*?\s*([a-zA-Z_][a-zA-Z_0-9]*) *\(', t)
m = re.search(r'Declarations?:[^\(]*?(\s*<a class="code"[^>]*>|\s*)([a-zA-Z_][a-zA-Z_0-9]*)(</a>| *)\(', t)
def findExplicitDeclarations(text): decl = {} t = text while len(t): m = re.search(r'Declarations?:[^\(]*?\s*([a-zA-Z_][a-zA-Z_0-9]*) *\(', t) if not m: break decl[m.groups()[0]] = 1 t = t[m.end():] t = "" for i in decl.keys(): t = t + i + "|" if t: return "(" + t[:-1] + ")" else: return None
88c123fa13334051c00d12e743af5ddd88d74756 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/88c123fa13334051c00d12e743af5ddd88d74756/post.py
decl[m.groups()[0]] = 1
decl[m.groups()[1]] = 1
def findExplicitDeclarations(text): decl = {} t = text while len(t): m = re.search(r'Declarations?:[^\(]*?\s*([a-zA-Z_][a-zA-Z_0-9]*) *\(', t) if not m: break decl[m.groups()[0]] = 1 t = t[m.end():] t = "" for i in decl.keys(): t = t + i + "|" if t: return "(" + t[:-1] + ")" else: return None
88c123fa13334051c00d12e743af5ddd88d74756 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/88c123fa13334051c00d12e743af5ddd88d74756/post.py
text = re.sub(r'(<td nowrap align=right valign=top>template&lt;).*?(&gt;.*?)'+declPattern+r'(.*?</tr>)', r'\1...\2\3\4', text)
text = re.sub(r'(<td nowrap align=right valign=top>template&lt;).*?(&gt;.*?)'+declPattern+\ r'(.*?</tr>)', r'\1...\2\3\4', text)
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() text = convertHeader(text) if not re.search(r'.*source.html', fileName): text = convertPage(text) else: text = convertSource(text) if re.search(r'.*/group__.*html', fileName): text = typedefField.sub(r'<br><b>&nbsp;\1</b><br>&nbsp;'...
88c123fa13334051c00d12e743af5ddd88d74756 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/88c123fa13334051c00d12e743af5ddd88d74756/post.py
r'<tr>\s*<td class="md".*?>(.*?)'+declPattern+r' *</td>.*?</table>', re.S)
r'<tr>\s*<td class="md"[^>]*>([^<]*?)'+declPattern+r' *</td>.*?</table>', re.S)
def processFile(fileName): print fileName f = open(fileName) text = f.read() f.close() text = convertHeader(text) if not re.search(r'.*source.html', fileName): text = convertPage(text) else: text = convertSource(text) if re.search(r'.*/group__.*html', fileName): text = typedefField.sub(r'<br><b>&nbsp;\1</b><br>&nbsp;'...
88c123fa13334051c00d12e743af5ddd88d74756 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12582/88c123fa13334051c00d12e743af5ddd88d74756/post.py
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE)
def go(self): glutInitWindowSize(500,500) glutInitWindowPosition(100,100) glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE) self.win = glutCreateWindow("iSink ROV Simulator") self.init() glutDisplayFunc(self.display) glutIdleFunc(self.doframe) self.thistime = self.lastime = time() glutMainLoop()
957ed72a73bd3224bfedd991026790df56d4a3ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/957ed72a73bd3224bfedd991026790df56d4a3ef/sim.py
if ~config.has_section('locations'): raise 'Congfig file must have a \'location\' section'
if config.has_section('locations') is False: raise 'Congfig file must have a \'locations\' section'
def get_backup_info(config): """ @type configfile: ConfigParser @param configfile: The config file to read from @rtype: dictionary of tuples @return: Maps directory to a tuple of (src, days, weeks) Config file format: # Name directory pair [locations] trac = /var/backup/trac # Specifies a weekly and inremental # W...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
base_dir = os.path.split(path)[0]
def date_name(path): """ Takes a file specified by path and returns its name in strftime format %F_%T which is its last modified time """ # Get the modification time from the timestamp of the fill mod_time = datetime.fromtimestamp(os.stat(path).st_mtime) # Grab our parent directory base_dir = os.path.split(path)[0] # J...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
dated_path = os.path.join(base_dir, mod_time.strftime('%F_%T'))
return mod_time.strftime('%F_%T')
def date_name(path): """ Takes a file specified by path and returns its name in strftime format %F_%T which is its last modified time """ # Get the modification time from the timestamp of the fill mod_time = datetime.fromtimestamp(os.stat(path).st_mtime) # Grab our parent directory base_dir = os.path.split(path)[0] # J...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
if ~os.path.exists(path):
if os.path.exists(path) is False:
def ensure_path(path): """ Makes sure a path exists, and if it doesn't it will create it """ if ~os.path.exists(path): os.makedirs(path);
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
for (path, opts) in backup_tasks:
for path in backup_tasks.iterkeys(): raw_opts = backup_tasks[path] opts = (raw_opts[0], int(raw_opts[1]), int(raw_opts[2]))
def main(argv=None): # Parse are command line parser = OptionParser() parser.add_option("-c", "--config", dest="configfile", help="The location of config", default='etc/opt/backup.cfg') (options, args) = parser.parse_args() # Read the config file and pull out usefull information config = ConfigParser() config.read(o...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
if ~os.path.exists(src_path):
if os.path.exists(src_path) is False:
def main(argv=None): # Parse are command line parser = OptionParser() parser.add_option("-c", "--config", dest="configfile", help="The location of config", default='etc/opt/backup.cfg') (options, args) = parser.parse_args() # Read the config file and pull out usefull information config = ConfigParser() config.read(o...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
shutil.copytree(src_path, weekly_path + os.sep + date_name(src_dir))
shutil.copytree(src_path, weekly_path + os.sep + date_name(src_path))
def main(argv=None): # Parse are command line parser = OptionParser() parser.add_option("-c", "--config", dest="configfile", help="The location of config", default='etc/opt/backup.cfg') (options, args) = parser.parse_args() # Read the config file and pull out usefull information config = ConfigParser() config.read(o...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
opts[1] + 'D', incremental_path])
str(opts[1]) + 'D', incremental_path])
def main(argv=None): # Parse are command line parser = OptionParser() parser.add_option("-c", "--config", dest="configfile", help="The location of config", default='etc/opt/backup.cfg') (options, args) = parser.parse_args() # Read the config file and pull out usefull information config = ConfigParser() config.read(o...
73759f96700ef26063b5541b3befb24dbe11c3aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/73759f96700ef26063b5541b3befb24dbe11c3aa/backup.py
for loc in config.items('locations'): run_location(loc, config)
else: for loc in config.items('locations'): run_location(loc, config)
def run_config(configfile, location = None): """ Loads the config file and call run_location """ # Parse config file config = ConfigParser() config.optionxform = lambda x: x config.read(configfile) if not config.has_section('locations'): print 'ERROR: Configuration file: %s does not have a \'locations\'' \ ' section' %...
1114f4db0641f58732078070859c9e3038acdf1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/1114f4db0641f58732078070859c9e3038acdf1c/build-deps.py
run_config(config_path)
run_config(config_path, options.location)
def main(): # Parse are command line parser = OptionParser(description= \ 'This runs a config file that is basically a mapping of locations to'\ 'commands. Each command name for each location must be unique, see'\ 'test config in the tools/build-deps for an example') parser.add_option("-c", "--config", dest="configfil...
1114f4db0641f58732078070859c9e3038acdf1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10608/1114f4db0641f58732078070859c9e3038acdf1c/build-deps.py
def quote(str): return repr(str)
def quote(s): s = s.replace('\\', '\\\\') s = s.replace('\0', '\\0') s = s.replace('\b', '\\b') s = s.replace('\n', '\\n') s = s.replace('\r', '\\r') s = s.replace('\t', '\\t') s = s.replace('\z', '\\z') s = s.replace("'", "\\'") s = s.replace('"', '\\"') return "'" + s + "'"
def quote(str): return repr(str)
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
parent_id = 0 id = parent_id + 1 for entry in contents: id = dump_contents_entry(entry, id, parent_id) print ";"
id = dump_contents_entry(contents, 0, 1)
def dump_contents(contents): print "INSERT INTO `toc` (`book_id`, `parent_id`, `number`, `name`, `link`) VALUES" parent_id = 0 id = parent_id + 1 for entry in contents: id = dump_contents_entry(entry, id, parent_id) print ";" print "UPDATE `toc` SET `parent_id` = LAST_INSERT_ID() + `parent_id` - 1 WHERE `book_id` = @b...
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
def dump_contents_entry(entry, id, parent_id): print " (@book_id, %d, %d, %s, %s)," % (parent_id, entry.number, quote(entry.name.encode('utf-8')), quote(entry.link.encode('utf-8'))) parent_id = id
def dump_contents_entry(entry, parent_id, last):
def dump_contents_entry(entry, id, parent_id): print " (@book_id, %d, %d, %s, %s)," % (parent_id, entry.number, quote(entry.name.encode('utf-8')), quote(entry.link.encode('utf-8'))) parent_id = id id = parent_id + 1 for subentry in entry: id = dump_contents_entry(subentry, id, parent_id) return id
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
id = dump_contents_entry(subentry, id, parent_id)
sublast = last and subentry is entry[-1] print " (@book_id, %d, %d, %s, %s)%s" % (parent_id, subentry.number, quote(subentry.name.encode('utf-8')), quote(subentry.link.encode('utf-8')), (sublast and not len(subentry)) and ";" or ",") id = dump_contents_entry(subentry, id, sublast)
def dump_contents_entry(entry, id, parent_id): print " (@book_id, %d, %d, %s, %s)," % (parent_id, entry.number, quote(entry.name.encode('utf-8')), quote(entry.link.encode('utf-8'))) parent_id = id id = parent_id + 1 for subentry in entry: id = dump_contents_entry(subentry, id, parent_id) return id
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
print "INSERT INTO `pages` (book_id, path, data) VALUES" for path in archive.list(): data = archive.open(path).read() print " (@book_id, %s, %s)," % (quote(path.encode('utf-8')), quote(data)) print ";"
print "INSERT INTO `pages` (book_id, path, content) VALUES" paths = archive.list() for path in paths: last = path is paths[-1] content = archive.open(path).read() print " (@book_id, %s, %s)%s" % (quote(path.encode('utf-8')), quote(content), last and ';' or ',')
def dump_archive(archive): print "INSERT INTO `pages` (book_id, path, data) VALUES" for path in archive.list(): data = archive.open(path).read() print " (@book_id, %s, %s)," % (quote(path.encode('utf-8')), quote(data)) print ";"
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
import sys from DevHelp import factory
from HTB import factory
def main(): import sys from DevHelp import factory for arg in sys.argv[1:]: try: book = factory(arg) except: raise dump(book)
adb3c26509f0b66af6f7eff17f21f45a975409c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/adb3c26509f0b66af6f7eff17f21f45a975409c0/SQL.py
os.path.join(os.getenv('HOME'), '.devhelp2', 'books'),
os.path.join(os.getenv('HOME', ''), '.devhelp2', 'books'),
def __init__(self, search_path = None): Book.CachingFactory.__init__(self) self._search_path = [ os.path.join(os.getenv('HOME'), '.devhelp2', 'books'), '/usr/share/gtk-doc/html'] if search_path is not None: self._search_path.extend(search_path) self._path_hash = {}
a25bd38bd619231e6d4b473db100ff0a20d46438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/a25bd38bd619231e6d4b473db100ff0a20d46438/DevHelp.py
for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name)
if os.path.isdir(dir): for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name)
def enumerate_uncached(self): enum = Book.List() self._path_hash = {} for dir in self._search_path: for name in os.listdir(dir): spec = os.path.join(dir, name, name + '.devhelp') if os.path.isfile(spec): self._path_hash[name] = spec enum.append(name)
a25bd38bd619231e6d4b473db100ff0a20d46438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/a25bd38bd619231e6d4b473db100ff0a20d46438/DevHelp.py
item._parentref = weakred.ref(self)
item._parentref = weakref.ref(self)
def insert(self, index, item): item._parentref = weakred.ref(self) item.number = index + 1 self._children.insert(index, item) self._renumber()
2cb9c35020cc4f9e78a49164a155d0867080e25b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/2cb9c35020cc4f9e78a49164a155d0867080e25b/book.py
return self,_children[0]
return self._children[0]
def _get_children(self): """Get the first child."""
2cb9c35020cc4f9e78a49164a155d0867080e25b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2448/2cb9c35020cc4f9e78a49164a155d0867080e25b/book.py