rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
return pt.render(self, None, None, **args) | result = pt.render(self, None, None, **args) self.additional_headers['Content-Type'] = pt.content_type return result | def renderContext(self): ''' Return a PageTemplate for the named page ''' name = self.classname extension = self.template pt = Templates(self.instance.config.TEMPLATES).get(name, extension) | 2f6b05e7d229b44e95d3fddb3c5e8e60912dfa5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/2f6b05e7d229b44e95d3fddb3c5e8e60912dfa5b/client.py |
if self.error_message or self.ok_message: date = time.time() - 1 else: date = time.time() + 5 | date = time.time() - 1 | def inner_main(self): '''Process a request. | 0a5db26522e012eb1738a81631cf7297e5d8a4ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/0a5db26522e012eb1738a81631cf7297e5d8a4ab/client.py |
if 'status' not in changed.keys(): | if not changed.has_key('status'): | def shownode(self, message=None): ''' display an item ''' cn = self.classname cl = self.db.classes[cn] | a1a7451aa9fa26b2fb243e35e35673895fa971aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a1a7451aa9fa26b2fb243e35e35673895fa971aa/cgi_client.py |
m.append(change_note) | if change_note: m.append(change_note) | def _post_editnode(self, nid, change_note=None): ''' do the linking and message sending part of the node creation ''' cn = self.classname cl = self.db.classes[cn] # link if necessary keys = self.form.keys() for key in keys: if key == ':multilink': value = self.form[key].value if type(value) != type([]): value = [value]... | a1a7451aa9fa26b2fb243e35e35673895fa971aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a1a7451aa9fa26b2fb243e35e35673895fa971aa/cgi_client.py |
for key in cl.properties.keys(): | keys = cl.properties.keys() keys.sort() for key in keys: | def do_display(self, args): '''Usage: display designator[,designator]* Show the property values for the given node(s). | 35e7ea339b99ea83ebe5af53740a231fa086a9e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/35e7ea339b99ea83ebe5af53740a231fa086a9e1/admin.py |
if group is not None and hasattr(os, 'getgid'): | if group is not None and hasattr(os, 'getuid'): | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 168ec20ad27ff76e3a2fe59398db8869a30cb93f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/168ec20ad27ff76e3a2fe59398db8869a30cb93f/roundup_server.py |
if not os.getgid() and user is not None: try: import pwd | if not os.getuid(): try: import grp | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 168ec20ad27ff76e3a2fe59398db8869a30cb93f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/168ec20ad27ff76e3a2fe59398db8869a30cb93f/roundup_server.py |
raise ValueError, _("Can't change groups - no pwd module") try: gid = pwd.getpwnam(user)[3] | raise ValueError, _("Can't change groups - no grp module") try: gid = grp.getgrnam(group)[2] | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 168ec20ad27ff76e3a2fe59398db8869a30cb93f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/168ec20ad27ff76e3a2fe59398db8869a30cb93f/roundup_server.py |
elif os.getgid() and user is not None: | elif os.getuid(): | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 168ec20ad27ff76e3a2fe59398db8869a30cb93f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/168ec20ad27ff76e3a2fe59398db8869a30cb93f/roundup_server.py |
db = os.path.join(self.dir, 'nodes.%s'%cn) bsddb3.btopen(db, 'n') db = os.path.join(self.dir, 'journals.%s'%cn) bsddb3.btopen(db, 'n') | for name in 'nodes.%s'%cn, 'journals.%s'%cn: try: os.remove(os.path.join(self.dir, name)) except os.error, error: if error.errno != errno.ENOENT: raise | def clear(self): for cn in self.classes.keys(): db = os.path.join(self.dir, 'nodes.%s'%cn) bsddb3.btopen(db, 'n') db = os.path.join(self.dir, 'journals.%s'%cn) bsddb3.btopen(db, 'n') | c97b167f52fc3ce94da2b37e79359cd137c3d2c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c97b167f52fc3ce94da2b37e79359cd137c3d2c4/back_bsddb3.py |
pretty = interval.pretty() if pretty is None: pretty = value.pretty() return pretty | return interval.pretty() | def do_reldate(self, property, pretty=0): ''' display a Date property in terms of an interval relative to the current date (e.g. "+ 3w", "- 2d"). | c5eb2de739ea1c52d999da1e02bc8f48339ccf63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c5eb2de739ea1c52d999da1e02bc8f48339ccf63/htmltemplate.py |
self.dex = Indexer('test-index') | self.dex = Indexer(db) | def setUp(self): if os.path.exists('test-index'): shutil.rmtree('test-index') os.mkdir('test-index') os.mkdir('test-index/files') from roundup.backends.indexer_dbm import Indexer self.dex = Indexer('test-index') self.dex.load_index() | 1f1f57233a8fc6f9a82cdc84875756f0899d5188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1f1f57233a8fc6f9a82cdc84875756f0899d5188/test_indexer.py |
if os.path.exists('text-index'): shutil.rmtree('text-index') | if os.path.exists('test-index'): shutil.rmtree('test-index') os.mkdir('test-index') | def setUp(self): if os.path.exists('text-index'): shutil.rmtree('text-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | 1f1f57233a8fc6f9a82cdc84875756f0899d5188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1f1f57233a8fc6f9a82cdc84875756f0899d5188/test_indexer.py |
self.dex = Indexer('.') | self.dex = Indexer(db) | def setUp(self): if os.path.exists('text-index'): shutil.rmtree('text-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | 1f1f57233a8fc6f9a82cdc84875756f0899d5188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1f1f57233a8fc6f9a82cdc84875756f0899d5188/test_indexer.py |
shutil.rmtree('text-index') | shutil.rmtree('test-index') | def tearDown(self): shutil.rmtree('text-index') | 1f1f57233a8fc6f9a82cdc84875756f0899d5188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1f1f57233a8fc6f9a82cdc84875756f0899d5188/test_indexer.py |
def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis', pagesize=50, inputtype="checkbox", sort=None, filter=None): '''Pop up a javascript window with class help | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py | ||
def stext(self, escape=0): | def stext(self, escape=0, hyperlink=1): | def stext(self, escape=0): ''' Render the value of the property as StructuredText. | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py |
s = self.plain(escape=escape) | s = self.plain(escape=escape, hyperlink=hyperlink) | def stext(self, escape=0): ''' Render the value of the property as StructuredText. | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py |
def field(self, size = 30): | def field(self, **kwargs): | def field(self, size = 30): ''' Render the property as a field in HTML. | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py |
return self.input(name=self._formname,value=value,size=size) | kwargs.setdefault("size", 30) kwargs.update({"name": self._formname, "value": value}) return self.input(**kwargs) | def field(self, size = 30): ''' Render the property as a field in HTML. | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py |
def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py | ||
def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). | c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c8c3f4ef5b550e6c5029510af5d3e559c95e1b4b/templating.py | ||
for value in self._value: if value not in options: options.insert(0, value) | for val in value: if val not in options: options.insert(0, val) | def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value | 45b8e03e2b8a22c6ad8202a163e15f30ee0ad156 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/45b8e03e2b8a22c6ad8202a163e15f30ee0ad156/templating.py |
raise TypeError, 'new property "%s" not a string'%key | raise TypeError, \ 'new property "%(propname)s" not a string: %(value)r' \ % locals() | def import_list(self, propnames, proplist): ''' Import a node - all information including "id" is present and should not be sanity checked. Triggers are not triggered. The journal should be initialised using the "creator" and "created" information. | d3582d039ea3b315eea8e00d6a0323540a0fb66f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d3582d039ea3b315eea8e00d6a0323540a0fb66f/rdbms_common.py |
self.db.getclass('__sessions').create(sessid=session, user=user, | sessions = self.db.getclass('__sessions') self.session = sessions.create(sessid=session, user=user, | def set_cookie(self, user, password): # TODO generate a much, much stronger session key ;) session = binascii.b2a_base64(repr(time.time())).strip() | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py |
print cookie | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py | |
print 'session is', `session` | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py | |
sessid = sessions.lookup(session) | self.session = sessions.lookup(session) | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py |
sessions.set(sessid, last_use=date.Date()) | sessions.set(self.session, last_use=date.Date()) | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py |
ae(filt(None, {}, ('-','deadline'), ('+','priority')), ['2', '4', '1', '3']) | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | a5ed2995682420b556f2bc027b73b49153bb7828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a5ed2995682420b556f2bc027b73b49153bb7828/db_test_base.py | |
['3', '1', '4', '2']) | ['3', '4', '1', '2']) | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | a5ed2995682420b556f2bc027b73b49153bb7828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a5ed2995682420b556f2bc027b73b49153bb7828/db_test_base.py |
['3', '4', '1', '2']) | ['4', '3', '2', '1']) | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | a5ed2995682420b556f2bc027b73b49153bb7828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a5ed2995682420b556f2bc027b73b49153bb7828/db_test_base.py |
if os.path.exists(os.path.join(tracker_home, 'config.py')): | config_ini_file = os.path.join(tracker_home, CoreConfig.INI_FILE) if filter(os.path.exists, [config_ini_file, os.path.join(tracker_home, 'config.py'), ]): | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 640e7c498f550e19964fb6a7d43b73e704c0b5f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/640e7c498f550e19964fb6a7d43b73e704c0b5f6/admin.py |
print _(''' | print _(""" | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 640e7c498f550e19964fb6a7d43b73e704c0b5f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/640e7c498f550e19964fb6a7d43b73e704c0b5f6/admin.py |
%(config_file)s ... at a minimum, you must set MAILHOST, TRACKER_WEB, MAIL_DOMAIN and ADMIN_EMAIL. If you wish to modify the default schema, you should also edit the database initialisation file: | %(config_file)s""") % {"config_file": config_ini_file} need_set = CoreConfig(tracker_home)._get_unset_options() if need_set: print _(" ... at a minimum, you must set following options:") for section, options in need_set.items(): print " [%s]: %s" % (section, ", ".join(options)) print _(""" If you wish to modify... | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 640e7c498f550e19964fb6a7d43b73e704c0b5f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/640e7c498f550e19964fb6a7d43b73e704c0b5f6/admin.py |
''')%{ 'config_file': os.path.join(tracker_home, 'config.py'), 'database_config_file': os.path.join(tracker_home, 'dbinit.py') | """) % { 'database_config_file': os.path.join(tracker_home, 'schema.py'), 'database_init_file': os.path.join(tracker_home, 'initial_data.py'), | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 640e7c498f550e19964fb6a7d43b73e704c0b5f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/640e7c498f550e19964fb6a7d43b73e704c0b5f6/admin.py |
def main(self): try: opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v') except getopt.GetoptError, e: self.usage(str(e)) return 1 | 640e7c498f550e19964fb6a7d43b73e704c0b5f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/640e7c498f550e19964fb6a7d43b73e704c0b5f6/admin.py | ||
form variable. XXX Used to add a link to new items created during edit. XXX These are collected up and returned in all_links. This will XXX result in an additional linking operation (either Link set or XXX Multilink append) after the edit/create is done using XXX ... | form variable. These are collected up and returned in all_links. | def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | e58be10f9d0a92bfdb379cbe4e1948b77f52ed44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e58be10f9d0a92bfdb379cbe4e1948b77f52ed44/client.py |
all_required = {} all_props = {} | all_required = {} all_props = {} | def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | e58be10f9d0a92bfdb379cbe4e1948b77f52ed44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e58be10f9d0a92bfdb379cbe4e1948b77f52ed44/client.py |
if not all_required.has_key(this): all_required[this] = [] required = all_required[this] | propdef = all_propdef[cn] | e58be10f9d0a92bfdb379cbe4e1948b77f52ed44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e58be10f9d0a92bfdb379cbe4e1948b77f52ed44/client.py | |
if propname in required and value is not None: required.remove(propname) | propdef = all_propdef[cn] | e58be10f9d0a92bfdb379cbe4e1948b77f52ed44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e58be10f9d0a92bfdb379cbe4e1948b77f52ed44/client.py | |
from_address=[], cc=[], bcc=[]): | from_address=None, cc=[]): | def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy', from_address=[], cc=[], bcc=[]): """Send a message to the members of an issue's nosy list. | c6dc789d854dab05314605d39160dba1cf400e3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c6dc789d854dab05314605d39160dba1cf400e3b/roundupdb.py |
url_re = re.compile(r'\w{3,6}://\S+') email_re = re.compile(r'[\w\.]+@[\w\.\-]+') designator_re = re.compile(r'([a-z_]+)(\d+)') def _url_repl(self, match): s = match.group(0) return '<a href="%s">%s</a>'%(s, s) def _email_repl(self, match): s = match.group(0) return '<a href="mailto:%s">%s</a>'%(s, s) def _designator_r... | hyper_re = re.compile(r'((?P<url>\w{3,6}://\S+)|' r'(?P<email>[\w\.]+@[\w\.\-]+)|' r'(?P<item>(?P<class>[a-z_]+)(?P<id>\d+)))') 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">... | def __cmp__(self, other): if isinstance(other, HTMLProperty): return cmp(self._value, other._value) return cmp(self._value, other) | 24b8cf906e395bb31f22bdb647fe68df9add3817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/24b8cf906e395bb31f22bdb647fe68df9add3817/templating.py |
s = self.url_re.sub(self._url_repl, s) s = self.email_re.sub(self._email_repl, s) s = self.designator_re.sub(self._designator_repl, s) | s = self.hyper_re.sub(self._hyper_repl, s) | def plain(self, escape=0, hyperlink=0): ''' Render a "plain" representation of the property "escape" turns on/off HTML quoting "hyperlink" turns on/off in-text hyperlinking of URLs, email addresses and designators ''' if self._value is None: return '' if escape: s = cgi.escape(str(self._value)) else: s = str(self._val... | 24b8cf906e395bb31f22bdb647fe68df9add3817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/24b8cf906e395bb31f22bdb647fe68df9add3817/templating.py |
instance = imp.loa_package('instance', instance_home) | instance = imp.load_package('instance', instance_home) | def init(instance_home, template, backend, adminpw): ''' initialise an instance using the named template ''' # first, copy the template dir over import roundup.templatebuilder template_dir = os.path.split(__file__)[0] template_name = template template = os.path.join(template_dir, 'templates', template) copytree(templa... | a2adbf59c0c2af8952be2cf87720086f2ed21d04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a2adbf59c0c2af8952be2cf87720086f2ed21d04/init.py |
gid = grp.getgrnam(group)[2] | try: gid = int(group) except ValueError: gid = grp.getgrnam(group)[2] else: grp.getgrgid(gid) | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 68f90c21edcb42b628fae9c762aad1ec06afdc71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/68f90c21edcb42b628fae9c762aad1ec06afdc71/roundup_server.py |
uid = pwd.getpwnam(user)[2] | try: uid = int(user) except ValueError: uid = pwd.getpwnam(user)[2] else: pwd.getpwuid(uid) | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 68f90c21edcb42b628fae9c762aad1ec06afdc71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/68f90c21edcb42b628fae9c762aad1ec06afdc71/roundup_server.py |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 68f90c21edcb42b628fae9c762aad1ec06afdc71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/68f90c21edcb42b628fae9c762aad1ec06afdc71/roundup_server.py | ||
if hasattr(excClass,'__name__'): excName = excClass.__name__ | if hasattr(exception, '__name__'): excName = exception.__name__ | def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
excName = str(excClass) | excName = str(exception) | def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
self.client.db.classes.getprops = lambda: {'foo': hyperdb.Multilink('foo')} | self.client.db.classes.getprops = lambda: {'foo': hyperdb.Multilink('foo')} | def setUp(self): SearchActionTestCase.setUp(self) self.client.db.classes.getprops = lambda: {'foo': hyperdb.Multilink('foo')} | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
self.assertEqual([x.value for x in self.form['foo']], ['hello', 'world']) | self.assertEqual([x.value for x in self.form['foo']], ['hello', 'world']) | def testTokenizedStringKey(self): self.client.db.classes.getprops = lambda: {'foo': hyperdb.String()} self.form.value.append(MiniFieldStorage('foo', 'hello world')) | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
self.client.form.value.append(MiniFieldStorage('@lastactivity', str(self.now))) | self.client.form.value.append( MiniFieldStorage('@lastactivity', str(self.now))) | def testLastUserActivity(self): self.assertEqual(self.action.lastUserActivity(), None) | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
self.failUnless(self.action.detectCollision(self.now, self.now + Interval("1d"))) self.failIf(self.action.detectCollision(self.now, self.now - Interval("1d"))) | self.failUnless(self.action.detectCollision( self.now, self.now + Interval("1d"))) self.failIf(self.action.detectCollision( self.now, self.now - Interval("1d"))) | def testCollision(self): self.failUnless(self.action.detectCollision(self.now, self.now + Interval("1d"))) self.failIf(self.action.detectCollision(self.now, self.now - Interval("1d"))) self.failIf(self.action.detectCollision(None, self.now)) | 615ded3cb3db77c1ec25db75234fa0bd24d2e052 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/615ded3cb3db77c1ec25db75234fa0bd24d2e052/test_actions.py |
url = req.indexargs_href('', {}) | url = req.indexargs_href('', {})[1:] | def searchAction(self, wcre=re.compile(r'[\s,]+')): ''' Mangle some of the form variables. | ef5724846160338ff02c7634a99dadf329fa634d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ef5724846160338ff02c7634a99dadf329fa634d/client.py |
''' Print up an index of the available instances | ''' Print up an index of the available trackers | def index(self): ''' Print up an index of the available instances ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in sel... | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in self.TRACKER_HOMES.keys(): w(_('<li><a href="%(instance_url)s/index">%(instance_name)s</a>\n')%{ 'instance_url': urllib.quote(instance), 'instance_name': cgi.escape(instance)}) | w(_('<html><head><title>Roundup trackers index</title></head>\n')) w(_('<body><h1>Roundup trackers index</h1><ol>\n')) keys = self.TRACKER_HOMES.keys() keys.sort() for tracker in keys: w(_('<li><a href="%(tracker_url)s/index">%(tracker_name)s</a>\n')%{ 'tracker_url': urllib.quote(tracker), 'tracker_name': cgi.escape(tr... | def index(self): ''' Print up an index of the available instances ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in sel... | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py | ||
instance_name = urllib.unquote(l_path[1]) if self.TRACKER_HOMES.has_key(instance_name): instance_home = self.TRACKER_HOMES[instance_name] instance = roundup.instance.open(instance_home) | tracker_name = urllib.unquote(l_path[1]) if self.TRACKER_HOMES.has_key(tracker_name): tracker_home = self.TRACKER_HOMES[tracker_name] tracker = roundup.instance.open(tracker_home) | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
env['TRACKER_NAME'] = instance_name | env['TRACKER_NAME'] = tracker_name | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
c = instance.Client(instance, self, env) | c = tracker.Client(tracker, self, env) | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
roundup-server [-n hostname] [-p port] [-l file] [-d file] [name=instance home]* | roundup-server [-n hostname] [-p port] [-l file] [-d file] [name=tracker home]* | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
name=instance home Sets the instance home(s) to use. The name is how the instance is | name=tracker home Sets the tracker home(s) to use. The name is how the tracker is | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
instance home is the directory that was identified when you did | tracker home is the directory that was identified when you did | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py |
def run(): ''' Script entry point - handle args and figure out what to to. ''' hostname = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.getopt(sys.argv[1:], 'n:p:u:d:l:') except getopt.GetoptError, e: usage(str(e)) user = ROUNDUP_USER for (opt, arg) in opt... | e18361038688011601501a65fdc81b5cb7e88e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e18361038688011601501a65fdc81b5cb7e88e34/roundup_server.py | ||
where.append(' or '.join(["_%s._%s LIKE '%s'"%(cn, k, s) for s in v])) | where.append('(' +' or '.join(["_%s._%s LIKE '%s'"%(cn, k, s) for s in v]) +')') | 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 | d004ee8d824d9884c722a395ff405c294369df17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d004ee8d824d9884c722a395ff405c294369df17/back_mysql.py |
where.append('(_%s._%s in (%s))'%(cn, k, s)) | l.append('(_%s._%s in (%s))'%(cn, k, s)) | 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 | d004ee8d824d9884c722a395ff405c294369df17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d004ee8d824d9884c722a395ff405c294369df17/back_mysql.py |
where.append(' or '.join(l)) | if l: where.append('(' + ' or '.join(l) +')') | 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 | d004ee8d824d9884c722a395ff405c294369df17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d004ee8d824d9884c722a395ff405c294369df17/back_mysql.py |
sql = 'select id,__retired__ from _%s where _%s=%s'%(self.classname, self.key, self.db.arg) | sql = '''select id from _%s where _%s=%s and __retired__ != '1' '''%(self.classname, self.key, self.db.arg) | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 6f83bee8ad2df0821071904675a0a7d5cfc84597 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6f83bee8ad2df0821071904675a0a7d5cfc84597/rdbms_common.py |
l = self.db.cursor.fetchall() if not l or int(l[0][1]): | row = self.db.sql_fetchone() if not row: | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 6f83bee8ad2df0821071904675a0a7d5cfc84597 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6f83bee8ad2df0821071904675a0a7d5cfc84597/rdbms_common.py |
return l[0][0] | return row[0] | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 6f83bee8ad2df0821071904675a0a7d5cfc84597 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6f83bee8ad2df0821071904675a0a7d5cfc84597/rdbms_common.py |
return templating.translationService.translate(domain="roundup", msgid=msgid, context=self.context) | return self.client.translator.gettext(msgid) | def gettext(self, msgid): """Return the localized translation of msgid""" return templating.translationService.translate(domain="roundup", msgid=msgid, context=self.context) | fdfff3178ed3e591efdf846c6bbb606e1a584642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/fdfff3178ed3e591efdf846c6bbb606e1a584642/actions.py |
def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self.client) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname) | fdfff3178ed3e591efdf846c6bbb606e1a584642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/fdfff3178ed3e591efdf846c6bbb606e1a584642/actions.py | ||
converter = _converters.get(rutyp.__class__, None) | converter = _converters.get(raw.__class__, None) | def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | 221d099ba7b5569e90849b08e0caaaa344cb7c55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/221d099ba7b5569e90849b08e0caaaa344cb7c55/back_metakit.py |
str = time.strftime(format, (self.year, self.month, self.day, self.hour, self.minute, int(self.second), 0, 0, 0)) | t = (self.year, self.month, self.day, self.hour, self.minute, int(self.second), 0, 0, 0) t = calendar.timegm(t) t = time.gmtime(t) str = time.strftime(format, t) | def pretty(self, format='%d %B %Y'): ''' print up the date date using a pretty format... | 40091c7c6868297acb50b42853198f44d2ac7c5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/40091c7c6868297acb50b42853198f44d2ac7c5a/date.py |
""'''Usage: install [template [backend [admin password]]] | ""'''Usage: install [template [backend [admin password [key=val[,key=val]]]]] | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | bd90a614e119f6f3cf2e3471b32c92ab085dd491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/bd90a614e119f6f3cf2e3471b32c92ab085dd491/admin.py |
init.install(tracker_home, templates[template]['path']) | init.install(tracker_home, templates[template]['path'], settings=defns) | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | bd90a614e119f6f3cf2e3471b32c92ab085dd491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/bd90a614e119f6f3cf2e3471b32c92ab085dd491/admin.py |
except (getopt.GetoptError), e: | except (getopt.GetoptError, configuration.ConfigurationError), e: | def run(port=undefined, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) config = ServerConfig() options = "hvS" if RoundupService: options += 'c' try: (opt... | 6679a68d85bbec9e618c1ca77c7ce0082fe17d60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6679a68d85bbec9e618c1ca77c7ce0082fe17d60/roundup_server.py |
dirname = os.path.join(self.tracker_home, dirname) if os.path.isdir(dirname): for name in os.listdir(dirname): | dirpath = os.path.join(self.tracker_home, dirname) if os.path.isdir(dirpath): for name in os.listdir(dirpath): | def load_extensions(self, parent, dirname): dirname = os.path.join(self.tracker_home, dirname) if os.path.isdir(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) | fcef55a4700715f7cbd6a3465b9d017cbccdee6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/fcef55a4700715f7cbd6a3465b9d017cbccdee6b/instance.py |
''' display an item ''' if self.user in ('admin', self.db.user.get(self.nodeid, 'username')): self.shownode(message) else: | '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': | def showuser(self, message=None): ''' display an item ''' if self.user in ('admin', self.db.user.get(self.nodeid, 'username')): self.shownode(message) else: raise Unauthorised | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py |
print self.user, password | def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' print self.user, password # make sure th... | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py | |
uid = self.db.user.lookup(self.user) user = binascii.b2a_base64('%s:%s'%(self.user, password)).strip() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) self.header({'Set-Cookie': 'roundup_user=%s; Path=%s;'%(user, path)}) return self.index() | user = binascii.b2a_base64('%s:%s'%(user, password)).strip() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'])) self.header({'Set-Cookie': 'roundup_user="%s"; Path="%s";'%(user, path)}) | def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' print self.user, password # make sure th... | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py |
path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) | def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.login() | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py | |
'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) | 'roundup_user=deleted; Max-Age=0; expires="%s"; Path="%s";'%(now, path)}) | def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.login() | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py |
uid = self.db.user.lookup(self.user) user = binascii.b2a_base64('%s:%s'%(self.user, password)).strip() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) self.header({'Set-Cookie': 'roundup_user=%s; Path=%s;'%(user, path)}) | self.set_cookie(self.user, password) | def newuser_action(self, message=None): ''' create a new user based on the contents of the form and then set the cookie ''' # re-open the database as "admin" self.db.close() self.db = self.instance.open('admin') | eefa56ffe30ec68716804654903256c037e11c83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eefa56ffe30ec68716804654903256c037e11c83/cgi_client.py |
authid = messages.get(msgid, 'inreplyto') recipients = messages.get(msgid, 'messageid') | inreplyto = messages.get(msgid, 'inreplyto') messageid = messages.get(msgid, 'messageid') | 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 | 65cad1202dd39818a61f7ebd230eaf471d5dd073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/65cad1202dd39818a61f7ebd230eaf471d5dd073/roundupdb.py |
) | def open(name=None): ''' as from the roundupdb method openDB ''' from roundup.hyperdb import String, Password, Date, Link, Multilink from roundup.hyperdb import Interval, Boolean, Number # open the database db = Database(config, name) # # Now initialise the schema. Must do this each time the database is # opened. # ... | 954849ea3b4759c0ffc24f19fd88a872f298d0ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/954849ea3b4759c0ffc24f19fd88a872f298d0ce/dbinit.py | |
self.pagesize = 50 | self.pagesize = 5 | 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(... | 3f2a04818c42cf13408b7cfc0dddb0f9fdfe7df3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3f2a04818c42cf13408b7cfc0dddb0f9fdfe7df3/templating.py |
if not d.has_key(propname): | if (not d.has_key(propname)) or (d[propname] is None): | def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | 6874422e0d6f647f0c491cffd41f617fcfafc4b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6874422e0d6f647f0c491cffd41f617fcfafc4b9/rdbms_common.py |
new_value = cl.get(nodeid, key) | try: new_value = cl.get(nodeid, key) except KeyError: continue | def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ if __debug__ : if not isinstance(oldvalues, type({})) : raise TypeError("'oldvalues' must be dict-like, not %s."% type(oldvalues)) | 28d19c093ae03b22ec80fee8a8c2d9e45c8938b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/28d19c093ae03b22ec80fee8a8c2d9e45c8938b5/roundupdb.py |
filename = filename + extension src = os.path.join(dir, filename) | f = filename + extension src = os.path.join(dir, f) | def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) # try with a .html or .xml extension (new-style) for extens... | 3fc755a4dd33f0ff10a42faae7d517c0c6ccdd2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3fc755a4dd33f0ff10a42faae7d517c0c6ccdd2b/templating.py |
return (src, filename) | return (src, f) | def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) # try with a .html or .xml extension (new-style) for extens... | 3fc755a4dd33f0ff10a42faae7d517c0c6ccdd2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3fc755a4dd33f0ff10a42faae7d517c0c6ccdd2b/templating.py |
ae(str(Interval('-2w 3 d ')), '- 1 7d') | ae(str(Interval('-2w 3 d ')), '- 17d') | def testInterval(self): ae = self.assertEqual ae(str(Interval('3y')), '+ 3y') ae(str(Interval('2 y 1 m')), '+ 2y 1m') ae(str(Interval('1m 25d')), '+ 1m 25d') ae(str(Interval('-2w 3 d ')), '- 1 7d') ae(str(Interval(' - 1 d 2:50 ')), '- 1d 2:50') ae(str(Interval(' 14:00 ')), '+ 14:00') ae(str(Interval(' 0:04:33 ')), '+ 0... | 8820ec57ba3efc5362f123fed22382cd97ffb450 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8820ec57ba3efc5362f123fed22382cd97ffb450/test_dates.py |
l = [nodeid, date, user, action, export_data] | params = export_data l = [nodeid, date, user, action, params] | def export_journals(self): '''Export a class's journal - generate a list of lists of CSV-able data: | d8b2e95ca9878f1f8e0fa0917b6102d24246fea6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d8b2e95ca9878f1f8e0fa0917b6102d24246fea6/back_anydbm.py |
def history(self, direction='descending'): | def history(self, direction='descending', dre=re.compile('\d+')): | def history(self, direction='descending'): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] comments = {} history = self._klass.history(self._nodeid) history.sort() if directio... | 237ba6557a200663ce36484188c896ac285de68d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/237ba6557a200663ce36484188c896ac285de68d/templating.py |
if self.value is None: | if self._value is None: | def plain(self): ''' Render a "plain" representation of the property ''' if self.value is None: return '' return self._value and "Yes" or "No" | a797d6a5da539310c944d735a37637ed45c2b978 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a797d6a5da539310c944d735a37637ed45c2b978/templating.py |
nodeid integer, date timestamp, tag varchar(255), action varchar(255), params text)'''%spec.classname | nodeid integer, date %s, tag varchar(255), action varchar(255), params text)''' % (spec.classname, self.hyperdb_to_sql_datatypes[hyperdb.Date]) | def create_journal_table(self, spec): ''' create the journal table for a class given the spec and already-determined cols ''' # journal table cols = ','.join(['%s varchar'%x for x in 'nodeid date tag action params'.split()]) sql = '''create table %s__journal ( nodeid integer, date timestamp, tag varchar(255), action va... | 8feb44ee51bf1759eee4e796af0fa4c1cc75c06d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8feb44ee51bf1759eee4e796af0fa4c1cc75c06d/rdbms_common.py |
def now(self, str_interval = None): ''' Return the current time. | 2721f8df9c4c4d3ee090797279eb990d57d383a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/2721f8df9c4c4d3ee090797279eb990d57d383a9/templating.py | ||
raise ValueError, _('default value for ' + \ 'DateHTMLProperty must be either DateHTMLProperty ' + \ | raise ValueError, _('default value for ' 'DateHTMLProperty must be either DateHTMLProperty ' | def field(self, size = 30, default = None): ''' Render a form edit field for the property | 2721f8df9c4c4d3ee090797279eb990d57d383a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/2721f8df9c4c4d3ee090797279eb990d57d383a9/templating.py |
def props_from_args(self, args, klass=None): | def props_from_args(self, args): | def props_from_args(self, args, klass=None): props = {} for arg in args: if arg.find('=') == -1: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() try: key, value = arg.split('=') except ValueError: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() props[key] = value return props | 3128bd9e70ed5ed88fcdbacc8fd872fb58d6ef8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3128bd9e70ed5ed88fcdbacc8fd872fb58d6ef8d/admin.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.