bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename) | def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename) | 27,900 |
def __fake_stdout(self): import tempfile null = tempfile.TemporaryFile() self.real_stdout_fd = os.dup(sys.stdout.fileno()) os.dup2(null.fileno(), sys.stdout.fileno()) | def __fake_stdout(self): import tempfile null = tempfile.TemporaryFile() self.real_stdout_fd = os.dup(sys.stdout.fileno()) os.dup2(null.fileno(), sys.stdout.fileno()) | 27,901 |
def __restore_stdout(self): os.dup2(self.real_stdout_fd, sys.stdout.fileno()) os.close(self.real_stdout_fd) del self.real_stdout_fd | def __restore_stdout(self): os.dup2(self.real_stdout_fd, 1) os.close(self.real_stdout_fd) del self.real_stdout_fd | 27,902 |
def load(self): """ Regenerates the fake configuration and load the packages server. """ if not self.loaded: shutil.rmtree(self.status_dir+'/apt/lists/') os.makedirs(self.status_dir+'/apt/lists/partial') sources = open(self.status_dir+'/'+'apt/etc/sources.list', 'w') for file in self.packages.keys(): # we should probab... | def load(self): """ Regenerates the fake configuration and load the packages server. """ if not self.loaded: shutil.rmtree(self.status_dir+'/apt/lists/') os.makedirs(self.status_dir+'/apt/lists/partial') sources = open(self.status_dir+'/'+'apt/etc/sources.list', 'w') for file in self.packages.keys(): # we should probab... | 27,903 |
def unload(self): "Tryes to make the packages server quit." if self.loaded: del self.cache del self.records self.loaded = 0 | def unload(self): "Tries to make the packages server quit." if self.loaded: del self.cache del self.records self.loaded = 0 | 27,904 |
def loseConnection(self): "Kill rsync process" if self.transport: if self.transport.pid: log.debug("killing rsync child" + str(self.transport.pid), 'rsync_client') os.kill(self.transport.pid, signal.SIGTERM) #self.transport.loseConnection() | def loseConnection(self): "Kill rsync process" if self.transport: if self.transport.pid: log.debug("killing rsync child" + str(self.transport.pid), 'rsync_client') os.kill(self.transport.pid, signal.SIGTERM) #self.transport.loseConnection() | 27,905 |
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri) | def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri) | 27,906 |
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri) | def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri) | 27,907 |
def fetch(self, serve_cached=1): """ Serve 'self' from cache or through the appropriate Fetcher depending on the asociated backend. Use post_convert and gzip_convert regular expresions of the Fetcher to gzip/gunzip file before and after download. 'serve_cached': this is somewhat of a hack only usefull for LoopbackReq... | def fetch(self, serve_cached=1): """ Serve 'self' from cache or through the appropriate Fetcher depending on the asociated backend. Use post_convert and gzip_convert regular expresions of the Fetcher to gzip/gunzip file before and after download. 'serve_cached': this is somewhat of a hack only useful for LoopbackRequ... | 27,908 |
def finish(self): "If he wanted to know, tell dady that we are served." if self.finish_cb: self.finish_cb() self.transport = None pass | def finish(self): "If he wanted to know, tell daddy that we are served." if self.finish_cb: self.finish_cb() self.transport = None pass | 27,909 |
def finish(self): "If he wanted to know, tell dady that we are served." if self.finish_cb: self.finish_cb() self.transport = None pass | def finish(self): "If he wanted to know, tell dady that we are served." if self.finish_cb: self.finish_cb() self.transport = None pass | 27,910 |
def connectionLost(self, reason=None): "If the connection is lost, notify all my requets" __pychecker__ = 'unusednames=reason' for req in self.requests: req.connectionLost() log.debug("Client connection closed") if log.isEnabled('memleak'): memleak.print_top_10() | def connectionLost(self, reason=None): "If the connection is lost, notify all my requests" __pychecker__ = 'unusednames=reason' for req in self.requests: req.connectionLost() log.debug("Client connection closed") if log.isEnabled('memleak'): memleak.print_top_10() | 27,911 |
def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri) | def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri) | 27,912 |
def apEndTransfer(self, fetcher_class): """ Remove this Fetcher and transfer all it's requests to a new instance of 'fetcher_class'. """ #Consider something like this: #req = dummyFetcher.fix_ref_request() #fetcher = fetcher_class() #dummyFetcher.transfer_requests(fetcher) #dummyFetcher.apEnd() #fetcher.activate(req) | def apEndTransfer(self, fetcher_class): """ Remove this Fetcher and transfer all it's requests to a new instance of 'fetcher_class'. """ #Consider something like this: #req = dummyFetcher.fix_ref_request() #fetcher = fetcher_class() #dummyFetcher.transfer_requests(fetcher) #dummyFetcher.apEnd() #fetcher.activate(req) | 27,913 |
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return | def activate(self, request, postconverting=0): Fetcher.activate(self, request) if not request.apFetcher: return | 27,914 |
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return | def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return | 27,915 |
def host_transfer_done(self): """ Called by our LoopbackRequest when the real Fetcher calls finish() on it. | def host_transfer_done(self): """ Called by our LoopbackRequest when the real Fetcher calls finish() on it. | 27,916 |
def processEnded(self, reason=None): log.debug("Status: %d" %(self.process.status),'rsync_client') if self.process.status != 0: self.setResponseCode(http.NOT_FOUND) if not os.path.exists(self.local_file): try: os.removedirs(self.local_dir) except: pass | def processEnded(self, reason=None): log.debug("Status: %d" %(self.process.status),'rsync_client') if self.process.status != 0: self.setResponseCode(http.NOT_FOUND) if not os.path.exists(self.local_file): try: os.removedirs(self.local_dir) except: pass | 27,917 |
def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | 27,918 |
def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | 27,919 |
def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | def fetch_real(result, dummyFetcher, cached, running): """ This is called after verifying if the file is properly cached. If 'cached' the requested file is properly cached. If not 'cached' the requested file was not there, didn't pass the integrity check or may be outdated. """ if len(dummyFetcher.requests)==0: #The r... | 27,920 |
def activate (self, request): Fetcher.activate(self, request) if not request.apFetcher: return | def activate (self, request): Fetcher.activate(self, request) if not request.apFetcher: return | 27,921 |
def open_shelve(filename): from bsddb3 import db,dbshelve,DBInvalidArgError log.debug('Opening database ' + filename) | def open_shelve(filename): from bsddb3 import db,dbshelve,DBInvalidArgError log.debug('Opening database ' + filename) | 27,922 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | 27,923 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | 27,924 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | 27,925 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser... | 27,926 |
def get_group_info(self): assert self.__groupInfo retval = self.__groupInfo assert retval return retval | def get_group_info(self): assert self.__groupInfo retval = self.__groupInfo assert retval return retval | 27,927 |
def __init__(self, context, request): # Preconditions assert context assert request Products.Five.BrowserView.__init__(self, context, request) self.set_archive(self.context.messages) self.set_emailId(self.context.REQUEST.form.get('id', None)) self.init_email() self.init_topic() # Postconditions assert self.archive as... | def __init__(self, context, request): # Preconditions assert context assert request Products.Five.BrowserView.__init__(self, context, request) self.set_archive(self.context.messages) self.set_emailId(self.context.REQUEST.form.get('id', None)) self.init_email() self.init_topic() # Postconditions assert self.archive as... | 27,928 |
def __init__(self, context, request): # Preconditions assert context assert request GSBaseMessageView.__init__(self, context, request) GSGroupObject.__init__(self, context) self.init_threads() | def __init__(self, context, request): # Preconditions assert context assert request GSBaseMessageView.__init__(self, context, request) GSGroupObject.__init__(self, context) self.init_threads() | 27,929 |
def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(indexable.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(indexable, pp) return indexables | def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(object.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(indexable, pp) return indexables | 27,930 |
def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(indexable.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(indexable, pp) return indexables | def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(indexable.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(object, pp) return indexables | 27,931 |
def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | 27,932 |
def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(object.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(object, pp) return indexables | def reindex_mailObjects(self): """ Reindex the mailObjects that we contain. """ for object in self.archive.objectValues('Folder'): if hasattr(object, 'mailFrom'): pp = '/'.join(object.getPhysicalPath()) self.Catalog.uncatalog_object(pp) self.Catalog.catalog_object(object, pp) return 1 | 27,933 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser... | 27,934 |
def getValueFor(self, key): # getting the maillist and moderatedlist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'moderator', 'moderatedlist','mailinlist'): maillist = [] if key in ('digestmaillist', 'maillist'): address_getter = 'get_deli... | def getValueFor(self, key): # getting the maillist and moderatedlist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'moderator', 'moderatedlist','mailinlist'): maillist = [] if key in ('digestmaillist', 'maillist'): address_getter = 'get_deli... | 27,935 |
def getValueFor(self, key): # getting the maillist and moderatedlist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'moderator', 'moderatedlist','mailinlist'): maillist = [] if key in ('digestmaillist', 'maillist'): address_getter = 'get_deli... | def getValueFor(self, key): # getting the maillist and moderatedlist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'moderator', 'moderatedlist','mailinlist'): maillist = [] if key in ('digestmaillist', 'maillist'): address_getter = 'get_deli... | 27,936 |
def requestMail(self, REQUEST): # Handles un-/subscribe-requests. | def requestMail(self, REQUEST): # Handles un-/subscribe-requests. | 27,937 |
def manage_digestBoxer(self, REQUEST): """ Send out a digest of topics to users who have requested it. | def manage_digestBoxer(self, REQUEST): """ Send out a digest of topics to users who have requested it. | 27,938 |
def thread_sorter(a, b): if s_on in ('mailDate', 'mailSubject'): a = getattr(a[1][0], s_on); b = getattr(b[1][0], s_on) elif s_on in ('mailCount', ): a = a[0]; b = b[0] else: return 0 if not a > b: return s_order == 'asc' and -1 or 1 elif not a < b: return s_order == 'asc' and 1 or -1 else: return 0 | def thread_sorter(a, b): if s_on in ('mailDate', 'mailSubject'): a = getattr(a[1][0], s_on); b = getattr(b[1][0], s_on) elif s_on in ('mailCount', ): a = a[0]; b = b[0] else: return 0 if not a > b: return s_order == 'asc' and -1 or 1 elif not a < b: return s_order == 'asc' and 1 or -1 else: return 0 | 27,939 |
def manage_delMember(self, email): """ Remove member from group. """ user = self.acl_users.get_userByEmail(email) if user: user.del_groupWithNotification('%s_member' % self.getId()) return 1 | def manage_delMember(self, email): """ Remove member from group. """ user = self.acl_users.get_userByEmail(email) if user: user.del_groupWithNotification('%s_member' % self.getId()) return 1 | 27,940 |
def manage_addMail(self, Mail): """ store mail & attachments in a folder and return it """ | def manage_addMail(self, Mail): """ store mail & attachments in a folder and return it """ | 27,941 |
def manage_addMail(self, Mail): """ store mail & attachments in a folder and return it """ | def manage_addMail(self, Mail): """ store mail & attachments in a folder and return it """ | 27,942 |
def getAuthorizedURL(url, auth): # annoyingly, xmlrpclib only recognises user@pass style # authentication, so having gone to the trouble of parsing # it out, we now need to add it back in again if not auth: return url import urlparse urlparts = list(urlparse.urlparse(url)) urlparts[1] = auth+'@'+urlparts[1] f = file(... | def getAuthorizedURL(url, auth): # annoyingly, xmlrpclib only recognises user@pass style # authentication, so having gone to the trouble of parsing # it out, we now need to add it back in again if not auth: return url import urlparse urlparts = list(urlparse.urlparse(url)) urlparts[1] = auth+'@'+urlparts[1] return ur... | 27,943 |
def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | 27,944 |
def checkMail(self, REQUEST): # richard@iopen.net: this is mostly the same as the MailBoxer parent, # only with notification. # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.e... | def checkMail(self, REQUEST): # richard@iopen.net: this is mostly the same as the MailBoxer parent, # only with notification. # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.e... | 27,945 |
def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'mailinlist'): if key in ('digestmaillist', 'maillist'): address_getter = 'get_deliveryEmailAddressesByKey' #address_getter = 'get_preferredEmai... | def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'mailinlist'): if key in ('digestmaillist', 'maillist'): address_getter = 'get_deliveryEmailAddressesByKey' #address_getter = 'get_preferredEmai... | 27,946 |
def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'mailinlist'): if key in ('digestmaillist', 'maillist'): address_getter = 'get_deliveryEmailAddressesByKey' #address_getter = 'get_preferredEmai... | def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework pass_group_id = False if key in ('digestmaillist', 'maillist', 'mailinlist'): if key in ('digestmaillist', 'maillist'): address_getter = 'get_deliveryEmailAddressesByKey' #address_getter = 'get_preferredEmai... | 27,947 |
def process_form(self): pass | def process_form(self): pass | 27,948 |
def user_authored(self): '''Did the user write the email message? ARGUMENTS None. RETURNS A boolean that is "True" if the current user authored the email message, "False" otherwise. SIDE EFFECTS None.''' assert self.post assert self.request user = self.request.AUTHENTICATED_USER retval = user.getId() == self.post['... | def user_authored(self): """Did the user write the email message? ARGUMENTS None. RETURNS A boolean that is "True" if the current user authored the email message, "False" otherwise. SIDE EFFECTS None.''' assert self.post assert self.request user = self.request.AUTHENTICATED_USER retval = user.getId() == self.post['... | 27,949 |
def user_authored(self): '''Did the user write the email message? ARGUMENTS None. RETURNS A boolean that is "True" if the current user authored the email message, "False" otherwise. SIDE EFFECTS None.''' assert self.post assert self.request user = self.request.AUTHENTICATED_USER retval = user.getId() == self.post['... | def user_authored(self): '''Did the user write the email message? ARGUMENTS None. RETURNS A boolean that is "True" if the current user authored the email message, "False" otherwise. SIDE EFFECTS None.""" assert self.post assert self.request user = self.request.AUTHENTICATED_USER retval = user.getId() == self.post['... | 27,950 |
def author_exists(self): '''Does the author of the post exist? RETURNS True if the author of the post exists on the system, False otherwise. SIDE EFFECTS None.''' assert self.post retval = False authorId = self.post['mailUserId'] retval = self.context.Scripts.get.user_exists(authorId) assert retval in (True, False... | def author_exists(self): """Does the author of the post exist? RETURNS True if the author of the post exists on the system, False otherwise. SIDE EFFECTS None.''' assert self.post retval = False authorId = self.post['mailUserId'] retval = self.context.Scripts.get.user_exists(authorId) assert retval in (True, False... | 27,951 |
def author_exists(self): '''Does the author of the post exist? RETURNS True if the author of the post exists on the system, False otherwise. SIDE EFFECTS None.''' assert self.post retval = False authorId = self.post['mailUserId'] retval = self.context.Scripts.get.user_exists(authorId) assert retval in (True, False... | def author_exists(self): '''Does the author of the post exist? RETURNS True if the author of the post exists on the system, False otherwise. SIDE EFFECTS None.""" assert self.post retval = False authorId = self.post['mailUserId'] retval = self.context.Scripts.get.user_exists(authorId) assert retval in (True, False... | 27,952 |
def getAuthorizedURL(url, auth): # annoyingly, xmlrpclib only recognises user@pass style # authentication, so having gone to the trouble of parsing # it out, we now need to add it back in again if not auth: return url import urlparse urlparts = list(urlparse.urlparse(url)) urlparts[1] = auth+'@'+urlparts[1] f = file(... | def getAuthorizedURL(url, auth): # annoyingly, xmlrpclib only recognises user@pass style # authentication, so having gone to the trouble of parsing # it out, we now need to add it back in again if not auth: return url import urlparse urlparts = list(urlparse.urlparse(url)) urlparts[1] = auth+'@'+urlparts[1] return ur... | 27,953 |
def thread_results(self, REQUEST, bstart, bsize, s_on, s_order): | def thread_results(self, REQUEST, bstart, bsize, s_on, s_order): | 27,954 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser() if email_address not in user.get_emailAddresses(): raise 'Forbidden', 'Only the authent... | 27,955 |
def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(item, '_initialised', False): return False item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Re... | 27,956 |
def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | 27,957 |
def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | 27,958 |
def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | 27,959 |
def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | def manage_afterAdd(self, item, container): """ For configuring the object post-instantiation. """ if getattr(self, '__initialised', 1): return 1 item._setObject('Catalog', XWFCatalog()) wordsplitter = Record() wordsplitter.group = 'Word Splitter' wordsplitter.name = 'HTML aware splitter' casenormalizer = Record() ... | 27,960 |
def upgrade(self): """ Upgrade to the latest version. """ currversion = getattr(self, '_version', 0) if currversion == self.version: return 'already running latest version (%s)' % currversion | def upgrade(self): """ Upgrade to the latest version. """ currversion = getattr(self, '_version', 0) if currversion == self.version: return 'already running latest version (%s)' % currversion | 27,961 |
def requestMail(self, REQUEST): # Handles un-/subscribe-requests. | def requestMail(self, REQUEST): # Handles un-/subscribe-requests. | 27,962 |
def checkMail(self, REQUEST): # richard@iopen.net: this is mostly the same as the MailBoxer parent, # only with notification. # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.e... | def checkMail(self, REQUEST): # richard@iopen.net: this is mostly the same as the MailBoxer parent, # only with notification. # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.e... | 27,963 |
def get_userFromEmail( | def get_userFromEmail( | 27,964 |
def get_mailUserId(self, from_addrs=[]): member_users = self.get_memberUserObjects() for addr in from_addrs: for member_user in member_users: addrs = member_user.getProperty('emailAddresses', []) for member_addr in addrs: if member_addr.lower() == addr.lower(): return member_user.getId() return sender_id | def get_mailUserId(self, from_addrs=[]): member_users = self.get_memberUserObjects() for addr in from_addrs: for member_user in member_users: addrs = member_user.getProperty('emailAddresses', []) for member_addr in addrs: if member_addr.lower() == addr.lower(): return member_user.getId() return '' | 27,965 |
def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework if key == 'maillist': # look for a maillist script maillist_script = getattr(self, 'maillist_members', None) if maillist_script: return maillist_script() maillist = [] try: member_groups = self.getProperty(... | def getValueFor(self, key): # getting the maillist is a special case, working in with the # XWFT group framework if key == 'maillist': # look for a maillist script maillist_script = getattr(self, 'maillist_members', None) if maillist_script: return maillist_script() maillist = [] try: member_groups = self.getProperty(... | 27,966 |
def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | 27,967 |
def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | def manage_addMail(self, mailString): """ Store mail & attachments in a folder and return it. """ import re archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) # no archive available? then return immediately if archive is None: return None (header, body) = self.splitMail(mailString) # get t... | 27,968 |
def __init__(self, id, title, mailto): """ Setup a MailBoxer with reasonable defaults. """ import random self.id = id self.title = title self.mailto = mailto self.hashkey = str(random.random()) | def __init__(self, id, title, mailto): """ Setup a MailBoxer with reasonable defaults. """ MailBoxer.__init__(self, id, title) self.mailto = mailto self.hashkey = str(random.random()) | 27,969 |
def __init__(self, id, title, mailto): """ Setup a MailBoxer with reasonable defaults. """ import random self.id = id self.title = title self.mailto = mailto self.hashkey = str(random.random()) | def __init__(self, id, title, mailto): """ Setup a MailBoxer with reasonable defaults. """ import random self.id = id self.title = title self.mailto = mailto self.hashkey = str(random.random()) | 27,970 |
def init_properties(self): """ Tidy up the property sheet, since we don't want to control most of the properties that have already been defined in the parent MailingListManager. """ delete_properties = filter(lambda x: x not in self.mailinglist_properties, self.propertyIds()) props = [] for item in self._properties: i... | def init_properties(self): """ Tidy up the property sheet, since we don't want to control most of the properties that have already been defined in the parent MailingListManager. """ delete_properties = filter(lambda x: x not in self.mailinglist_properties, self.propertyIds()) props = [] for item in self._properties: i... | 27,971 |
def get_maillist(self): """ """ return self.getValueFor('maillist') | def get_maillist(self): """ """ return self.getValueFor('maillist') | 27,972 |
def manage_addXWFMailingList(self, id, mailto, title='Mailing List', REQUEST=None): """ Add an XWFMailingList to a container. """ ob = XWFMailingList(id, title, mailto) self._setObject(id, ob) ob = getattr(self, id) ob.init_properties() manage_addFolder(ob, 'archive', 'mailing list archives') if REQUEST is not None: ... | def manage_addXWFMailingList(self, id, mailto, title='Mailing List', REQUEST=None): """ Add an XWFMailingList to a container. """ ob = XWFMailingList(id, title, mailto) self._setObject(id, ob) ob = getattr(self, id) ob.init_properties() manage_addFolder(ob, 'archive', 'mailing list archives') if REQUEST is not None: ... | 27,973 |
def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() user = security.getUser() if email_address no... | def send_email(self, REQUEST, RESPONSE, group_id, email_address, email_id, message, subject=''): """ Send an email to the group. We send the email via the mail server so it will handle things like message ID's for us. """ list_manager = self.get_xwfMailingListManager() sec = getSecurityManager() user = sec.getUser... | 27,974 |
def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr, self) | def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr, self) | 27,975 |
def __init__(self, serviceParent, config): component.Service.__init__(self, config["jid"], serviceParent) | def __init__(self, serviceParent, config): component.Service.__init__(self, config["jid"], serviceParent) | 27,976 |
def onDisco(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] i = iq.query.addElement("identity") i["category"] = "proxy" i["type"] = "bytestreams" i["name"] = "JEP-65 Proxy" iq.query.addElement("feature")["var"] = "http://jabber.org/protocol/bytestreams" self.xmlstream.send(iq) | def onDisco(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] i = iq.query.addElement("identity") i["category"] = "proxy" i["type"] = "bytestreams" i["name"] = "SOCKS5 Bytestreams Service" iq.query.addElement("feature")["var"] = "http://jabber.org/protocol/bytestreams" self.xmlstream.... | 27,977 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,978 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,979 |
def onGetHostInfo(self, iq): iq.swapAttributeValues("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = str(self.proxyPort) self.send(iq) | def onGetHostInfo(self, iq): iq.swapAttributeValues("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jid s["host"] = self.proxyIP s["port"] = str(self.proxyPort) self.send(iq) | 27,980 |
def __init__(self, service): socks5.SOCKSv5.__init__(self) self.service = service self.supportedAuthMechs = [socks5.AUTHMECH_ANON] self.supportedAddrs = [socks5.ADDR_DOMAINNAME] self.enabledCommands = [socks5.CMD_CONNECT] self.addr = "" | def __init__(self, service): socks5.SOCKSv5.__init__(self) self.service = service self.supportedAuthMechs = [socks5.AUTHMECH_ANON] self.supportedAddrs = [socks5.ADDR_DOMAINNAME] self.enabledCommands = [socks5.CMD_CONNECT] self.addr = "" | 27,981 |
def connectRequested(self, addr, port): # Check for special connect to the namespace -- this signifies that the client # is just checking to ensure it can connect to the streamhost if addr == "http://jabber.org/protocol/bytestreams": self.connectCompleted(addr, 0) self.transport.loseConnection() return # Save addr, fo... | def connectRequested(self, addr, port): # Check for special connect to the namespace -- this signifies that the client # is just checking to ensure it can connect to the streamhost if addr == "http://jabber.org/protocol/bytestreams": self.connectCompleted(addr, 0) self.transport.loseConnection() return # Save addr, fo... | 27,982 |
def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr, self) | def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.unregisterProducer() self.peersock = None self.service.removeActiveConnection(self.addr, self) | 27,983 |
def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr, self) | def connectionLost(self, reason): if self.state == socks5.STATE_CONNECT_PENDING: self.service.removePendingConnection(self.addr, self) else: if self.peersock != None: self.peersock.peersock = None self.peersock.transport.loseConnection() self.peersock = None self.service.removeActiveConnection(self.addr) | 27,984 |
def componentDisconnected(self): if self.proxy != None: self.proxy.loseConnection() | defcomponentDisconnected(self):ifself.proxy!=None:self.proxy.loseConnection() | 27,985 |
def onGetHostInfo(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = self.proxyPort self.xmlstream.send(iq) | def onGetHostInfo(self, iq): iq.swapAttributeValues("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = self.proxyPort self.xmlstream.send(iq) | 27,986 |
def onGetHostInfo(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = self.proxyPort self.xmlstream.send(iq) | def onGetHostInfo(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] s = iq.query.addElement("streamhost") s["jid"] = self.jabberId s["host"] = self.proxyIP s["port"] = str(self.proxyPort) self.xmlstream.send(iq) | 27,987 |
def onDisco(self, iq): iq.swapAttribs("to", "from") iq["type"] = "result" iq.query.children = [] i = iq.query.addElement("identity") i["category"] = "proxy" i["type"] = "bytestreams" i["name"] = "SOCKS5 Bytestreams Service" iq.query.addElement("feature")["var"] = "http://jabber.org/protocol/bytestreams" self.xmlstream.... | def onDisco(self, iq): print iq.toXml() iq.swapAttributeValues("to", "from") iq["type"] = "result" iq.query.children = [] i = iq.query.addElement("identity") i["category"] = "proxy" i["type"] = "bytestreams" i["name"] = "SOCKS5 Bytestreams Service" iq.query.addElement("feature")["var"] = "http://jabber.org/protocol/byt... | 27,988 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,989 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,990 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,991 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) | 27,992 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | 27,993 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | 27,994 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | 27,995 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | 27,996 |
def onActivateStream(self, iq): sid = hashSID(iq.query["sid"], iq["from"], str(iq.query.activate)) log.msg("Activation requested for: ", sid) | def onActivateStream(self, iq): fromJID = jid.internJID(iq["from"]) activateJID = jid.internJID(iq.query.activate) sid = hashSID(iq.query["sid"], fromJID, activateJID) log.msg("Activation requested for: ", sid) | 27,997 |
def compare_func(): s=""" | def compare_func(): s=""" | 27,998 |
def compare_func(): s=""" | def compare_func(): s=""" | 27,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.