Commit b7fb3634 authored by Christophe Dumez's avatar Christophe Dumez

- removed debug LOG()

- use os.path.splitext() to remove extention instead of regex


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7236 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c7294bd
...@@ -426,10 +426,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -426,10 +426,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
# not in zodb # not in zodb
return '#' return '#'
# remove file extension # remove file extension
tmp = re.search('\\.[\w]+$', edit_path) edit_path = os.path.splitext(edit_path)[0]
if tmp: # Add beginning and end of url
extension = tmp.string[tmp.start():tmp.end()].strip()
edit_path = edit_path[:-len(extension)]
edit_path = os.path.join(bt.REQUEST["BASE2"], edit_path, 'manage_main') edit_path = os.path.join(bt.REQUEST["BASE2"], edit_path, 'manage_main')
return edit_path return edit_path
...@@ -517,7 +515,6 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -517,7 +515,6 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
filename = file_path.split(os.sep)[-1] filename = file_path.split(os.sep)[-1]
tmp_path = os.sep.join(file_path.split(os.sep)[:-1]) tmp_path = os.sep.join(file_path.split(os.sep)[:-1])
tmp_path = os.path.join(tmp_path,'.svn','text-base',filename+'.svn-base') tmp_path = os.path.join(tmp_path,'.svn','text-base',filename+'.svn-base')
LOG('path_HD', 1, tmp_path)
if os.path.exists(tmp_path): if os.path.exists(tmp_path):
head = "<b>"+tmp_path+"</b> (svn temporary file)<hr>" head = "<b>"+tmp_path+"</b> (svn temporary file)<hr>"
text = commands.getoutput('enscript -B --color --line-numbers --highlight=html --language=html -o - %s'%tmp_path) text = commands.getoutput('enscript -B --color --line-numbers --highlight=html --language=html -o - %s'%tmp_path)
...@@ -723,10 +720,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -723,10 +720,7 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
if len(path_list) > 2 : if len(path_list) > 2 :
tmp = os.sep.join(path_list[2:]) tmp = os.sep.join(path_list[2:])
# Remove file extension # Remove file extension
tmp2 = re.search('\\.[\w]+$', tmp) tmp = os.path.splitext(tmp)[0]
if tmp2:
extension = tmp2.string[tmp2.start():tmp2.end()].strip()
tmp=tmp[:-len(extension)]
object_to_update[tmp] = 'install' object_to_update[tmp] = 'install'
path_added_list = [] path_added_list = []
# remove added files # remove added files
...@@ -736,11 +730,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder): ...@@ -736,11 +730,8 @@ class SubversionTool(BaseTool, UniqueObject, Folder):
if len(path_list) > 2 : if len(path_list) > 2 :
tmp = os.sep.join(path_list[2:]) tmp = os.sep.join(path_list[2:])
# Remove file extension # Remove file extension
tmp2 = re.search('\\.[\w]+$', tmp) tmp = os.path.splitext(tmp)[0]
if tmp2: path_added_list.append(tmp)
extension = tmp2.string[tmp2.start():tmp2.end()].strip()
tmp=tmp[:-len(extension)]
path_added_list.append(tmp)
## hack to remove objects ## hack to remove objects
# Create a temporary bt with objects to delete # Create a temporary bt with objects to delete
tmp_bt = getToolByName(bt, 'portal_templates').newContent(portal_type="Business Template") tmp_bt = getToolByName(bt, 'portal_templates').newContent(portal_type="Business Template")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment