version 1.64, 2006/06/18 12:55:30
|
version 1.68, 2006/10/04 07:35:27
|
Line 9 from Products.PageTemplates.ZopePageTemp
|
Line 9 from Products.PageTemplates.ZopePageTemp
|
from AccessControl import ClassSecurityInfo |
from AccessControl import ClassSecurityInfo |
from difflib import Differ |
from difflib import Differ |
from pprint import pprint |
from pprint import pprint |
|
|
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
|
|
try: |
try: |
Line 136 class versionedFileFolder(Folder,ECHO_ba
|
Line 135 class versionedFileFolder(Folder,ECHO_ba
|
{'label':'Position of version number','action':'changeHistoryFileNamesForm'}, |
{'label':'Position of version number','action':'changeHistoryFileNamesForm'}, |
) |
) |
|
|
|
|
def changeHistoryFileNamesForm(self): |
def changeHistoryFileNamesForm(self): |
"""change position of version num""" |
"""change position of version num""" |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeHistoryFileNamesForm.zpt')).__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeHistoryFileNamesForm.zpt')).__of__(self) |
Line 860 class versionedFile(CatalogAware,Folder)
|
Line 860 class versionedFile(CatalogAware,Folder)
|
def diff(self,data): |
def diff(self,data): |
"""differenz between lastversion and data""" |
"""differenz between lastversion and data""" |
d=Differ() |
d=Differ() |
tmp=self.getLastVersion().data |
data=data.rstrip() |
|
try: |
|
tmp=self.getLastVersion().data.rstrip() |
|
except: |
|
tmp=str(self.getLastVersion().data).rstrip() |
#print "XX",data,tmp |
#print "XX",data,tmp |
|
|
try: |
try: |
l=list(d.compare(data.splitlines(1),tmp.splitlines(1))) |
l=list(d.compare(data.splitlines(1),tmp.splitlines(1))) |
except: |
except: |
return 0,"" |
try: |
|
l=list(d.compare(repr(data).splitlines(1),tmp.splitlines(1))) |
|
except: |
|
return 9999,[] |
|
|
plus=0 |
plus=0 |
minus=0 |
minus=0 |
|
|
for a in l: |
for a in l: |
if a[0]=='+': |
if a[0]=='+': |
plus+=1 |
plus+=1 |