From: Nikolay K. <faf...@us...> - 2004-09-20 17:50:16
|
Update of /cvsroot/collective/CMFBoard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25577 Modified Files: ForumCatalog.py TreeSupport.py forum_import.py Log Message: fixed full reply form Index: ForumCatalog.py =================================================================== RCS file: /cvsroot/collective/CMFBoard/ForumCatalog.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ForumCatalog.py 20 Sep 2004 11:36:06 -0000 1.12 +++ ForumCatalog.py 20 Sep 2004 17:50:05 -0000 1.13 @@ -166,7 +166,7 @@ topics1 = IISet(weightedIntersection( unindex, topics1, 1, 0)[1].values()).keys() topics1 = list(topics1) - print 'admin', topics1 + #print 'admin', topics1 reviews = multiunion((review_index['visible'], review_index['locked'], @@ -175,12 +175,12 @@ topics2 = IISet(weightedIntersection( unindex, intersection(self._sticky_on, reviews), 1, 0)[1].values()).keys() topics2 = list(topics2) - print 'on', topics2 + #print 'on', topics2 topics3 = IISet(weightedIntersection( unindex, intersection(self._sticky_off, reviews), 1, 0)[1].values()).keys() topics3 = list(topics3) - print 'off', topics3 + #print 'off', topics3 return LazyList(self, topics1, topics2, topics3) Index: TreeSupport.py =================================================================== RCS file: /cvsroot/collective/CMFBoard/TreeSupport.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TreeSupport.py 7 Sep 2004 18:52:51 -0000 1.5 +++ TreeSupport.py 20 Sep 2004 17:50:05 -0000 1.6 @@ -92,15 +92,13 @@ def getObjectsTree(self, base=None): """ return messages tree """ - for key, val in self._tree_index.items(): - print key, list(val.keys()) - root = hash(self.getId()) return LazyTree(self, root, root) def dumpTree(self): """ """ - print self.getObjectsTree() + for key, val in self._tree_index.items(): + print key, list(val.keys()) InitializeClass(TreeSupport) @@ -134,8 +132,6 @@ self._len = len(children_ids) self._children_ids = children_ids - #print self.id, self._children_ids, self._base, self._root - def __len__(self): return self._len Index: forum_import.py =================================================================== RCS file: /cvsroot/collective/CMFBoard/forum_import.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- forum_import.py 20 Sep 2004 11:36:07 -0000 1.12 +++ forum_import.py 20 Sep 2004 17:50:05 -0000 1.13 @@ -45,8 +45,8 @@ 'BooleanField': ('start_BooleanField', 'end_BooleanField'), 'StringField': ('start_StringField', 'end_StringField'), 'TextField': ('start_TextField', 'end_TextField'), - #'ImageField': ('start_ImageField', 'end_ImageField'), - #'ForumFileField': ('start_ForumFileField', 'end_ForumFileField'), + 'ImageField': ('start_ImageField', 'end_ImageField'), + 'ForumFileField': ('start_ForumFileField', 'end_ForumFileField'), 'LinesField': ('start_LinesField', 'end_LinesField'), 'DateTimeField': ('start_DateTimeField', 'end_DateTimeField'), @@ -132,6 +132,18 @@ root = self.root_stack[-1] attrs = self.data_stack[-1] + if attrs.has_key('__ac_local_roles__'): + ac = attrs['__ac_local_roles__'] + for key, roles in ac.items(): + if 'ReplyOwner' in roles: + roles.remove('ReplyOwner') + if 'Owner' not in roles: + roles.append('Owner') + if 'TopicOwner' in roles: + roles.remove('TopicOwner') + if 'Owner' not in roles: + roles.append('Owner') + if hasattr(root.__class__, 'import_attributes'): root.import_attributes(attrs) else: @@ -153,8 +165,6 @@ root = self.root_stack[-1] - print 'start_ForumFolder', id - if not hasattr(root, id): root.invokeFactory('ForumFolder', id, uid=uid) ob = getattr(root, id) @@ -174,9 +184,6 @@ uid = str(attrs['uid']) root = self.root_stack[-1] - - print 'start_ForumNB', id - root.invokeFactory('ForumNB', id, uid=uid) ob = getattr(root, id) @@ -303,9 +310,6 @@ except: log('Import error: %s' % id) - print root - - def start_generic_Field(self, name, attrs): self.data_stack.append(attrs) @@ -324,7 +328,6 @@ ds = self.data_stack attrs = ds[-2] - print name, type(attrs), attrs if attrs.has_key('mimetype'): mimetype = attrs['mimetype'] if type(mimetype) == type([]): @@ -350,24 +353,16 @@ attrs = ds[-2] data = binascii.a2b_base64(str(ds[-1])) - field = root.getField(str(attrs['id'])) - try: - field.set(root, data) - except: - try: - log_exc('Image import error, message path: %s'%('/'.join(root.getPhysicalPath()))) - except: - pass - - attach = field.get(root) - try: - attach.filename = self.encode(attrs.get('filename', u'')) - attach.content_type = self.encode(attrs.get( + filename = self.encode(attrs.get('filename', u'')) + content_type = self.encode(attrs.get( 'content_type', u'text/x-unknown-content-type')) except: - pass - self.data_stack = ds[:-2] + filename = '' + content_type = '' + + ds[-1] = (data, {'filename': filename, 'content_type':content_type}) + self.accumulating_chars = 0 def end_ForumFileField(self, name): ds = self.data_stack @@ -376,18 +371,16 @@ attrs = ds[-2] data = binascii.a2b_base64(str(ds[-1])) - field = root.getField(str(attrs['id'])) - field.set(root, data) - - attach = field.get(root) try: - attach.filename = self.encode(attrs.get('filename', u'')) - attach.content_type = self.encode(attrs.get( + filename = self.encode(attrs.get('filename', u'')) + content_type = self.encode(attrs.get( 'content_type', u'text/x-unknown-content-type').encode(charset)) except: - pass - self.data_stack = ds[:-2] + filename = '' + content_type = '' + ds[-1] = (data, {'filename': filename, 'content_type':content_type}) + self.accumulating_chars = 0 def um_end_string(self, name): ds = self.data_stack |