rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
'''
""")
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise Unauthorized, 'You are not permitted to create files.'
raise Unauthorized, _( 'You are not permitted to create files.')
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise Unauthorized, 'You are not permitted to add '\ 'files to %s.'%classname
raise Unauthorized, _( 'You are not permitted to add files to %(classname)s.' ) % locals()
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise Unauthorized, 'You are not permitted to create messages.'
raise Unauthorized, _( 'You are not permitted to create messages.')
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise MailUsageError, '''
raise MailUsageError, _("""
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
%s '''%error
%(error)s """) % locals()
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise Unauthorized, 'You are not permitted to add '\ 'messages to %s.'%classname
raise Unauthorized, _( 'You are not permitted to add messages to %(classname)s.' ) % locals()
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise Unauthorized, 'You are not permitted to edit '\ 'property %s of class %s.'%(prop,classname)
raise Unauthorized, _('You are not permitted to edit ' 'property %(prop)s of class %(classname)s.') % locals()
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
raise MailUsageError, '''
raise MailUsageError, _("""
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
%s '''%message
%(message)s """) % locals()
def handle_message(self, message): ''' message - a Message instance
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
errors.append('not of form [arg=value,value,...;' 'arg=value,value,...]')
errors.append(_('not of form [arg=value,value,...;' 'arg=value,value,...]'))
def setPropArrayFromString(self, cl, propString, nodeid=None): ''' takes string of form prop=value,value;prop2=value and returns (error, prop[..]) ''' props = {} errors = [] for prop in string.split(propString, ';'): # extract the property name and value try: propname, value = prop.split('=') except ValueError, message...
f9457e5e409c6363bf37d5634a3c77d621f1a603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f9457e5e409c6363bf37d5634a3c77d621f1a603/mailgw.py
if is_edit_ok():
if self.is_edit_ok():
def field(self, size = 30): ''' Render a form edit field for the property
fbb5c075a392374e6b70f45ab9a958230bc861f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/fbb5c075a392374e6b70f45ab9a958230bc861f0/templating.py
if not props['status'] or props['status'] == unread_id:
if (not props.has_key('status') or props['status'] == unread_id):
def handle_message(self, message): ''' message - a Message instance
df338247c7b21ae64b8cc8570fe32214cb7fc5cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/df338247c7b21ae64b8cc8570fe32214cb7fc5cb/mailgw.py
self.arguments = {}
self.arguments = arguments
def __init__(self, instance, db, arguments={}): self.instance = instance self.db = db self.arguments = {}
f0f029411f8b546e0643e7ae90ffaddeb9246f76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f0f029411f8b546e0643e7ae90ffaddeb9246f76/mailgw.py
def field(self, size=30, default=None): ''' Render a form edit field for the property If not editable, just display the value via plain(). ''' self.view_check()
def field(self, size=30, default=None, format=_marker): '''Render a form edit field for the property If not editable, just display the value via plain(). The format string is a standard python strftime format string. ''' self.view_check() if not self.is_edit_ok(): if format is self._marker: return self.plain() else: ...
def field(self, size=30, default=None): ''' Render a form edit field for the property
39562e82c602a80affcc760aad7f46bf1bb36cf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/39562e82c602a80affcc760aad7f46bf1bb36cf6/templating.py
value = raw_value
if format is self._marker: value = raw_value else: value = date.Date(raw_value).pretty(format)
def field(self, size=30, default=None): ''' Render a form edit field for the property
39562e82c602a80affcc760aad7f46bf1bb36cf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/39562e82c602a80affcc760aad7f46bf1bb36cf6/templating.py
value = cgi.escape(str(raw_value.local(tz))) if self.is_edit_ok(): value = '"'.join(value.split('"')) return self.input(name=self._formname,value=value,size=size) return self.plain()
value = raw_value.local(tz) if format is not self._marker: value = value.pretty(format) value = cgi.escape(str(value), True) return self.input(name=self._formname, value=value, size=size)
def field(self, size=30, default=None): ''' Render a form edit field for the property
39562e82c602a80affcc760aad7f46bf1bb36cf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/39562e82c602a80affcc760aad7f46bf1bb36cf6/templating.py
_marker = []
def reldate(self, pretty=1): ''' Render the interval between the date and now.
39562e82c602a80affcc760aad7f46bf1bb36cf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/39562e82c602a80affcc760aad7f46bf1bb36cf6/templating.py
if format is not self._marker:
if not self._value: return '' elif format is not self._marker:
def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces).
39562e82c602a80affcc760aad7f46bf1bb36cf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/39562e82c602a80affcc760aad7f46bf1bb36cf6/templating.py
week = 60*60*24*7
def clean_sessions(self): """Age sessions, remove when they haven't been used for a week.
5e1421f0287d61972aec554dd1d091131de757c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/5e1421f0287d61972aec554dd1d091131de757c6/client.py
if (hasattr(self.client, 'FILTER_POSITION') and
if (show_display_form and hasattr(self.client, 'FILTER_POSITION') and
def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1): self.filterspec = filterspec
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
all_filters, all_columns, show_display_form, show_customization)
all_filters, all_columns, show_customization)
def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1): self.filterspec = filterspec
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
if (hasattr(self.client, 'FILTER_POSITION') and
if (show_display_form and hasattr(self.client, 'FILTER_POSITION') and
def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1): self.filterspec = filterspec
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
all_filters, all_columns, show_display_form, show_customization)
all_filters, all_columns, show_customization)
def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1): self.filterspec = filterspec
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
all_columns, show_display_form, show_customization):
all_columns, show_customization):
def filter_section(self, template, filter, columns, group, all_filters, all_columns, show_display_form, show_customization):
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
w('<tr class="location-bar">')
def filter_section(self, template, filter, columns, group, all_filters, all_columns, show_display_form, show_customization):
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
if show_display_form: w('<th align="left" colspan=%s>' '<input style="height : 1em; width : 1em; font-size: 12pt" type="submit" name="action" value="%s">&nbsp;View ' 'customisation...</th></tr>\n'%(len(names)+1, action)) if show_customization: w('<tr class="location-bar"><th>&nbsp;</th>') for name in names: w('<th>%s<...
w('<th align="left" colspan=%s>' '<input style="height : 1em; width : 1em; font-size: 12pt" type="submit" name="action" value="%s">&nbsp;View ' 'customisation...</th></tr>\n'%(len(names)+1, action)) if not show_customization:
def filter_section(self, template, filter, columns, group, all_filters, all_columns, show_display_form, show_customization):
9c1add44636f634b2798063c55aebb0854afb265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9c1add44636f634b2798063c55aebb0854afb265/htmltemplate.py
self.db.getjournal('b', bid)
def test_removeClass(self): self.init_ml() aid = self.db.a.create(name='apple') bid = self.db.b.create(name='bear', fooz=[aid]) self.db.commit(); self.db.close()
b93a11990da4ab3c444cbd0f36c6bdb8f73387c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b93a11990da4ab3c444cbd0f36c6bdb8f73387c5/db_test_base.py
self.handle()
return self.handle()
def execute(self): """Execute the action specified by this object.""" self.permission() self.handle()
7a58c42ea5667e95dd74baa487f655feabeffa91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a58c42ea5667e95dd74baa487f655feabeffa91/actions.py
request = templating.HTMLRequest(self)
request = templating.HTMLRequest(self.client)
def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname)
7a58c42ea5667e95dd74baa487f655feabeffa91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a58c42ea5667e95dd74baa487f655feabeffa91/actions.py
h = self.additional_headers
h = self.client.additional_headers
def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname)
7a58c42ea5667e95dd74baa487f655feabeffa91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a58c42ea5667e95dd74baa487f655feabeffa91/actions.py
self.header() writer = rcsv.writer(self.request.wfile)
self.client.header() writer = rcsv.writer(self.client.request.wfile)
def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname)
7a58c42ea5667e95dd74baa487f655feabeffa91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a58c42ea5667e95dd74baa487f655feabeffa91/actions.py
lab = lab + ' (%s)'%', '.join(m)
lab = lab + ' (%s)'%', '.join(map(str, m))
def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices
654ecf3e4926ef2d04e734eb1957bb79b5aa216a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/654ecf3e4926ef2d04e734eb1957bb79b5aa216a/htmltemplate.py
import urlparse path = urlparse.urlparse( self.absolute_url() )[2] path_components = path.split( '/' )
url = urlparse.urlparse( self.absolute_url() ) path_components = url[2].split( '/' )
def _opendb(self): '''Open the roundup instance database for a transaction. ''' instance = roundup.instance.open(self.instance_home) request = RequestWrapper(self.REQUEST['RESPONSE']) env = self.REQUEST.environ
8bd7149c7d4b20534434186775f8b7ea80fc48e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8bd7149c7d4b20534434186775f8b7ea80fc48e8/ZRoundup.py
del path_components , path
def _opendb(self): '''Open the roundup instance database for a transaction. ''' instance = roundup.instance.open(self.instance_home) request = RequestWrapper(self.REQUEST['RESPONSE']) env = self.REQUEST.environ
8bd7149c7d4b20534434186775f8b7ea80fc48e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8bd7149c7d4b20534434186775f8b7ea80fc48e8/ZRoundup.py
sendto = [sendto[0][1]] m = ['Subject: Well, it seemed to work', '', 'hi, mum!']
return
def handle_Message(self, message): '''Handle an RFC822 Message
5b882ec550d8e5780ceda2c62f7a71e6e7a7e1d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/5b882ec550d8e5780ceda2c62f7a71e6e7a7e1d5/mailgw.py
'roundup.scripts'
'roundup.scripts',
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts' ] installd...
f3bfcb1db0b5cae465540d70a4bffa7b602266d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f3bfcb1db0b5cae465540d70a4bffa7b602266d5/setup.py
content = traceback.format_exc()
content = '\n'.join(traceback.format_exception(*sys.exc_info()))
def exception_message(self): '''Send a message to the admins with information about the latest traceback. ''' subject = '%s: %s'%(self.config.TRACKER_NAME, sys.exc_info()[1]) to = [self.config.ADMIN_EMAIL] content = traceback.format_exc() self.standard_message(to, subject, content)
b01c4fd4dd5aa08ef5ffe45b893a76f88ae793e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b01c4fd4dd5aa08ef5ffe45b893a76f88ae793e2/mailer.py
user = raw_input(_('User: '))
user = raw_input('User: ')
def do_pop(self, server, user='', password='', apop=0): '''Read a series of messages from the specified POP server. ''' import getpass, poplib, socket try: if not user: user = raw_input(_('User: ')) if not password: password = getpass.getpass() except (KeyboardInterrupt, EOFError): # Ctrl C or D maybe also Ctrl Z under...
89ee161c0802ead40c77c21a3ba6ba6914b9c1d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/89ee161c0802ead40c77c21a3ba6ba6914b9c1d0/mailgw.py
if s1 == s2:
l1=s1.strip().split('\n') l2=[x for x in s2.strip().split('\n') if not x.startswith('Date: ')] if l1 == l2:
def compareStrings(self, s2, s1): '''Note the reversal of s2 and s1 - difflib.SequenceMatcher wants the first to be the "original" but in the calls in this file, the second arg is the original. Ho hum. ''' if s1 == s2: return
847d9dbb987418614165433658732d67a28ce24a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/847d9dbb987418614165433658732d67a28ce24a/test_mailgw.py
if sys.version_info[0:2] == (2,1): if s1+'\n' == s2: return if sys.version_info[0:2] == (2,2): if s1 == s2+'\n': return l1=s1.split('\n') l2=s2.split('\n')
def compareStrings(self, s2, s1): '''Note the reversal of s2 and s1 - difflib.SequenceMatcher wants the first to be the "original" but in the calls in this file, the second arg is the original. Ho hum. ''' if s1 == s2: return
847d9dbb987418614165433658732d67a28ce24a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/847d9dbb987418614165433658732d67a28ce24a/test_mailgw.py
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(SchemaTestCase)) return suite
eb35b470e586252a6553f1df7929040a1e7f5ff2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eb35b470e586252a6553f1df7929040a1e7f5ff2/test_schema.py
def __str__(self): return '''
059cc8d40b1f579c89bc2ce043dd7aab1b118afa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/059cc8d40b1f579c89bc2ce043dd7aab1b118afa/exceptions.py
if (hasattr(self.client, 'FILTER_POSITION') and self.client.FILTER_POSITION in ('top and bottom', 'top')): w('<form>\n') self.filter_section(filter_template, filter, columns, group, all_filters, all_columns, show_display_form, show_customization) w('</form>\n') if sort: w('<input type="hidden" name=":sort" value="%s...
def render(self, filterspec={}, filter=[], columns=[], sort=[], group=[], show_display_form=1, nodeids=None, show_customization=1): self.filterspec = filterspec
6d8250bc2ed08e37d74a8b9fedc280a32bb75792 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/6d8250bc2ed08e37d74a8b9fedc280a32bb75792/htmltemplate.py
if hasattr(value, 'type'):
if hasattr(value, 'type') and value.type:
propdef = all_propdef[cn]
fd1abb3d780ae5d4485939b7f66e46ddf5a33315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/fd1abb3d780ae5d4485939b7f66e46ddf5a33315/client.py
self.error_message.append(_('Error: ') + str(message))
self.error_message.append(_('Parse Error: ') + str(message))
def editItemAction(self): ''' Perform an edit of an item in the database.
b770226c324aa7d3e3245d17d5e8056798231fa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b770226c324aa7d3e3245d17d5e8056798231fa4/client.py
self.error_message.append(_('Error: ') + str(message))
self.error_message.append(_('Apply Error: ') + str(message))
def editItemAction(self): ''' Perform an edit of an item in the database.
b770226c324aa7d3e3245d17d5e8056798231fa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b770226c324aa7d3e3245d17d5e8056798231fa4/client.py
if cl.hasnode(nodeid):
if nodeid in ('x', 'X') or not cl.hasnode(nodeid): exists = 0 else:
def editCSVAction(self): ''' Performs an edit of all of a class' items in one go.
b770226c324aa7d3e3245d17d5e8056798231fa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b770226c324aa7d3e3245d17d5e8056798231fa4/client.py
else: exists = 0
def editCSVAction(self): ''' Performs an edit of all of a class' items in one go.
b770226c324aa7d3e3245d17d5e8056798231fa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b770226c324aa7d3e3245d17d5e8056798231fa4/client.py
self.debug = os.environ.get('SENDMAILDEBUG', '')
self.debug = os.environ.get('SENDMAILDEBUG', '') \ or config["MAIL_DEBUG"]
def __init__(self, config): self.config = config
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
writer.addheader('MIME-Version', '1.0')
writer.addheader('MIME-Version', '1.0')
def get_standard_message(self, to, subject, author=None): '''Form a standard email message from Roundup.
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
def bounce_message(self, bounced_message, to, error, subject='Failed issue tracker submission'): """Bounce a message, attaching the failed submission.
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
def __init__(self, config): smtplib.SMTP.__init__(self, config.MAILHOST)
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
use_tls = getattr(config, 'MAILHOST_TLS', 'no') if use_tls == 'yes': keyfile = getattr(config, 'MAILHOST_TLS_KEYFILE', '') if keyfile: certfile = getattr(config, 'MAILHOST_TLS_CERTFILE', '') if certfile: args = (keyfile, certfile) else: args = (keyfile, ) else: args = () self.starttls(*args)
if config["MAIL_TLS"]: self.starttls(config["MAIL_TLS_KEYFILE"], config["MAIL_TLS_CERFILE"])
def __init__(self, config): smtplib.SMTP.__init__(self, config.MAILHOST)
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
mailuser = getattr(config, 'MAILUSER', None)
mailuser = config["MAIL_USERNAME"]
def __init__(self, config): smtplib.SMTP.__init__(self, config.MAILHOST)
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
self.login(*config.MAILUSER)
self.login(mailuser, config["MAIL_PASSWORD"])
def __init__(self, config): smtplib.SMTP.__init__(self, config.MAILHOST)
7a24d1392111a92c474487c46f457c2c51a7575f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/7a24d1392111a92c474487c46f457c2c51a7575f/mailer.py
node = node.copy() node['creation'] = node['activity'] = date.Date() node['creator'] = self.curuserid
if not node.has_key('creator'): node = node.copy() node['creation'] = node['activity'] = date.Date() node['creator'] = self.curuserid
def addnode(self, classname, nodeid, node): ''' Add the specified node to its class's db. ''' if __debug__: print >>hyperdb.DEBUG, 'addnode', (self, classname, nodeid, node) # gadfly requires values for all non-multilink columns cl = self.classes[classname] cols, mls = self.determine_columns(cl.properties.items())
e83ad6d4269d6c107444e7169f190981de188a39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e83ad6d4269d6c107444e7169f190981de188a39/rdbms_common.py
if not self.db.security.hasPermission('Edit', userid):
if not self.db.security.hasPermission('Edit', userid, cn):
def shownode(self, message=None, num_re=re.compile('^\d+$')): ''' display an item ''' cn = self.classname cl = self.db.classes[cn] if self.form.has_key(':multilink'): link = self.form[':multilink'].value designator, linkprop = link.split(':') xtra = ' for <a href="%s">%s</a>' % (designator, designator) else: xtra = ''
da75a9bbe0705af60eb9c94feda05cf5db308278 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/da75a9bbe0705af60eb9c94feda05cf5db308278/cgi_client.py
self.session = binascii.b2a_base64(repr(random.random())).strip()
sessions = self.db.getSessionManager() s = '%s%s'%(time.time(), random.random()) print s self.session = binascii.b2a_base64(s).strip() while sessions.exists(self.session): s = '%s%s'%(time.time(), random.random()) self.session = binascii.b2a_base64(s).strip()
def set_cookie(self, user): """Set up a session cookie for the user.
c3385085d73ecc652ad12e582fd920579bc33fdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c3385085d73ecc652ad12e582fd920579bc33fdd/client.py
sessions = self.db.getSessionManager()
def set_cookie(self, user): """Set up a session cookie for the user.
c3385085d73ecc652ad12e582fd920579bc33fdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c3385085d73ecc652ad12e582fd920579bc33fdd/client.py
def inner_run_cgi(self): ''' This is the inner part of the CGI handling '''
c60fb0504bcf1d85137a65ff75da5b32b5ef3ae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c60fb0504bcf1d85137a65ff75da5b32b5ef3ae3/roundup_server.py
''' Return HTMLProperty for all props
''' Return HTMLProperty for all of this class' properties.
def properties(self): ''' Return HTMLProperty for all props ''' l = [] for name, prop in self._props.items(): for klass, htmlklass in propclasses: if isinstance(prop, hyperdb.Multilink): value = [] else: value = None if isinstance(prop, klass): l.append(htmlklass(self._client, '', prop, name, value)) return l
c5b111eab031d2504dc6517dd34d1dff8dc110db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c5b111eab031d2504dc6517dd34d1dff8dc110db/templating.py
Hase useful attributes:
Has useful attributes:
def hasPermission(self, role, classname=_marker): ''' Determine if the user has the Role.
c5b111eab031d2504dc6517dd34d1dff8dc110db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c5b111eab031d2504dc6517dd34d1dff8dc110db/templating.py
''' fudge email '''
''' Render the value of the property as an obscured email address '''
def email(self, escape=1): ''' fudge email ''' if self._value is None: value = '' else: value = str(self._value) value = value.replace('@', ' at ') value = value.replace('.', ' ') if escape: value = cgi.escape(value) return value
c5b111eab031d2504dc6517dd34d1dff8dc110db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c5b111eab031d2504dc6517dd34d1dff8dc110db/templating.py
s.append('- index of '+self.classname)
if self.template == 'item': s.append('- new %s'%self.classname) elif self.template == 'index': s.append('- %s index'%self.classname) else: s.append('- %s %s'%(self.classname, self.template))
def description(self): ''' Return a description of the request - handle for the page title. ''' s = [self.client.db.config.TRACKER_NAME] if self.classname: if self.client.nodeid: s.append('- %s%s'%(self.classname, self.client.nodeid)) else: s.append('- index of '+self.classname) else: s.append('- home') return ' '.join...
c5b111eab031d2504dc6517dd34d1dff8dc110db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/c5b111eab031d2504dc6517dd34d1dff8dc110db/templating.py
'%(python)s -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n'
'if NOT "%%_4ver%%" == "" %(python)s -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n' 'if "%%_4ver%%" == "" %(python)s -c "from %(package)s.scripts.%(module)s import run; run()" %%*\n'
def copy_scripts(self): """ Create each script listed in 'self.scripts' """ if not self.package_name: raise Exception("You have to inherit build_scripts_create and" " provide a package name") to_module = string.maketrans('-/', '_.')
bab22207d8bf6f2408d07596485d247fb14b6071 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/bab22207d8bf6f2408d07596485d247fb14b6071/setup.py
writer.addheader('Form', self.ISSUE_TRACKER_EMAIL)
writer.addheader('From', self.ISSUE_TRACKER_EMAIL)
def sendmessage(self, nodeid, msgid): """Send a message to the members of an issue's nosy list.
4cbee40405fd1cb40ebe907d1da43bc5fa3150f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4cbee40405fd1cb40ebe907d1da43bc5fa3150f6/roundupdb.py
prop_test = self.cl.getprops()[property]
dummy = self.cl.getprops()[property]
def do_plain(self, property, escape=0): ''' display a String property directly;
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
s = _('Plain: bad propclass "%(propclass)s"')%locals()
value = _('Plain: bad propclass "%(propclass)s"')%locals()
def do_plain(self, property, escape=0): ''' display a String property directly;
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
arg_s = str(arg)
arg_s = str(args)
def do_history(self, direction='descending'): ''' list the history of the item
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
arg_s = str(arg)
arg_s = str(args)
def do_history(self, direction='descending'): ''' list the history of the item
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
except KeyError, message:
except KeyError:
def do_history(self, direction='descending'): ''' list the history of the item
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
return replace.go(m.group('text'))
return replace.go(text)
def __call__(self, m, filter=None, columns=None, sort=None, group=None): if m.group('name'): if m.group('name') in self.props: text = m.group('text') replace = IndexTemplateReplace(self.globals, {}, self.props) return replace.go(m.group('text')) else: return '' if m.group('display'): command = m.group('command') return...
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
print '*** unhandled match', m.groupdict()
return '*** unhandled match: %s'%str(m.groupdict())
def __call__(self, m, filter=None, columns=None, sort=None, group=None): if m.group('name'): if m.group('name') in self.props: text = m.group('text') replace = IndexTemplateReplace(self.globals, {}, self.props) return replace.go(m.group('text')) else: return '' if m.group('display'): command = m.group('command') return...
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
TemplateFunctions.__init__(self)
def __init__(self, client, templates, classname): self.client = client self.instance = client.instance self.templates = templates self.classname = classname
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
prop = self.properties[name]
def filter_section(self, template, filter, columns, group, all_filters, all_columns, show_customization):
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
print '*** unhandled match', m.groupdict()
return '*** unhandled match: %s'%str(m.groupdict())
def __call__(self, m, filter=None, columns=None, sort=None, group=None): if m.group('name'): if self.nodeid and self.cl.get(self.nodeid, m.group('name')): replace = ItemTemplateReplace(self.globals, {}, self.cl, self.nodeid) return replace.go(m.group('text')) else: return '' if m.group('display'): command = m.group('co...
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
TemplateFunctions.__init__(self)
def __init__(self, client, templates, classname): self.client = client self.instance = client.instance self.templates = templates self.classname = classname
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
TemplateFunctions.__init__(self)
def __init__(self, client, templates, classname): self.client = client self.instance = client.instance self.templates = templates self.classname = classname
8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8c1a19aa2d0a93ccc5c6293d64e6fbe7f245525d/htmltemplate.py
try: self._ = self.gettext = client.gettext self.ngettext = client.ngettext except AttributeError: _translator = templating.translationService self._ = self.gettext = _translator.gettext self.ngettext = _translator.ngettext
def __init__(self, client): self.client = client self.db = client.db self.form = client.form self.classname = client.classname self.nodeid = client.nodeid
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
submitted for the edit operation to succeed.
submitted for the edit operation to succeed.
def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can:
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
specified in dbinit.py.
specified in dbinit.py.
def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can:
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
key field is specified in dbinit.py.
key field is specified in dbinit.py.
def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can:
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
The return from this method is a dict of
The return from this method is a dict of
def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can:
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, \ 'link "%s" value "%s" not a designator'%(key, entry)
raise FormError, self._('link "%(key)s" ' 'value "%(value)s" not a designator') % locals()
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, '%s %s is not a link or '\ 'multilink property'%(cn, propname)
raise FormError, self._('%(class)s %(property)s ' 'is not a link or multilink property') % { 'class':cn, 'property':propname}
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, 'You have submitted a %s action for'\ ' the property "%s" which doesn\'t exist'%(mlaction, propname)
raise FormError, self._('You have submitted a %(action)s ' 'action for the property "%(property)s" ' 'which doesn\'t exist') % { 'action': mlaction, 'property':propname}
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, 'You have submitted more than one value'\ ' for the %s property'%propname
raise FormError, self._('You have submitted more than one ' 'value for the %s property') % propname
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, 'Password and confirmation text do '\ 'not match'
raise FormError, self._('Password and confirmation text ' 'do not match')
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, 'You have submitted more than one value'\ ' for the %s property'%propname
raise FormError, self._('You have submitted more than one ' 'value for the %s property') % propname
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, 'Password and confirmation text do '\ 'not match'
raise FormError, self._('Password and confirmation text ' 'do not match')
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, _('property "%(propname)s": ' '"%(value)s" not currently in list')%{
raise FormError, self._('property ' '"%(propname)s": "%(value)s" ' 'not currently in list') % {
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
if len(required) > 1: p = 'properties' else: p = 'property' s.append('Required %s %s %s not supplied'%(thing[0], p, ', '.join(required)))
s.append(self.ngettext( 'Required %(class)s property %(property)s not supplied', 'Required %(class)s properties %(property)s not supplied', len(required) ) % {'class': thing[0], 'property': ', '.join(required)})
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
raise FormError, _('File is empty')
raise FormError, self._('File is empty')
propdef = all_propdef[cn]
b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py
self.second, x, x, x = spec self.offset = offset
self.second, x, x, x = time.gmtime(ts)
def __init__(self, spec='.', offset=0): """Construct a date given a specification and a time zone offset.
3ee946edcba07e047aef6958310d0db851d96765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3ee946edcba07e047aef6958310d0db851d96765/date.py
return time.strftime('%Y-%m-%d.%T', (self.year, self.month, self.day, self.hour, self.minute, self.second, 0, 0, 0))
return time.strftime('%Y-%m-%d.%T', (self.year, self.month, self.day, self.hour, self.minute, self.second, 0, 0, 0))
def __str__(self): """Return this date as a string in the yyyy-mm-dd.hh:mm:ss format.""" return time.strftime('%Y-%m-%d.%T', (self.year, self.month, self.day, self.hour, self.minute, self.second, 0, 0, 0))
3ee946edcba07e047aef6958310d0db851d96765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3ee946edcba07e047aef6958310d0db851d96765/date.py
y,m,d,H,M,S,x,x,x = time.gmtime(time.time()) ts = calendar.timegm((y,m,d,H+offset,M,S,0,0,0))
y,m,d,H,M,S,x,x,x = time.gmtime() if info['m'] is not None and info['d'] is not None: m = int(info['m']) d = int(info['d']) if info['y'] is not None: y = int(info['y']) H = M = S = 0 if info['H'] is not None and info['M'] is not None: H = int(info['H']) - offset M = int(info['M']) S = 0 if info['S'] is not None: S ...
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<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d))?)? # hh:mm:ss (?P<o>.+)? # offset ''', re.VERBOSE)): ''' set the da...
3ee946edcba07e047aef6958310d0db851d96765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3ee946edcba07e047aef6958310d0db851d96765/date.py
if info['m'] is not None and info['d'] is not None: self.month = int(info['m']) self.day = int(info['d']) if info['y'] is not None: self.year = int(info['y']) self.hour = self.minute = self.second = 0 if info['H'] is not None and info['M'] is not None: self.hour = int(info['H']) self.minute = int(info['M']) if info['...
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<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d))?)? # hh:mm:ss (?P<o>.+)? # offset ''', re.VERBOSE)): ''' set the da...
3ee946edcba07e047aef6958310d0db851d96765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3ee946edcba07e047aef6958310d0db851d96765/date.py
All commands (except help) require a tracker specifier. This is just the path to the roundup tracker you're working with. A roundup tracker is where roundup keeps the database and configuration file that defines an issue tracker. It may be thought of as the issue tracker's "home directory". It may be specified in the e...
All commands (except help) require a tracker specifier. This is just the path to the roundup tracker you're working with. A roundup tracker is where roundup keeps the database and configuration file that defines an issue tracker. It may be thought of as the issue tracker's "home directory". It may be specified in the e...
def help_all(self): print _('''
eb552e06b9df2d7c4092851c8b0de350e72c3daf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eb552e06b9df2d7c4092851c8b0de350e72c3daf/admin.py
. Date values are printed in the full date format in the local time zone, and accepted in the full format or any of the partial formats explained below.
. Date values are printed in the full date format in the local time zone, and accepted in the full format or any of the partial formats explained below.
def help_all(self): print _('''
eb552e06b9df2d7c4092851c8b0de350e72c3daf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/eb552e06b9df2d7c4092851c8b0de350e72c3daf/admin.py