bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def create(self, **propvalues): """Create a new node of this class and return its id. | def create(self, **propvalues): """Create a new node of this class and return its id. | 33,200 |
def create(self, **propvalues): """Create a new node of this class and return its id. | def create(self, **propvalues): """Create a new node of this class and return its id. | 33,201 |
def create(self, **propvalues): """Create a new node of this class and return its id. | def create(self, **propvalues): """Create a new node of this class and return its id. | 33,202 |
def create(self, **propvalues): """Create a new node of this class and return its id. | def create(self, **propvalues): """Create a new node of this class and return its id. | 33,203 |
def create(self, **propvalues): """Create a new node of this class and return its id. | def create(self, **propvalues): """Create a new node of this class and return its id. | 33,204 |
def get(self, nodeid, propname): """Get the value of a property on an existing node of this class. | def get(self, nodeid, propname): """Get the value of a property on an existing node of this class. | 33,205 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,206 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,207 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,208 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,209 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,210 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,211 |
def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 33,212 |
def retire(self, nodeid): """Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. """ nodeid = str(nodeid) if self.db... | def retire(self, nodeid): """Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. """ if self.db.journaltag is None:... | 33,213 |
def find(self, **propspec): """Get the ids of nodes in this class which link to a given node. | def find(self, **propspec): """Get the ids of nodes in this class which link to a given node. | 33,214 |
def find(self, **propspec): """Get the ids of nodes in this class which link to a given node. | def find(self, **propspec): """Get the ids of nodes in this class which link to a given node. | 33,215 |
def good_recipient(userid): # Make sure we don't send mail to either the anonymous # user or a user who has already seen the message. return (userid and (self.db.user.get(userid, 'username') != 'anonymous') and not seen_message.has_key(userid)) | def good_recipient(userid): # Make sure we don't send mail to either the anonymous # user or a user who has already seen the message. return (userid and (self.db.user.get(userid, 'username') != 'anonymous') and not seen_message.has_key(userid)) | 33,216 |
def send_message(self, nodeid, msgid, note, sendto, from_address=None, bcc_sendto=[]): '''Actually send the nominated message from this node to the sendto recipients, with the note appended. ''' users = self.db.user messages = self.db.msg files = self.db.file | def send_message(self, nodeid, msgid, note, sendto, from_address=None, bcc_sendto=[]): '''Actually send the nominated message from this node to the sendto recipients, with the note appended. ''' users = self.db.user messages = self.db.msg files = self.db.file | 33,217 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 33,218 |
def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... | def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... | 33,219 |
def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... | def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... | 33,220 |
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): ''' Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec | def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): ''' Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec | 33,221 |
def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... | def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... | 33,222 |
def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... | def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... | 33,223 |
def permission(self): """Check whether the user has permission to execute this action. | def permission(self): """Check whether the user has permission to execute this action. | 33,224 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | 33,225 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | 33,226 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | 33,227 |
def _changenode(self, cn, nodeid, props): """Change the node based on the contents of the form.""" # check for permission if not self.editItemPermission(props): raise Unauthorised, self._( 'You do not have permission to edit %(class)s' ) % {'class': cn} | def _changenode(self, cn, nodeid, props): """Change the node based on the contents of the form.""" # check for permission if not self.editItemPermission(props): raise exceptions.Unauthorised, self._( 'You do not have permission to edit %(class)s' ) % {'class': cn} | 33,228 |
def _createnode(self, cn, props): """Create a node based on the contents of the form.""" # check for permission if not self.newItemPermission(props): raise Unauthorised, self._( 'You do not have permission to create %(class)s' ) % {'class': cn} | def _createnode(self, cn, props): """Create a node based on the contents of the form.""" # check for permission if not self.newItemPermission(props): raise exceptions.Unauthorised, self._( 'You do not have permission to create %(class)s' ) % {'class': cn} | 33,229 |
def editItemPermission(self, props): """Determine whether the user has permission to edit this item. | def editItemPermission(self, props): """Determine whether the user has permission to edit this item. | 33,230 |
def handle(self): """Perform an edit of an item in the database. | def handle(self): """Perform an edit of an item in the database. | 33,231 |
def handle(self): ''' Add a new item to the database. | def handle(self): ''' Add a new item to the database. | 33,232 |
def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | 33,233 |
def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | 33,234 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,235 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,236 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,237 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,238 |
def load_extensions(self, parent, dirname): dirname = os.path.join(self.tracker_home, dirname) for name in os.listdir(dirname): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) | def load_extensions(self, parent, dirname): dirname = os.path.join(self.tracker_home, dirname) for name in os.listdir(dirname): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) | 33,239 |
def _add_granularity(src, order, value = 1): '''Increment first non-None value in src dictionary ordered by 'order' parameter ''' for gran in order: if src[gran]: src[gran] = int(src[gran]) + value break | def _add_granularity(src, order, value = 1): '''Increment first non-None value in src dictionary ordered by 'order' parameter ''' for gran in order: if src[gran]: src[gran] = int(src[gran]) + value break | 33,240 |
def __init__(self, spec='.', offset=0, add_granularity=0): """Construct a date given a specification and a time zone offset. | def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset. | 33,241 |
def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | 33,242 |
def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | 33,243 |
def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | 33,244 |
def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... | 33,245 |
def get_mdays(year, month): if month == 2 and calendar.isleap(year): return 29 else: return calendar.mdays[month] | def get_mdays(year, month): if month == 2 and calendar.isleap(year): return 29 else: return calendar.mdays[month] | 33,246 |
def get_mdays(year, month): if month == 2 and calendar.isleap(year): return 29 else: return calendar.mdays[month] | def get_mdays(year, month): if month == 2 and calendar.isleap(year): return 29 else: return calendar.mdays[month] | 33,247 |
def __init__(self, spec, sign=1, allowdate=1, add_granularity=0): """Construct an interval given a specification.""" if type(spec) in (IntType, FloatType, LongType): self.from_seconds(spec) elif type(spec) in (StringType, UnicodeType): self.set(spec, allowdate=allowdate, add_granularity=add_granularity) else: if len(sp... | def __init__(self, spec, sign=1, allowdate=1, add_granularity=0, translator=i18n ): """Construct an interval given a specification.""" if type(spec) in (IntType, FloatType, LongType): self.from_seconds(spec) elif type(spec) in (StringType, UnicodeType): self.set(spec, allowdate=allowdate, add_granularity=add_granularit... | 33,248 |
def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year \s*((?P<m>\d+\s*)m)? # month \s*((?P<w>\d+\s*)w)? # week \s*((?P<d>\d+\s*)d)? # day \s*(((?P<H>\d+):(?P<M>\d+))?(:(?P<S>\d+))?)? # time \s*(?P<D> (\d\d\d\d[/-])?(\d\d?)?[/-](\d\d?)? ... | def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year \s*((?P<m>\d+\s*)m)? # month \s*((?P<w>\d+\s*)w)? # week \s*((?P<d>\d+\s*)d)? # day \s*(((?P<H>\d+):(?P<M>\d+))?(:(?P<S>\d+))?)? # time \s*(?P<D> (\d\d\d\d[/-])?(\d\d?)?[/-](\d\d?)? ... | 33,249 |
def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year \s*((?P<m>\d+\s*)m)? # month \s*((?P<w>\d+\s*)w)? # week \s*((?P<d>\d+\s*)d)? # day \s*(((?P<H>\d+):(?P<M>\d+))?(:(?P<S>\d+))?)? # time \s*(?P<D> (\d\d\d\d[/-])?(\d\d?)?[/-](\d\d?)? ... | def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year \s*((?P<m>\d+\s*)m)? # month \s*((?P<w>\d+\s*)w)? # week \s*((?P<d>\d+\s*)d)? # day \s*(((?P<H>\d+):(?P<M>\d+))?(:(?P<S>\d+))?)? # time \s*(?P<D> (\d\d\d\d[/-])?(\d\d?)?[/-](\d\d?)? ... | 33,250 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: s = self.ngettext("%(number)s year", "%(number)s years", self.year) % {'number': self.year} elif self.month or self.day > 28: _months = int(((self.month * 30) + self.day) / 30) s = self.ngettext("%(number)s month", "%(numbe... | 33,251 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,252 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,253 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,254 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,255 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,256 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,257 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,258 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,259 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,260 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,261 |
def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... | 33,262 |
def as_seconds(self): '''Calculate the Interval as a number of seconds. Months are counted as 30 days, years as 365 days. Returns a Long int. ''' n = self.year * 365L n = n + self.month * 30 n = n + self.day n = n * 24 n = n + self.hour n = n * 60 n = n + self.minute n = n * 60 n = n + self.second return n * self.sign | def as_seconds(self): '''Calculate the Interval as a number of seconds. Months are counted as 30 days, years as 365 days. Returns a Long int. ''' n = self.year * 365L n = n + self.month * 30 n = n + self.day n = n * 24 n = n + self.hour n = n * 60 n = n + self.minute n = n * 60 n = n + self.second return n * self.sign | 33,263 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,264 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,265 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,266 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,267 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,268 |
def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | def fixTimeOverflow(time): """ Handle the overflow in the time portion (H, M, S) of "time": (sign, y,m,d,H,M,S) Overflow and underflow will at most affect the _days_ portion of the date. We do not overflow days to months as we don't know _how_ to, generally. """ # XXX we could conceivably use this function for handlin... | 33,269 |
def __init__(self, spec, Type, allow_granularity=1, **params): """Initializes Range of type <Type> from given <spec> string. Sets two properties - from_value and to_value. None assigned to any of this properties means "infinitum" (-infinitum to from_value and +infinitum to to_value) | def __init__(self, spec, Type, allow_granularity=1, **params): """Initializes Range of type <Type> from given <spec> string. Sets two properties - from_value and to_value. None assigned to any of this properties means "infinitum" (-infinitum to from_value and +infinitum to to_value) | 33,270 |
def __init__(self, spec, Type, allow_granularity=1, **params): """Initializes Range of type <Type> from given <spec> string. Sets two properties - from_value and to_value. None assigned to any of this properties means "infinitum" (-infinitum to from_value and +infinitum to to_value) | def __init__(self, spec, Type, allow_granularity=1, **params): """Initializes Range of type <Type> from given <spec> string. Sets two properties - from_value and to_value. None assigned to any of this properties means "infinitum" (-infinitum to from_value and +infinitum to to_value) | 33,271 |
def __repr__(self): return "<Range %s>" % self.__str__() | def __repr__(self): return "<Range %s>" % self.__str__() | 33,272 |
def pretty(self, threshold=('d', 5)): ''' print up the date date using one of these nice formats.. < 1 minute < 15 minutes < 30 minutes < 1 hour < 12 hours < 1 day otherwise, return None (so a full date may be displayed) ''' if self.year or self.month > 2: return None if self.month: days = (self.month * 30) + self.day ... | def pretty(self, threshold=('d', 5)): ''' print up the date date using one of these nice formats.. < 1 minute < 15 minutes < 30 minutes < 1 hour < 12 hours < 1 day otherwise, return None (so a full date may be displayed) ''' if self.year or self.month > 2: return None if self.month: days = (self.month * 30) + self.day ... | 33,273 |
def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl... | def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: if isinstance(propclass, hyperdb.Link: value = [self.cl.get(self.nodeid, property)] else: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] i... | 33,274 |
def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl... | def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl... | 33,275 |
def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... | def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... | 33,276 |
def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... | def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... | 33,277 |
def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited | def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited | 33,278 |
def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited | def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited | 33,279 |
def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices | def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices | 33,280 |
def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices | def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices | 33,281 |
def __call__(self, m, search_text=None, filter=None, columns=None, sort=None, group=None): if m.group('name'): if m.group('name') in self.props: text = m.group('text') replace = self.__class__(self.globals, {}, self.props) return replace.go(text) else: return '' if m.group('display'): command = m.group('command') retur... | def __call__(self, m, search_text=None, filter=None, columns=None, sort=None, group=None): if m.group('name'): if m.group('name') in self.props: text = m.group('text') replace = self.__class__(self.globals, {}, self.props) return replace.go(text) else: return '' if m.group('display'): command = m.group('command') retur... | 33,282 |
def render(self, filterspec={}, search_text='', filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1, show_nodes=1): self.filterspec = filterspec | defrender(self,filterspec={},search_text='',filter=[],columns=[],sort=[],group=[],show_display_form=1,nodeids=None,show_customization=1,show_nodes=1):self.filterspec=filterspec | 33,283 |
def filter_section(self, template, search_text, filter, columns, group, all_filters, all_columns, show_customization): | deffilter_section(self,template,search_text,filter,columns,group,all_filters,all_columns,show_customization): | 33,284 |
def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] | def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] | 33,285 |
def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] | def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] | 33,286 |
def do_export(self, args): ""'''Usage: export [class[,class]] export_dir Export the database to colon-separated-value files. | def do_export(self, args): ""'''Usage: export [class[,class]] export_dir Export the database to colon-separated-value files. | 33,287 |
def do_export(self, args): ""'''Usage: export [class[,class]] export_dir Export the database to colon-separated-value files. | def do_export(self, args): ""'''Usage: export [class[,class]] export_dir Export the database to colon-separated-value files. | 33,288 |
def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | 33,289 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5, i18n=None): _ = get_translator(i18n) esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = insp... | 33,290 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape exc_info = [esc(str(value)) for value in sys.exc_info()[:2]] l = [_('<h1>Templating Error</h1>\n' '<p><b>%(exc_type)s</b>: %(exc_value)s</p>\n' '<p class="help">Debugging information follows</p>' ) % {'exc_type': exc_info[0], 'exc_value': exc_info[1]}, '<ol>',] from roundup.cgi.... | 33,291 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,292 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,293 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,294 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,295 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,296 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,297 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,298 |
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.