rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if not re.search(r"{{-.*-}}", l):
if not re.search(r"{{-.*-.*}}", l):
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
2e7db129055f80b1ee24b678ddba316192b6734b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/2e7db129055f80b1ee24b678ddba316192b6734b/wiktio2xml.py
if not re.search(r"{{-.*-}}", l):
if not re.search(r"{{-.*-.*}}", l):
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
2e7db129055f80b1ee24b678ddba316192b6734b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/2e7db129055f80b1ee24b678ddba316192b6734b/wiktio2xml.py
if not re.search(r"{{-.*-}}", l):
if not re.search(r"{{-.*-.*}}", l):
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
2e7db129055f80b1ee24b678ddba316192b6734b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/2e7db129055f80b1ee24b678ddba316192b6734b/wiktio2xml.py
file = file[1] print "voices/fr/words/" + file.replace("}}", "")
file = file[1].replace("}}", "") print "<a href=http://fr.wiktionary.org/wiki/Fichier:" \ + file + ">" + file + "</a>"
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
2e7db129055f80b1ee24b678ddba316192b6734b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/2e7db129055f80b1ee24b678ddba316192b6734b/wiktio2xml.py
print self.equivs
def __init__(self, gcomprisBoard): # Save the gcomprisBoard, it defines everything we need # to know from the core self.gcomprisBoard = gcomprisBoard
688c17fe23a581d12f8605c8f929efd7a834f840 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/688c17fe23a581d12f8605c8f929efd7a834f840/hangman.py
l = concat + l
def parseText(self): inWord = wiktio.Word() inDefinition = None inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = "" filterIndent = "" gender = ""
693ebee3c07d10de8294c115918813df0ffbb607 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/693ebee3c07d10de8294c115918813df0ffbb607/wiktio2xml.py
print "Tuxpaint not killed", self.pid
print "Tuxpaint not killed", pid
def end(self): gcompris.sound.reopen() global pid # force kill - data loss if pid != None: print "Tuxpaint not killed", self.pid #import os #os.kill(self.pid, signal.SIGKILL) if self.rootitem != None: self.rootitem.remove() self.rootitem = None
45b5cf3d4ebc20ecaaf4a3179202244ecc07876d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/45b5cf3d4ebc20ecaaf4a3179202244ecc07876d/tuxpaint.py
if (gcompris.get_properties().fullscreen and not gcompris.get_properties().noxf86vm): gtk.gdk.pointer_grab(data.window.window, True, 0, data.window.window) if (gtk.gtk_version <= (2,6,10)): data.window.unfullscreen() data.window.fullscreen()
def child_callback(fd, cond, data): # restore pointergrab if running fullscreen if (gcompris.get_properties().fullscreen and not gcompris.get_properties().noxf86vm): gtk.gdk.pointer_grab(data.window.window, True, 0, data.window.window) #bug in gtk2.6/window if (gtk.gtk_version <= (2,6,10)): data.window.unfullscreen()...
45b5cf3d4ebc20ecaaf4a3179202244ecc07876d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11306/45b5cf3d4ebc20ecaaf4a3179202244ecc07876d/tuxpaint.py
req_string = "show line1:%s line2:%s duration:%i " req_string += "brightness:%i font:%s centered:%i"
req_string = "show line1:%s line2:%s duration:%s " req_string += "brightness:%s font:%s centered:%i"
def show(self, line1="", line2="", duration=3, brightness=4, font="standard", centered=False): """Displays text on Player display""" if font == "huge": line1 = "" line1, line2 = urllib.quote(line1), urllib.quote(line2) req_string = "show line1:%s line2:%s duration:%i " req_string += "brightness:%i font:%s centered:%i" ...
6768994c2cf8f8867a578b903d001b9de8119c1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11405/6768994c2cf8f8867a578b903d001b9de8119c1c/player.py
(line1, line2, duration, brightness, font, int(centered)))
(line1, line2, str(duration), str(brightness), font, int(centered))) def display(self, line1="", line2="", duration=3): line1, line2 = urllib.quote(line1), urllib.quote(line2) req_string = "display line1:%s line2:%s duration:%s " self.request(req_string % (line1, line2, str(duration))
def show(self, line1="", line2="", duration=3, brightness=4, font="standard", centered=False): """Displays text on Player display""" if font == "huge": line1 = "" line1, line2 = urllib.quote(line1), urllib.quote(line2) req_string = "show line1:%s line2:%s duration:%i " req_string += "brightness:%i font:%s centered:%i" ...
6768994c2cf8f8867a578b903d001b9de8119c1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11405/6768994c2cf8f8867a578b903d001b9de8119c1c/player.py
req_string = "display line1:%s line2:%s duration:%s "
req_string = "display %s %s %s"
def display(self, line1="", line2="", duration=3): line1, line2 = urllib.quote(line1), urllib.quote(line2) req_string = "display line1:%s line2:%s duration:%s " self.request(req_string % (line1, line2, str(duration)))
6c406b2f62657570837019f93add3a70f96ef28f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11405/6c406b2f62657570837019f93add3a70f96ef28f/player.py
p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
def run_test_prog(bits, pagesize, cmd, **env): if paranoid_pool_check: beforepool = snapshot_pool_state() print "Pool state: %s" % str(beforepool) local_env = os.environ.copy() local_env.update(env) local_env["PATH"] = "./obj%d:../obj%d:%s" \ % (bits, bits, local_env.get("PATH", "")) local_env["LD_LIBRARY_PATH"] = ".....
e183f433594a8f3bf59ffa6c90c56445281736f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3715/e183f433594a8f3bf59ffa6c90c56445281736f1/run_tests.py
if len(wordsizes) == 0: wordsizes = set([32, 64])
if len(wordsizes) == 0: wordsizes = get_wordsizes()
def main(): global wordsizes, pagesizes, dangerous, paranoid_pool_check, system_default_hpage_size testsets = set() env_override = {"QUIET_TEST": "1", "HUGETLBFS_MOUNTS": "", "HUGETLB_ELFMAP": None, "HUGETLB_MORECORE": None} env_defaults = {"HUGETLB_VERBOSE": "0"} dangerous = 0 paranoid_pool_check = False try: opts, a...
30c9d6c77246225e28fe3282cab92b554b5f8bb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3715/30c9d6c77246225e28fe3282cab92b554b5f8bb2/run_tests.py
profiles = ['profile-recensio.policy:default'] + additional_profiles
profiles = ['profile-recensio.policy:default'] + additional_profiles +\ ['profile-recensio.policy:default']
def reloadProfiles(br): profiles = ['profile-recensio.policy:default'] + additional_profiles for profile in profiles: print "Trying to load profile %s" % profile br.open(host + '/portal_setup/manage_importSteps') br.getControl(name='context_id', index=0).value = [profile] br.getForm('profileform').submit() br.getContro...
103cea0a3672af9e1f91aaa4bb27a1d1abf81fe2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/103cea0a3672af9e1f91aaa4bb27a1d1abf81fe2/__init__.py
criterion.setLocation('/')
criterion.setRelativePath('/') criterion.setRecurse(True)
def configureCollection(collection, types, location): try: criterion = collection.addCriterion(field='created', \ criterion_type='ATFriendlyDateCriteria') criterion.setValue(31) criterion.setOperation('less') criterion.setDateRange('-') except BadRequest: pass try: criterion = collection.addCriterion(field='Type', \ cr...
a1e61e0be15636594b4ae06cb9d328bd515aa0cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/a1e61e0be15636594b4ae06cb9d328bd515aa0cb/setuphandlers.py
portal_types = []
portal_types = ['Rezension']
def configureContentRatings(context): portal = context.getSite() utility = getUtility(IRatingCategoryAssignment) portal_types = [] categories_to_set = [utility._avalable_categories.by_token[''].value] for type in portal_types: utility.assign_categories(type, categories_to_set)
45d3975fb6b9201a8552018fc75d02dc6ba9c3d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/45d3975fb6b9201a8552018fc75d02dc6ba9c3d8/setuphandlers.py
criterion = new_discussions.addCriterion(field='last_comment_date',\ criterion_type='ATFriendlyDateCriteria') criterion.setValue(31) criterion.setOperation('less') criterion.setDateRange('-')
try: criterion = new_discussions.addCriterion(field='last_comment_date',\ criterion_type='ATFriendlyDateCriteria') criterion.setValue(31) criterion.setOperation('less') criterion.setDateRange('-') except BadRequest: pass
def configureCollection(collection, types, location): try: criterion = collection.addCriterion(field='created', \ criterion_type='ATFriendlyDateCriteria') criterion.setValue(31) criterion.setOperation('less') criterion.setDateRange('-') except BadRequest: pass try: criterion = collection.addCriterion(field='Type', \ cr...
45d3975fb6b9201a8552018fc75d02dc6ba9c3d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/45d3975fb6b9201a8552018fc75d02dc6ba9c3d8/setuphandlers.py
if id not in ['images']: language = 'de' else:
if id in ['images']:
def setImportedContentLanguages(context): portal = context.getSite() for id in imported_content: ob = portal.unrestrictedTraverse(id, None) if not ob: log.warning('Object %s not found. Please run import step "Recensio initial content"' % (id)) continue if id not in ['images']: language = 'de' else: language = '' doSetL...
445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py
doSetLanguage(ob, language)
doSetLanguage(ob, language)
def setImportedContentLanguages(context): portal = context.getSite() for id in imported_content: ob = portal.unrestrictedTraverse(id, None) if not ob: log.warning('Object %s not found. Please run import step "Recensio initial content"' % (id)) continue if id not in ['images']: language = 'de' else: language = '' doSetL...
445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py
if subob and subob.portal_type == 'Folder': translate_folder(path + [item], language, path_trans + [item], lang_trans)
def translate_folder(path, language, path_trans, lang_trans): ob = portal.unrestrictedTraverse(path, None) ob_trans = portal.unrestrictedTraverse(path_trans, None) for item in ob.objectIds(): subob = ob.unrestrictedTraverse(item, None) subob_trans = ob_trans.unrestrictedTraverse(item, None) if not subob_trans: log.warn...
445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py
log.warning('%s is already translated into %s!' % path,lang_trans)
log.warning('%s is already translated into %s!' % ("/".join(path + [item]),lang_trans)) if subob and subob.portal_type == 'Folder': translate_folder(path + [item], language, path_trans + [item], lang_trans)
def translate_folder(path, language, path_trans, lang_trans): ob = portal.unrestrictedTraverse(path, None) ob_trans = portal.unrestrictedTraverse(path_trans, None) for item in ob.objectIds(): subob = ob.unrestrictedTraverse(item, None) subob_trans = ob_trans.unrestrictedTraverse(item, None) if not subob_trans: log.warn...
445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py
if ob.portal_type == 'Folder': translate_folder([id], language, [id_trans], lang_trans)
def translate_folder(path, language, path_trans, lang_trans): ob = portal.unrestrictedTraverse(path, None) ob_trans = portal.unrestrictedTraverse(path_trans, None) for item in ob.objectIds(): subob = ob.unrestrictedTraverse(item, None) subob_trans = ob_trans.unrestrictedTraverse(item, None) if not subob_trans: log.warn...
445c640b1b0bca473c2354f6a1a8ca81dba5efa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/445c640b1b0bca473c2354f6a1a8ca81dba5efa1/setuphandlers.py
fp = getattr(site, 'front-page', None) if not fp: log.error('Front page not found') return id = 'layout' if fp.hasProperty(id): fp._delProperty(id) fp._setProperty(id=id, value='homepage-view', type='string')
for fp_id in ['front-page', 'front-page-en', 'front-page-fr']: fp = getattr(site, fp_id, None) if not fp: log.error('%s not found' % fp_id) continue id = 'layout' if fp.hasProperty(id): fp._delProperty(id) fp._setProperty(id=id, value='homepage-view', type='string')
def setupHomepage(context): site = context.getSite() fp = getattr(site, 'front-page', None) if not fp: log.error('Front page not found') return id = 'layout' if fp.hasProperty(id): fp._delProperty(id) fp._setProperty(id=id, value='homepage-view', type='string') log.debug('Homepage view was set on the front page') # se...
f2abd3d751b93638d0417fbb150a989d7d79cd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f2abd3d751b93638d0417fbb150a989d7d79cd82/setuphandlers.py
autoren = getattr(portal, 'autoren', None) if not autoren: log.warning('Folder "autoren" not found on portal. Please run recensio.contenttypes.initial_content') else: fp = getattr(autoren, 'index_html') id = 'layout' if fp.hasProperty(id): fp._delProperty(id) fp._setProperty(id=id, value='authorsearch', type='string') ...
for autoren_id in ['autoren', 'autoren-en', 'autoren-fr']: autoren = getattr(portal, autoren_id, None) if not autoren: log.warning('Folder "%s" not found on portal. Please run recensio.contenttypes.initial_content' % autoren_id) else: fp = getattr(autoren, 'index_html') id = 'layout' if fp.hasProperty(id): fp._delPrope...
def setViewsOnFolders(context): portal = context.getSite() autoren = getattr(portal, 'autoren', None) if not autoren: log.warning('Folder "autoren" not found on portal. Please run recensio.contenttypes.initial_content') else: fp = getattr(autoren, 'index_html') id = 'layout' if fp.hasProperty(id): fp._delProperty(id) ...
f2abd3d751b93638d0417fbb150a989d7d79cd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f2abd3d751b93638d0417fbb150a989d7d79cd82/setuphandlers.py
obj = getattr(portal, id + lang, None)
obj = getattr(portal, (id + lang), None)
def publishImportedContent(context): portal = context.getSite() pwt = getToolByName(portal, 'portal_workflow') for id in imported_content: for lang in ['', '-en', '-fr']: obj = getattr(portal, id + lang, None) if not obj: log.warning('Object %s not found. Please run import step "Recensio initial content"' % id + lang) ...
f2abd3d751b93638d0417fbb150a989d7d79cd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f2abd3d751b93638d0417fbb150a989d7d79cd82/setuphandlers.py
log.warning('Object %s not found. Please run import step "Recensio initial content"' % id + lang)
log.warning('Object %s not found. Please run import step "Recensio initial content"' % (id + lang))
def publishImportedContent(context): portal = context.getSite() pwt = getToolByName(portal, 'portal_workflow') for id in imported_content: for lang in ['', '-en', '-fr']: obj = getattr(portal, id + lang, None) if not obj: log.warning('Object %s not found. Please run import step "Recensio initial content"' % id + lang) ...
f2abd3d751b93638d0417fbb150a989d7d79cd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f2abd3d751b93638d0417fbb150a989d7d79cd82/setuphandlers.py
self.assertTrue(compare(expected, real), ("Error in Line %i:\nExp:\n%s\nGot:\n%s" % (lineno, '\n'.join(expected_mail.split('<<<\n')[max(0, lineno-2):lineno+3]), '\n'.join(view.mailhost.sentMail.split('<<<\n')[max(0, lineno-2):lineno+3]))).encode('ascii', 'ignore'))
self.assertTrue(compare(expected, real), ("Error in Line %i:\nExp:\n%s\nGot:\n%s" % (lineno, '<<<\n'.join(expected_mail.split('\n')[max(0, lineno-2):lineno+3]), '<<<\n'.join(view.mailhost.sentMail.split('\n')[max(0, lineno-2):lineno+3]))).encode('ascii', 'ignore'))
def send(self, messageText, mto, mfrom, subject, charset): self.sentMail = messageText
b8c08f0b2deedab1576d093d923a2d0216549e8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/b8c08f0b2deedab1576d093d923a2d0216549e8d/testEmailNewPublication.py
mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() membership_tool = getToolByName(self.context, 'portal_membership') if membership_tool.isAnonymousUser(): self.errors.append(_('You are not logged in')) user = membership_tool.getAuthenticatedMember() ma...
try: mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() membership_tool = getToolByName(self.context, 'portal_membership') if membership_tool.isAnonymousUser(): self.errors.append(_('You are not logged in')) raise ValidationError() user = membership_too...
def __call__(self): self.errors = [] mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() membership_tool = getToolByName(self.context, 'portal_membership') if membership_tool.isAnonymousUser(): self.errors.append(_('You are not logged in')) user = member...
bc18d5e3ed92357461700e0371f326cc3d0ef52f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bc18d5e3ed92357461700e0371f326cc3d0ef52f/email.py
return super(MailCollection, self).__call__()
except ValidationError: pass finally: messages = IStatusMessage(self.request) if self.errors: for error in self.errors: messages.addStatusMessage(error, type='error') else: messages.addStatusMessage(u"Mail sending will be prepared. Mail will be sent to %s" % mail_to, type="info") return self.request.response.redirect(s...
def __call__(self): self.errors = [] mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() membership_tool = getToolByName(self.context, 'portal_membership') if membership_tool.isAnonymousUser(): self.errors.append(_('You are not logged in')) user = member...
bc18d5e3ed92357461700e0371f326cc3d0ef52f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bc18d5e3ed92357461700e0371f326cc3d0ef52f/email.py
self.mag.invokeFactory(type_name="Volume", id=review['volume'])
self.mag.invokeFactory(type_name="Volume", id=review['volume'], title=review['volume'])
def _addReview(self, review): if review['volume'] not in self.mag: self.mag.invokeFactory(type_name="Volume", id=review['volume']) volume = self.mag[review['volume']] if review['issue'] not in volume: volume.invokeFactory(type_name='Issue', id=review['issue']) issue = volume[review['issue']] new_id = self.plone_utils.n...
6c7f2ad411550ebf57280a49e309cc501f575568 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/6c7f2ad411550ebf57280a49e309cc501f575568/sehepunkte.py
volume.invokeFactory(type_name='Issue', id=review['issue'])
volume.invokeFactory(type_name='Issue', id=review['issue'], title=review['issue'])
def _addReview(self, review): if review['volume'] not in self.mag: self.mag.invokeFactory(type_name="Volume", id=review['volume']) volume = self.mag[review['volume']] if review['issue'] not in volume: volume.invokeFactory(type_name='Issue', id=review['issue']) issue = volume[review['issue']] new_id = self.plone_utils.n...
6c7f2ad411550ebf57280a49e309cc501f575568 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/6c7f2ad411550ebf57280a49e309cc501f575568/sehepunkte.py
request.form['pdf'] = FakeFile('../../src/recensio.imports/samples/demo1.pdf') request.form['xls'] = file('../../src/recensio.imports/samples/initial.xls')
request.form['pdf'] = FakeFile( '../../src/recensio.imports/samples/demo1.pdf') request.form['xls'] = FakeFile( '../../src/recensio.imports/samples/initial.xls')
def testFormat(self): portal = self.layer['portal'] setRoles(portal, TEST_USER_ID, ['Manager']) setRoles(portal, TEST_USER_NAME, ['Manager']) request = self.layer['request'] reviews = portal["sample-reviews"] reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory...
92d931724dcad929fac06e2d57bc37751f665de8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/92d931724dcad929fac06e2d57bc37751f665de8/testExcelImport.py
applyProfile(portal, 'recensio.contenttypes:example_content')
def setUpPloneSite(self, portal): wftool = getToolByName(portal, 'portal_workflow') wftool.setDefaultChain('plone_workflow') applyProfile(portal, 'Products.CMFPlone:plone-content') applyProfile(portal, 'recensio.policy:test') applyProfile(portal, 'recensio.contenttypes:example_content')
3191c038ee37108e9bb8748dd0902d7874b08161 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/3191c038ee37108e9bb8748dd0902d7874b08161/layer.py
@guard def addWorkflowScriptsForRegularContent(context): script = """ rwh = context.restrictedTraverse('@@recensio_workflow_helper') rwh.handleTransition(info) """ addWorkflowScripts( context, wf_name = 'simple_publication_workflow', script_name = 'handle_change', script_contents = script, after_transitions_to_hook_in ...
def addWorkflowScriptsForComments(context): script = """
fba4d2cfae5c38e41453bf6c14a48c4d1c50fe0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/fba4d2cfae5c38e41453bf6c14a48c4d1c50fe0f/setuphandlers.py
def customizeWorkflowAndPermissions(context): portal = context.getSite() pwf = portal.portal_workflow spw = pwf.getWorkflowById('simple_publication_workflow') spw.description = ' - Simple workflow that is useful for basic web sites. - Things start out as private, and can either be submitted for review, or published dir...
def customizeWorkflowAndPermissions(context): portal = context.getSite() pwf = portal.portal_workflow spw = pwf.getWorkflowById('simple_publication_workflow') spw.description = ' - Simple workflow that is useful for basic web sites. - Things start out as private, and can either be submitted for review, or published dir...
fba4d2cfae5c38e41453bf6c14a48c4d1c50fe0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/fba4d2cfae5c38e41453bf6c14a48c4d1c50fe0f/setuphandlers.py
log.debug('Homepage view was set on the front page') mapping = assignment_mapping_from_key(fp, 'plone.rightcolumn', CONTEXT_CATEGORY, '/'.join(fp.getPhysicalPath())) id = 'homepage-intro' if id not in mapping: mapping[id] = static.Assignment(header=u'Intro', text=portlet_hp_text, omit_border=True)
log.debug('Homepage view was set on the front page') mapping = assignment_mapping_from_key(fp, 'plone.rightcolumn', CONTEXT_CATEGORY, '/'.join(fp.getPhysicalPath())) id = 'homepage-intro' if id not in mapping: mapping[id] = static.Assignment(header=u'Intro', text=portlet_hp_text[fp_id], omit_border=True)
def setupHomepage(context): site = context.getSite() for fp_id in ['front-page', 'front-page-en', 'front-page-fr']: fp = getattr(site, fp_id, None) if not fp: log.error('%s not found' % fp_id) continue id = 'layout' if fp.hasProperty(id): fp._delProperty(id) fp._setProperty(id=id, value='homepage-view', type='string') ...
21c4bb49b6943853a239c421ea79aff9ee4b7887 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/21c4bb49b6943853a239c421ea79aff9ee4b7887/setuphandlers.py
self.originalUrlGetter = sehepunkte_parser._getHTMLData sehepunkte_parser._getHTMLData = lambda a:a
def setUp(self): self.fake_logger = FakeLogger() importSehepunkte.logger = self.fake_logger self.originalUrlGetter = sehepunkte_parser._getHTMLData sehepunkte_parser._getHTMLData = lambda a:a
49db0250fa267a14a19c55d2b77b3c41a0a49e52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/49db0250fa267a14a19c55d2b77b3c41a0a49e52/testSehepunkte.py
sehepunkte_parser._getHTMLData = self.originalUrlGetter
pass
def tearDown(self): sehepunkte_parser._getHTMLData = self.originalUrlGetter
49db0250fa267a14a19c55d2b77b3c41a0a49e52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/49db0250fa267a14a19c55d2b77b3c41a0a49e52/testSehepunkte.py
for dataset in data: dataset.pop('html')
def testImportGood(self): should_be = [] data = [x for x in sehepunkte_parser.parse(file(testdata_filename).read())] for dataset in data: dataset.pop('html') self.assertEquals(testdata_parsed, list(data))
49db0250fa267a14a19c55d2b77b3c41a0a49e52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/49db0250fa267a14a19c55d2b77b3c41a0a49e52/testSehepunkte.py
def testBadURL(self): sehepunkte_parser._getHTMLData = self.originalUrlGetter data = file(testdata_filename).read() data = data.replace('http://www.sehepunkte.de/export/rezension_17542.html', 'http://doesnotexist.syslab.de') self.assertRaises(IOError, list, sehepunkte_parser.parse(data))
def testImportBad(self): data1 = file(testdata_filename).read() data2 = data1.replace('<review id="17542">', '<somethingelse>') data2 = data2.replace('</review>', '</somethingelse>', 1) data1 = sehepunkte_parser.parse(data1) data2 = sehepunkte_parser.parse(data2) self.assertEquals(len(list(data1)), len(list(data2)) + 1...
49db0250fa267a14a19c55d2b77b3c41a0a49e52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/49db0250fa267a14a19c55d2b77b3c41a0a49e52/testSehepunkte.py
settings = registry.forInterface(IRecensioSettings)
try: settings = registry.forInterface(IRecensioSettings) except KeyError: settings = dict()
def handleTransition(self, info): membership_tool = getToolByName(self.context, 'portal_membership') user = membership_tool.getAuthenticatedMember() mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' %...
f46453582494b135951a948be11b1eb2e71d9fd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f46453582494b135951a948be11b1eb2e71d9fd6/workflow.py
mail_to = settings.review_submitted_email or mail_from
mail_to = getattr(settings, 'review_submitted_email', None) or mail_from
def handleTransition(self, info): membership_tool = getToolByName(self.context, 'portal_membership') user = membership_tool.getAuthenticatedMember() mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' %...
f46453582494b135951a948be11b1eb2e71d9fd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f46453582494b135951a948be11b1eb2e71d9fd6/workflow.py
Die folgende Mail wurde generiert zur Benachrichtigung von Fürchtegott Hubermüller. Bitte prüfen Sie sie und leiten sie ggf. weiter an
Die folgende Mail wurde generiert zur Benachrichtigung von Tadeusz Kot\u0142owski. Bitte prüfen Sie sie und leiten sie ggf. weiter an
def testFormat(self): expected_mail = u'''Liebe Redaktion,
80d5b49f62e4f1683cb7342df0ec9c02f12799b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/80d5b49f62e4f1683cb7342df0ec9c02f12799b5/testEmailNewPublication.py
Dear Mr Fürchtegott Hubermüller,
Dear Mr Tadeusz Kot\u0142owski,
def testFormat(self): expected_mail = u'''Liebe Redaktion,
80d5b49f62e4f1683cb7342df0ec9c02f12799b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/80d5b49f62e4f1683cb7342df0ec9c02f12799b5/testEmailNewPublication.py
self.assertEquals(2, obj.pageStart) self.assertEquals(5, obj.pageEnd)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
self.assertEquals('653645', obj.issn)
self.assertEquals('653645', obj.isbn)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
self.assertEquals(2, obj.pageStart) self.assertEquals(4, obj.pageEnd)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
self.assertEquals('265742', obj.issn)
self.assertEquals('265742', obj.isbn)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
self.assertEquals('4', obj.issn) self.assertEquals('2000', obj.yearOfPublication)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
self.assertEquals(({u'lastname': u'Autor Nachname', u'firstname': u'Autor Vorname'},), obj.authors) self.assertEquals(3, obj.pageStart) self.assertEquals(4, obj.pageEnd)
def testFormat(self): portal = self.layer['portal'] request = self.layer['request'] setRoles(portal, TEST_USER_NAME, ['Manager']) reviews = portal.reviews reviews.invokeFactory('Publication', id='pub', title='pub') publication = reviews.pub publication.invokeFactory('Volume', id='vol', title='vol') vol = publication.vo...
210449271edd39a39aa8b4fde2b3d84539c4b5a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/210449271edd39a39aa8b4fde2b3d84539c4b5a5/testExcelImport.py
messages.addStatusMessage(self.ts.translate(_('mail_sending_prepared'), context=self.context) % mail_to, type="info")
messages.addStatusMessage(self.ts.translate(_('mail_sending_prepared', default="uMailversand wird vorbereitet. Mail wird versandt an %s"), context=self.context) % mail_to, type="info")
def __call__(self): self.errors = [] messages = IStatusMessage(self.request) try: mail_from, mail_to = self.getMailAddresses() registry = getUtility(IRegistry) settings = registry.forInterface(INewsletterSettings) if not settings.mail_format: self.errors.append(_('Mailsettings not configured')) raise ValidationError()
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
subject = self.ts.translate(_('mail_new_comment_subject'), context=self.context) mail_to = self.findRecipient() msg_template = self.ts.translate(_('mail_new_comment_body'), context=self.context)
mail_to, pref_lang = self.findRecipient() subject = self.ts.translate(_('mail_new_comment_subject'), target_language=pref_lang) msg_template = self.ts.translate(_('mail_new_comment_body'), target_language=pref_lang)
def __call__(self): root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' % (mail_info.email_from_name, mail_info.email_from_address)
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
messages.addStatusMessage(self.ts.translate(_('mail_no_recipients'), context=self.context), type="warning")
messages.addStatusMessage(self.ts.translate(_('mail_no_recipients'), target_language=pref_lang), type="warning")
def sendMail(self, msg, mail_from, mail_to, subject): if mail_to: self.mailhost.send(messageText=msg, mto=mail_to, mfrom=mail_from, subject=subject, charset='utf-8') else: messages = IStatusMessage(self.request) messages.addStatusMessage(self.ts.translate(_('mail_no_recipients'), context=self.context), type="warning")
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
return owner.getProperty('email')
return owner.getProperty('email'), owner.getProperty('preferred_language', 'de')
def findRecipient(self): membership_tool = getToolByName(self.context, 'portal_membership') owner = membership_tool.getMemberById(self.context.__parent__.__parent__.Creator()).getUser() return owner.getProperty('email')
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
args['mail_to'] = args['mail_from'] msg_template = self.ts.translate(_('mail_new_publication_intro'), context=self.context) + self.ts.translate(_('mail_new_publication_body'), context=self.context)
pref_lang = 'de' if author.has_key('email') and author['email']: args['mail_to'] = author['email'] pref_lang = get_preferred_language(author['email'], pref_lang) msg_template = self.ts.translate(_('mail_new_publication_body'), target_language=pref_lang) else: args['mail_to'] = args['mail_from'] pref_lang = get_preferre...
def __call__(self): root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' % (mail_info.email_from_name, mail_info.email_from_address) referenceAuthors = getattr(self.context, 'referenceAuthors', [])
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
subject = self.ts.translate(_('mail_new_publication_subject'), context=self.context) % args['title']
subject = self.ts.translate(_('mail_new_publication_subject', default=u"Es wurde eine Rezension von %s veröffentlicht"), target_language=pref_lang) % args['title']
def __call__(self): root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' % (mail_info.email_from_name, mail_info.email_from_address) referenceAuthors = getattr(self.context, 'referenceAuthors', [])
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
mail_to = self.findRecipient(result)
mail_to, pref_lang = self.findRecipient(result)
def sendMail(self, result): msg = self.formatMessage(result) mail_to = self.findRecipient(result) mail_from = self.findSender() subject = self.ts.translate(_('mail_uncommented_subject'), context=self.context) self.mailhost.send(messageText=msg, mto=mail_to, mfrom=mail_from, subject=subject, charset='utf-8')
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
subject = self.ts.translate(_('mail_uncommented_subject'), context=self.context)
subject = self.ts.translate(_('mail_uncommented_subject'), target_language=pref_lang)
def sendMail(self, result): msg = self.formatMessage(result) mail_to = self.findRecipient(result) mail_from = self.findSender() subject = self.ts.translate(_('mail_uncommented_subject'), context=self.context) self.mailhost.send(messageText=msg, mto=mail_to, mfrom=mail_from, subject=subject, charset='utf-8')
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
msg_template = self.ts.translate(_('mail_uncommented_body'), context=self.context)
msg_template = self.ts.translate(_('mail_uncommented_body'), target_language=pref_lang)
def formatMessage(self, result): title = result.Title owner_name = result.Creator url = result.getURL() date = result.created.strftime('%d.%m.%Y') msg_template = self.ts.translate(_('mail_uncommented_body'), context=self.context)
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
return owner.getProperty('email') or self.findSender()
return owner.getProperty('email') or self.findSender(), owner.getProperty('preferred_language', 'de')
def findRecipient(self, result): membership_tool = getToolByName(self.context, 'portal_membership') owner = membership_tool.getMemberById(result.Creator).getUser() return owner.getProperty('email') or self.findSender()
bf24e656edadbf8ae1822a6d6171ec4569a6ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/bf24e656edadbf8ae1822a6d6171ec4569a6ebed/email.py
log.info('I am sending the following msg:\n%s' % msg)
log.info(u'I am sending the following msg:\n%s' % msg)
def handleTransition(self, info): membership_tool = getToolByName(self.context, 'portal_membership') user = membership_tool.getAuthenticatedMember() mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' %...
1c43e04d66670d365375430fb912585f18838a11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/1c43e04d66670d365375430fb912585f18838a11/workflow.py
subject=subject, immediate=True)
subject=subject, charset='utf-8', immediate=True)
def handleTransition(self, info): membership_tool = getToolByName(self.context, 'portal_membership') user = membership_tool.getAuthenticatedMember() mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' %...
1c43e04d66670d365375430fb912585f18838a11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/1c43e04d66670d365375430fb912585f18838a11/workflow.py
mailhost.send(msg, mail_from, mail_to, title, immediate=True)
mailhost.send(messageText=msg, mto=mail_to, mfrom=mail_from, subject=subject, immediate=True)
def handleTransition(self, info): membership_tool = getToolByName(self.context, 'portal_membership') user = membership_tool.getAuthenticatedMember() mailhost = getToolByName(self.context, 'MailHost') root = getToolByName(self.context, 'portal_url').getPortalObject() mail_info = IMailSchema(root) mail_from = '%s <%s>' %...
072d4eb61914418de0b8e661a691e4b38a5dd250 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/072d4eb61914418de0b8e661a691e4b38a5dd250/workflow.py
return owner.getProperty('email'), owner.getProperty('preferred_language', 'de')
return owner.getProperty('email'), owner.getProperty('preferred_language', 'en')
def findRecipient(self): membership_tool = getToolByName(self.context, 'portal_membership') owner = membership_tool.getMemberById(self.context.__parent__.__parent__.Creator()).getUser() return owner.getProperty('email'), owner.getProperty('preferred_language', 'de')
f71293d440addf09542afa70fa6080b95178dd12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f71293d440addf09542afa70fa6080b95178dd12/email.py
def get_preferred_language(email, default='de'):
def get_preferred_language(email, default='en'):
def get_preferred_language(email, default='de'): found = self.pas.searchUsers(email=args['mail_to']) if found: owner = self.membership_tool.getMemberById(found[0]['userid']).getUser() return owner.getProperty('preferred_language', default) else: return default
f71293d440addf09542afa70fa6080b95178dd12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f71293d440addf09542afa70fa6080b95178dd12/email.py
pref_lang = 'de'
pref_lang = 'en'
def get_preferred_language(email, default='de'): found = self.pas.searchUsers(email=args['mail_to']) if found: owner = self.membership_tool.getMemberById(found[0]['userid']).getUser() return owner.getProperty('preferred_language', default) else: return default
f71293d440addf09542afa70fa6080b95178dd12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f71293d440addf09542afa70fa6080b95178dd12/email.py
return owner.getProperty('email') or self.findSender(), owner.getProperty('preferred_language', 'de')
return owner.getProperty('email') or self.findSender(), owner.getProperty('preferred_language', 'en')
def findRecipient(self, result): membership_tool = getToolByName(self.context, 'portal_membership') owner = membership_tool.getMemberById(result.Creator).getUser() return owner.getProperty('email') or self.findSender(), owner.getProperty('preferred_language', 'de')
f71293d440addf09542afa70fa6080b95178dd12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/f71293d440addf09542afa70fa6080b95178dd12/email.py
for lang in ['', 'en', 'fr']: if lang: id = id + '-' + lang obj = getattr(portal, id, None)
for lang in ['', '-en', '-fr']: obj = getattr(portal, id + lang, None)
def publishImportedContent(context): portal = context.getSite() pwt = getToolByName(portal, 'portal_workflow') for id in imported_content: for lang in ['', 'en', 'fr']: if lang: id = id + '-' + lang obj = getattr(portal, id, None) if not obj: log.warning('Object %s not found. Please run import step "Recensio initial co...
9c226745d8ad510f3faabbc9ec0c575f47bc3f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/9c226745d8ad510f3faabbc9ec0c575f47bc3f2d/setuphandlers.py
log.warning('Object %s not found. Please run import step "Recensio initial content"' % id)
log.warning('Object %s not found. Please run import step "Recensio initial content"' % id + lang)
def publishImportedContent(context): portal = context.getSite() pwt = getToolByName(portal, 'portal_workflow') for id in imported_content: for lang in ['', 'en', 'fr']: if lang: id = id + '-' + lang obj = getattr(portal, id, None) if not obj: log.warning('Object %s not found. Please run import step "Recensio initial co...
9c226745d8ad510f3faabbc9ec0c575f47bc3f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/9c226745d8ad510f3faabbc9ec0c575f47bc3f2d/setuphandlers.py
addIndex('ort', 'FieldIndex', extra={'indexed_attrs': ['yearOfPublication']})
addIndex('ort', 'FieldIndex', extra={'indexed_attrs': ['placeOfPublication']})
def addIndex(name, type, **kw): if not name in cat.indexes(): log.debug('adding %s %s, kw=%s' %(type, name, kw)) cat.addIndex(name, type, **kw) elif not filter(lambda x: x.getId() == name, cat.getIndexObjects())[0].meta_type == type: cat.delIndex(name) log.debug('adding %s %s, kw=%s' %(type, name, kw)) cat.addIndex(nam...
b9b7202a1c1e1f4492319deaad6b8ccb4fd0c384 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10562/b9b7202a1c1e1f4492319deaad6b8ccb4fd0c384/setuphandlers.py
htmlpage = urllib.urlopen(url,data=postdata)
htmlpage = urllib.urlopen(self.url,data=postdata)
def __get_html(self):
acc18cfe5d2a0cedf22de297999e78022841731b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10886/acc18cfe5d2a0cedf22de297999e78022841731b/htmlparser.py
field = str(message.get_payload())
field = self.__get_body(message)
def get_messages(self):
a3b48f3ff1e058545c86b5f6370bb7be548abfcd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10886/a3b48f3ff1e058545c86b5f6370bb7be548abfcd/analyzer.py
descriptor = lifecycleevent.Attributes(IPortalObject, 'title') event = ActionSucceededEvent(self.folder, descriptor, None, None)
event = ActionSucceededEvent(self.folder, None, None, None)
def test_update_of_review_portlet(self): self.loginAsPortalOwner() portal = self.portal portal.portal_workflow.doActionFor(self.portal['front-page'], 'retract') portal.portal_workflow.doActionFor(self.portal['front-page'], 'submit') self.create_portlet(u'review', ReviewAssignment()) descriptor = lifecycleevent.Attribut...
805ef05de75a0cec7330cebd9ec40203d35470f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12181/805ef05de75a0cec7330cebd9ec40203d35470f7/test_part_reloading.py
def __call__(self, view): attr = self.attr decorator = self.decorator isclass = inspect.isclass(view) ronly = self.requestonly(view) if isclass and ronly: view = preserve_view_attrs(view, self.map_requestonly_class(view)) elif isclass: view = preserve_view_attrs(view, self.map_class(view)) elif ronly: view = preserve_...
def requestonly(self, view): attr = self.attr if attr is None: attr = '__call__' if inspect.isfunction(view): fn = view elif inspect.isclass(view): try: fn = view.__init__ except AttributeError: return False else: try: fn = getattr(view, attr) except AttributeError: return False
ae6513b9e93d876902936c257aef6a506f850aa3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/ae6513b9e93d876902936c257aef6a506f850aa3/config.py
request.route_url(mymodel)
request.model_url(mymodel)
def model_url(self, model, *elements, **kw): """ Return the URL for the model object named ``model``, using ``*elements`` and ``**kw`` as modifiers.
cd5e1437ebe1683d5fc71858fa4057a4febcebeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/cd5e1437ebe1683d5fc71858fa4057a4febcebeb/request.py
route_url(model, request)
model_url(model, request)
def model_url(self, model, *elements, **kw): """ Return the URL for the model object named ``model``, using ``*elements`` and ``**kw`` as modifiers.
cd5e1437ebe1683d5fc71858fa4057a4febcebeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/cd5e1437ebe1683d5fc71858fa4057a4febcebeb/request.py
newt = NS.sub('xmlns="http://pyramid.pylonshq.com"', newt)
newt = NS.sub('xmlns="http://pylonshq.com/pyramid"', newt)
def fix_zcml(path): for root, dirs, files in os.walk(path): for file in files: if file.endswith('.zcml'): absfile = os.path.join(root, file) text = open(absfile, 'rb').read() newt =INCLUDES.sub('include package="pyramid.includes"', text) newt = NS.sub('xmlns="http://pyramid.pylonshq.com"', newt) if text != newt: newf =...
e11fd45a5dbde00d4699522bf1b629850dc4ae55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/e11fd45a5dbde00d4699522bf1b629850dc4ae55/fix_bfg_imports.py
'relative name %r irresolveable without package' % value)
'relative name %r irresolveable without package' % (value,))
def _pkg_resources_style(self, value): """ package.module:attr style """ import pkg_resources if value.startswith('.') or value.startswith(':'): if not self.package: raise ConfigurationError( 'relative name %r irresolveable without package' % value) if value in ['.', ':']: value = self.package.__name__ else: value = se...
2a591a5f56222d7ee407a22acbe2d9cd0102373f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/2a591a5f56222d7ee407a22acbe2d9cd0102373f/configuration.py
'relative name %r irresolveable without package' % value)
'relative name %r irresolveable without package' % (value,))
def _zope_dottedname_style(self, value): """ package.module.attr style """ module = self.package and self.package.__name__ or None if value == '.': if self.package is None: raise ConfigurationError( 'relative name %r irresolveable without package' % value) name = module.split('.') else: name = value.split('.') if not n...
2a591a5f56222d7ee407a22acbe2d9cd0102373f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/2a591a5f56222d7ee407a22acbe2d9cd0102373f/configuration.py
'package' % value
'package' % (value,)
def _zope_dottedname_style(self, value): """ package.module.attr style """ module = self.package and self.package.__name__ or None if value == '.': if self.package is None: raise ConfigurationError( 'relative name %r irresolveable without package' % value) name = module.split('.') else: name = value.split('.') if not n...
2a591a5f56222d7ee407a22acbe2d9cd0102373f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/2a591a5f56222d7ee407a22acbe2d9cd0102373f/configuration.py
The ``name`` argument is a string representing :term:`view name` of the view which is registered. It may alternately be a *url prefix*. The ``path`` argument is the path on disk where the static files reside. This can be an absolute path, a package-relative path, or a :term:`asset specification`.
The ``name`` argument is a string representing an application-relative local URL prefix. It may alternately be a full URL. The ``path`` argument is the path on disk where the static files reside. This can be an absolute path, a package-relative path, or a :term:`asset specification`.
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
``Expires`` and ``Cache-Control`` headers for static assets served. Note that this argument has no effect when the ``name`` is a *url prefix*. By default, this argument is ``None``, meaning that no particular Expires or Cache-Control headers are set in the response.
``Expires`` and ``Cache-Control`` headers for static assets served. Note that this argument has no effect when the ``name`` is a *url prefix*. By default, this argument is ``None``, meaning that no particular Expires or Cache-Control headers are set in the response.
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
The ``add_static_view`` function is typically used in conjunction with the :func:`pyramid.url.static_url` function. ``add_static_view`` adds a view which renders a static asset when some URL is visited; :func:`pyramid.url.static_url` generates a URL to that asset. The ``name`` argument to ``add_static_view`` is usual...
The ``add_static_view`` function is typically used in conjunction with the :func:`pyramid.url.static_url` function. ``add_static_view`` adds a view which renders a static asset when some URL is visited; :func:`pyramid.url.static_url` generates a URL to that asset. The ``name`` argument to ``add_static_view`` is usuall...
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
Code that registers such a view can generate URLs to the view via :func:`pyramid.url.static_url`:
Code that registers such a view can generate URLs to the view via :func:`pyramid.url.static_url`:
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
When ``add_static_view`` is called with a ``name`` argument that represents a simple view name, as it is above, subsequent calls to :func:`pyramid.url.static_url` with paths that start with the ``path`` argument passed to ``add_static_view`` will generate a URL something like ``http://<Pyramid app URL>/images/logo.png`...
When ``add_static_view`` is called with a ``name`` argument that represents a URL prefix, as it is above, subsequent calls to :func:`pyramid.url.static_url` with paths that start with the ``path`` argument passed to ``add_static_view`` will generate a URL something like ``http://<Pyramid app URL>/images/logo.png``, whi...
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
Subsequently, the URLs generated by :func:`pyramid.url.static_url` for that static view will be prefixed with ``http://example.com/images``:
Subsequently, the URLs generated by :func:`pyramid.url.static_url` for that static view will be prefixed with ``http://example.com/images``:
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
When ``add_static_view`` is called with a ``name`` argument that is the URL prefix ``http://example.com/images``, subsequent calls to :func:`pyramid.url.static_url` with paths that start with the ``path`` argument passed to ``add_static_view`` will generate a URL something like ``http://example.com/logo.png``. The ext...
When ``add_static_view`` is called with a ``name`` argument that is the URL ``http://example.com/images``, subsequent calls to :func:`pyramid.url.static_url` with paths that start with the ``path`` argument passed to ``add_static_view`` will generate a URL something like ``http://example.com/logo.png``. The external w...
def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files.
781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py
fixer_names = get_fixers_from_package('repoze.bfg.fixers')
fixer_names = get_fixers_from_package('pyramid.fixers')
def main(argv=None): if argv is None: argv = sys.argv path = argv[1] fixer_names = get_fixers_from_package('repoze.bfg.fixers') tool = RefactoringTool(fixer_names) tool.refactor([path], write=True)
6f19024d79f091f1310ed547d7a1eb93b457e07e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/6f19024d79f091f1310ed547d7a1eb93b457e07e/fix_bfg_imports.py
if splitted[-1] in ('__init__.py', '__init__.pyc', '__init__.pyo'):
if splitted[-1] in init_names:
def package_name(pkg_or_module): """ If this function is passed a module, return the dotted Python package name of the package in which the module lives. If this function is passed a package, return the dotted Python package name of the package itself.""" if pkg_or_module is None: return '__main__' pkg_filename = pkg_...
3c2ed7f1aac4b88fba1c6ee4721ab11c0b3251ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/3c2ed7f1aac4b88fba1c6ee4721ab11c0b3251ed/path.py
renderer=None, view_renderer=None,
renderer=None, view_renderer=None,
def add_route(self, name, path, view=None, view_for=None, permission=None, factory=None, for_=None, header=None, xhr=False, accept=None, path_info=None, request_method=None, request_param=None, custom_predicates=(), view_permission=None, renderer=None, view_renderer=None, view_context=None, view_attr=N...
78a659d76e5bbb7544212174f010c1f50f8bcbe6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/78a659d76e5bbb7544212174f010c1f50f8bcbe6/configuration.py
:class:`pyramid.view.view_config``: ``context``, ``permission``,
:class:`pyramid.view.view_config`: ``context``, ``permission``,
def my_view(context, request): return 'OK'
06c20074f0e3e624ba69ed6b6e4d0b17649ce9e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/06c20074f0e3e624ba69ed6b6e4d0b17649ce9e6/view.py
'``pyramid.threadlocals.get_current_registry().settings`` instead or use '
'``pyramid.threadlocal.get_current_registry().settings`` instead or use '
def get_settings(): """ Return a 'settings' object for the current application. A 'settings' object is a dictionary-like object that contains key/value pairs based on the dictionary passed as the ``settings`` argument to the :class:`pyramid.configuration.Configurator` constructor or the :func:`pyramid.router.make_app`...
bc414e504a11e91da9e6aa3fdd7e3aea724104f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/bc414e504a11e91da9e6aa3fdd7e3aea724104f9/settings.py
.. note:: Using the :meth:``renderer_globals_factory``
.. note:: Using the :meth:`renderer_globals_factory`
def set_renderer_globals_factory(self, factory): """ The object passed as ``factory`` will be used by the :mod:`repoze.bfg` rendering machinery as a renderers global factory (see :ref:`adding_renderer_globals`). The factory must return a dictionary of items that will be merged intto the *system* dictionary passed in t...
2b80b6c978d9d149f41cda541b6c23a68bd2bf0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/2b80b6c978d9d149f41cda541b6c23a68bd2bf0a/configuration.py
def __init__(self, default=None): # http://code.google.com/p/google-app-engine-django/issues/detail?id=119 # we *must* use a keword argument for ``default`` here instead # of a positional argument to work around a bug in the # implementation of _threading_local.local in Python, which is # used by GAE instead of _thread...
815471bf42ab88c1524755735fbb84126bb65563 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/815471bf42ab88c1524755735fbb84126bb65563/threadlocal.py
def __init__(self, default=None): # http://code.google.com/p/google-app-engine-django/issues/detail?id=119 # we *must* use a keword argument for ``default`` here instead # of a positional argument to work around a bug in the # implementation of _threading_local.local in Python, which is # used by GAE instead of _thread...
815471bf42ab88c1524755735fbb84126bb65563 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/815471bf42ab88c1524755735fbb84126bb65563/threadlocal.py
for_ = GlobalObject(title=u'handler', required=True)
handler = GlobalObject(title=u'handler', required=True)
def route(_context, name, pattern=None, view=None, view_for=None, permission=None, factory=None, for_=None, header=None, xhr=False, accept=None, path_info=None, request_method=None, request_param=None, custom_predicates=(), view_permission=None, view_attr=None, renderer=None, view_renderer=None, view_context=None, trav...
566bcdc90ae2be6f9b304e3eee3440bac1a0da05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/566bcdc90ae2be6f9b304e3eee3440bac1a0da05/zcml.py
def route_url(route_name, request, *elements, **kw): """Generates a fully qualified URL for a named :mod:`pyramid` :term:`route configuration`. Use the route's ``name`` as the first positional argument. Use a request object as the second positional argument. Additional positional arguments are appended to the URL as...
820bd95aa720a5769f3a86a755a0eb22d8725489 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/820bd95aa720a5769f3a86a755a0eb22d8725489/url.py
def route_url(route_name, request, *elements, **kw): """Generates a fully qualified URL for a named :mod:`pyramid` :term:`route configuration`. Use the route's ``name`` as the first positional argument. Use a request object as the second positional argument. Additional positional arguments are appended to the URL as...
820bd95aa720a5769f3a86a755a0eb22d8725489 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/820bd95aa720a5769f3a86a755a0eb22d8725489/url.py
'traverse=('a','b')) => http://e.com/1/2/a/b
traverse=('a','b')) => http://e.com/1/2/a/b
def route_url(route_name, request, *elements, **kw): """Generates a fully qualified URL for a named :mod:`pyramid` :term:`route configuration`. Use the route's ``name`` as the first positional argument. Use a request object as the second positional argument. Additional positional arguments are appended to the URL as...
820bd95aa720a5769f3a86a755a0eb22d8725489 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/820bd95aa720a5769f3a86a755a0eb22d8725489/url.py
'traverse=('/a/b')) => http://e.com/1/2/a/b
traverse='/a/b') => http://e.com/1/2/a/b
def route_url(route_name, request, *elements, **kw): """Generates a fully qualified URL for a named :mod:`pyramid` :term:`route configuration`. Use the route's ``name`` as the first positional argument. Use a request object as the second positional argument. Additional positional arguments are appended to the URL as...
820bd95aa720a5769f3a86a755a0eb22d8725489 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/820bd95aa720a5769f3a86a755a0eb22d8725489/url.py