Changeset 3077 for trunk


Ignore:
Timestamp:
11/01/10 00:16:11 (9 years ago)
Author:
jukka
Message:

Removed debugging prints from code.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/CommonMixIn.py

    r3057 r3077  
    358358    def getRequiredFieldNames(self): 
    359359        """ Returns field names, not actual field objects """ 
    360         a=[field.getName() for field in self.schema.fields() if field.required] 
    361         print 'getRequiredFieldNames: ', a 
    362         return a 
    363              
    364  
     360        return [field.getName() for field in self.schema.fields() if field.required] 
    365361 
    366362    ####### Schema update ############### 
  • trunk/ExerciseMaterial.py

    r3075 r3077  
    238238            results.append('-----------------------------------------\n') 
    239239            results.append('                %s / %s   = %2d%%\n' % (corrects, corrects+wrongs, ((corrects*1.0)/(corrects+wrongs))*100)) 
    240         print u''.join(results) 
    241240        return u''.join(results) 
    242241 
  • trunk/FieldsWidgets.py

    r3074 r3077  
    276276        count=int(form.get('chapter_count',0)) 
    277277        changes['count']=count 
    278         print 'processing widget ChapterWidget with form: ',form 
    279278        new_order=[] 
    280279        reorder=False 
     
    467466                            changes['new_chapters']=new_chapters 
    468467                            form.update({'chapter_edited':count, 'chapter_anchor':count, 'stay':1}) 
    469         print changes 
    470468        return changes, {} 
    471469    
     
    786784    def get(self, instance, **kwargs): 
    787785        """ Get a cleaned version for display """ 
    788         print 'ChapterField.get called with args', kwargs 
    789786        REQUEST=getattr(instance,'REQUEST',None) 
    790787        if REQUEST: 
     
    813810                cleaned_value=self.updateChapterList(cleaned_value) 
    814811                cleaned_value=self.updateCleanedChapters(instance, cleaned_value) 
    815                 print 'converted and updated cleaned chapter list' 
    816812                return cleaned_value 
    817813            else: 
    818                 print 'no need to convert, giving cleaned as it is' 
    819814                return cleaned_value 
    820         print 'ChapterField is calling getRaw...' 
    821815        value=self.getRaw(instance, **kwargs) 
    822         print '...ChapterField has called getRaw.' 
    823816        cleaned_value=self.updateCleanedChapters(instance, value) 
    824         print 'updated cleaned chapter'  
    825817        return cleaned_value 
    826818 
    827819    def textOnly(self, instance, **kwargs): 
    828         print '***** calling indexer for ChapterField' 
    829820        listofdicts= getattr(instance, 'cleaned_%s' % self.getName(), None) 
    830821        return '\n'.join([x['text'] for x in listofdicts])  
     
    914905 
    915906    def set(self, instance, value, **kwargs): 
    916         print 'ChapterField.set called with value: ', value, kwargs 
    917907        if not value: 
    918908            return 
     
    924914        else: 
    925915            old_values=self.getRaw(instance, **kwargs) 
    926         print 'old values returned:', old_values 
    927916        references_to_add=[] 
    928917        references_to_remove=[]         
     
    930919            # check if this needs conversion 
    931920            if isinstance(old_values[0], tuple): 
    932                 print 'updating chapter list' 
    933921                old_values=self.updateChapterList(old_values) 
    934922                changed=True  
     
    10361024        ### The case where field's get-method feeds field's set-method (archetype update, copying)  
    10371025        elif isinstance(value, list): 
    1038             print 'setting from a list' 
    10391026            references_new=[] 
    10401027            for chapter in value: 
     
    10611048        if changed: 
    10621049            # update cleaned text 
    1063             print 'trying to update cleaned chapters' 
    10641050            self.updateCleanedChapters(instance, new_values)         
    10651051            # set new value 
    1066             print 'new_values for ObjectField.set:', new_values 
    10671052            ObjectField.set(self, instance, new_values, **kwargs) 
    10681053 
     
    10991084        if not shasattr(i, '_mp3length'): 
    11001085            instance._mp3length=get_length(str(file)) 
    1101         print instance._mp3length 
    11021086        if instance._mp3length==0: 
    11031087            instance._mp3length=get_length(str(file)) 
  • trunk/GroupBlog.py

    r3057 r3077  
    461461            v['joinGroup'] = 'login_form' 
    462462        elif member.getId() not in self.getGroupMembers(): 
    463             print 'member.getId():%s' % member.getId() 
    464463            v['joinGroup'] = 'join_group'              
    465464        v['leaveGroup'] = not v['joinGroup'] 
  • trunk/LargeSectionFolder.py

    r3072 r3077  
    313313    security.declarePrivate('initializeArchetype') 
    314314    def initializeArchetype(self, **kwargs): 
    315         print 'LargeSectionFolder.initializeArchetype called', kwargs 
    316         t=time.time() 
    317  
    318315        ret_val = ATBTreeFolder.initializeArchetype(self, **kwargs) 
    319316        # Enable topic syndication by default 
     
    325322                except: # might get 'Syndication Information Exists' 
    326323                    pass 
    327         print '...Archetype Initialized ', time.time()-t 
    328324        return ret_val         
    329325 
  • trunk/LeMillFactoryTool.py

    r3045 r3077  
    3636    def __call__(self, *args, **kwargs): 
    3737        """call method""" 
    38         print 'FACTORY called' 
    39         t=time.time() 
    4038        self._fixRequest() 
    4139        factory_info = self.REQUEST.get(FACTORY_INFO, {}) 
    42         print factory_info 
    4340        stack = factory_info['stack'] 
    4441        type_name = stack[0] 
     
    4744        # do a passthrough if parent contains the id 
    4845        if hasattr(aq_parent(self), id): 
    49             print "Factory __call__ (shorter): %s" % str(time.time()-t) 
    5046            return aq_parent(self).restrictedTraverse('/'.join(stack[1:]))(*args, **kwargs) 
    5147 
    52         print 'FACTORY REQUESTING TEMP FOLDER'  
    5348        tempFolder = self._getTempFolder(type_name) 
    5449        # Mysterious hack that fixes some problematic interactions with SpeedPack: 
     
    6055        else: 
    6156            obj = temp_obj 
    62         print "Factory __call__ (longer): %s" % str(time.time()-t) 
    6357        return mapply(obj, self.REQUEST.args, self.REQUEST, 
    6458                               call_object, 1, missing_name, dont_publish_class, 
     
    8478 
    8579    def __bobo_traverse__(self, REQUEST, name): 
    86         print '__bobo_traverse__, yeah' 
    8780        # __bobo_traverse__ can be invoked directly by a restricted_traverse method call 
    8881        # in which case the traversal stack will not have been cleared by __before_publishing_traverse__ 
     
    9588 
    9689    def _getTempFolder(self, type_name): 
    97         t=time.time() 
    9890        factory_info = self.REQUEST.get(FACTORY_INFO, {}) 
    9991        tempFolder = factory_info.get(type_name, None) 
    10092        if tempFolder: 
    10193            tempFolder = aq_inner(tempFolder).__of__(self) 
    102             print "Factory _getTempFolder (short): %s" % str(time.time()-t) 
    10394            return tempFolder 
    10495         
     
    152143        factory_info[type_name] = tempFolder 
    153144        self.REQUEST.set(FACTORY_INFO, factory_info) 
    154         print "Factory _getTempFolder (long): %s" % str(time.time()-t) 
    155145        return tempFolder 
    156146 
  • trunk/LeMillTool.py

    r3071 r3077  
    646646        """ Checks if title and id are available (exceptions: pieces, translations, deleted items and redirectors) """ 
    647647 
    648         print 'Checktitle called with obj %s, title %s, objtype %s and container %s' % (obj, title, objtype, container) 
    649  
    650648        def findUniqueId(id): 
    651649            pc=getToolByName(self, 'portal_catalog') 
     
    919917                community={'absolute_url':md.getURL(), 'title':md.Title, 'cover_url': '%s/coverImage' % md.getURL()} 
    920918                break 
    921         print 'building featured items took:', time.time()-t 
    922919        return {'content':content,'method':method,'tool':tool,'community':community}              
    923920 
  • trunk/LeMillUserTool.py

    r3052 r3077  
    122122            return "".join(('<a target="_blank" href="',md.getURL(), '"',i18name,'>',str(md.getNicename),'</a>')) 
    123123        else: 
    124             print 'linkTo:', time.time()-t 
    125124            return "".join(('<a href="',md.getURL(), '"',i18name,'>',str(md.getNicename),'</a>')) 
    126125         
     
    244243            # has already this member 
    245244            # TODO exception 
    246             print 'Memberfolder %s exists already' % member_id 
    247245            return 
    248246 
     
    434432""" % (url, reset_address, pw_tool.getExpirationTimeout(), reset_dict['expires'].aCommonZ(), remote_addr, time.ctime(time.time()))         
    435433 
    436         print mail_text 
    437434        mhost=utils.getMailHost() 
    438435        try: 
  • trunk/MemberFolder.py

    r3057 r3077  
    458458            except: 
    459459                lastname=lastname() 
    460                 print lastname, type(lastname) 
    461460            return lastname.lower() 
    462461        else: 
     
    670669    def recalculateScore(self): 
    671670        """ Recalculates score for MemberFolder according to specifications """ 
    672         t=time.time() 
    673671        score = 0 
    674672        member = self.getMemberId() 
     
    697695            score = 1 
    698696        self.setScore(score) 
    699         print 'recalculating score took ', time.time()-t  
    700697 
    701698    def portfolioFilter(self): 
  • trunk/Resource.py

    r3070 r3077  
    8080        """Processes the schema looking for data in the form, taken from Archetypes BaseObject 
    8181        """ 
    82         print 'Resource.processForm called with: ', data, values 
    8382        is_new_object = self.checkCreationFlag() 
    84         print 'is_new_object:', is_new_object   
    8583        self._processForm(data=data, metadata=metadata, 
    8684                          REQUEST=REQUEST, values=values) 
     
    8886        # Post create/edit hooks 
    8987        if is_new_object: 
    90             print 'calling at_post_create_script'  
    9188            self.at_post_create_script() 
    9289        else: 
    93             print 'calling at_post_edit_script'  
    9490            self.at_post_edit_script() 
    9591        event.notify(objectevent.ObjectModifiedEvent(self)) 
     
    158154    def _processForm(self, data=1, metadata=None, REQUEST=None, values=None): 
    159155 
    160         print 'Resource._processForm called' 
    161156        # from Archetypes/BaseObject minus reindexObject at the end 
    162157        request = REQUEST or self.REQUEST 
     
    330325        if hasattr(self, 'getRawBodyText'):             
    331326            desc=self.getRawBodyText() 
    332             print desc 
    333327            if isinstance(desc, list): 
    334328                desc=desc[0] 
  • trunk/skins/lemill/content_edit.cpy

    r3076 r3077  
    3939    return state.set(next_action='redirect_to:string:edit?chapter_edited=%s#%s' % (edit, anchor), status='stay', context=new_context) 
    4040 
     41 
    4142if state.errors: 
    4243    errors = state.errors 
     
    5556# XXX disabled mark creation flag 
    5657#context.remove_creation_mark(old_id) 
    57  
     58if REQUEST.form.get('form.button.pilot_edit_scenes',0): 
     59    return state.set(next_action='redirect_to:string:edit_scenes', status='success', context=new_context)  
    5860 
    5961return state.set(status='success', context=new_context) 
  • trunk/skins/lemill/edit_scenes.cpt

    r3014 r3077  
    2727                </tal:comment> 
    2828 
    29                 <div style="display:none"> 
    30                 <xml id="dataisland" style="display:none"> 
    31                 <configset> 
    32                 <config id="audio-result-box">audio-search-results</config> 
    33                 <config id="search-result-box">piece-search-results</config> 
    34                 <config id="search-string-base">piece-search-</config> 
    35                 <config id="target-div-id">piece-edit-box-</config> 
    36                 <config id="piece-referencing-input">bodyText_</config> 
    37                 <config id="image-size">large</config> 
    38                 </configset> 
    39  
    40                 </xml> 
    41                 </div> 
    4229                <h1 i18n:translate="label_pilot_scenes">Edit PILOT scenes</h1> 
    4330                <tal:fields define="field python:here.getField('bodyText'); 
     
    5340 
    5441        <div style="margin-top:20px" tal:define="translation translation | nothing"> 
    55         <p i18n:translate="text_pilot_save_or_cancel_guidetext">If you want to quit editing this learning resource click Save to save the changes or Cancel to quit editing without saving.</p> 
    56  
    5742        <tal:block metal:use-macro="here/multimediamaterial_edit/macros/minor_edit"/> 
    58  
    59         <tal:if_translation condition="translation"> 
    60         <input type="hidden" 
    61             name="translation" 
    62             value="1" 
    63             /> 
    64         <input type="hidden" 
    65             name="translation_of" 
    66             tal:attributes="value source/UID" 
    67             /> 
    68         </tal:if_translation> 
    69  
    70         <input class="context" 
    71             tabindex="" 
    72             type="submit" 
    73             name="form.button.pilot_form_submit" 
    74             value="Save" i18n:domain="plone" 
    75             i18n:attributes="value label_save;" 
    76             tal:attributes="tabindex tabindex/next; 
    77             disabled python:test(isLocked, 'disabled', None);" 
    78             /> 
    79         <input class="context" 
    80             tabindex="" 
    81             type="submit" 
    82             name="form.button.pilot_form_preview" 
    83             value="Preview" 
    84             i18n:attributes="value label_preview;" 
    85             tal:attributes="tabindex tabindex/next; 
    86             disabled python:test(isLocked, 'disabled', None);" 
    87             /> 
    88         <input class="standalone" 
    89             tabindex="" 
    90             type="submit" 
    91             name="form.button.cancel" 
    92             value="Cancel" i18n:domain="plone"  
    93             i18n:attributes="value label_cancel;" 
    94             tal:attributes="tabindex tabindex/next" 
    95             /> 
    96         </div> 
    97         <input type="hidden" name="form.submitted" value="1" /> 
    98  
     43        <metal:buttons use-macro="here/button_macros/macros/save_and_move_buttons" /> 
    9944        </form> 
    10045            </metal:macro> 
  • trunk/skins/lemill/edit_scenes.cpt.metadata

    r2541 r3077  
    66 
    77[actions] 
    8 action.failure = traverse_to:string:edit_scene 
     8action.failure = traverse_to:string:edit_scenes 
    99action.success = traverse_to:string:content_edit 
    1010action.success..cancel = redirect_to:string:view 
Note: See TracChangeset for help on using the changeset viewer.