Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
448bf18f
Commit
448bf18f
authored
Jul 20, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespace
parent
3a9bece1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+11
-11
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
448bf18f
...
...
@@ -96,7 +96,7 @@ class TemplateTool (BaseTool):
title
=
'Template Tool'
meta_type
=
'ERP5 Template Tool'
portal_type
=
'Template Tool'
allowed_types
=
(
'ERP5 Business Template'
,
)
allowed_types
=
(
'ERP5 Business Template'
,
)
# This stores information on repositories.
repository_dict
=
{}
...
...
@@ -104,8 +104,8 @@ class TemplateTool (BaseTool):
# Declarative Security
security
=
ClassSecurityInfo
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'manage_overview'
)
manage_overview
=
DTMLFile
(
'explainTemplateTool'
,
_dtmldir
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'manage_overview'
)
manage_overview
=
DTMLFile
(
'explainTemplateTool'
,
_dtmldir
)
def
getInstalledBusinessTemplate
(
self
,
title
,
strict
=
False
,
**
kw
):
"""
...
...
@@ -232,7 +232,7 @@ class TemplateTool (BaseTool):
return
"file://%s/"
%
pathname2url
(
os
.
path
.
join
(
getConfiguration
().
instancehome
,
'bt5'
))
security
.
declareProtected
(
'Import/Export objects'
,
'save'
)
security
.
declareProtected
(
'Import/Export objects'
,
'save'
)
def
save
(
self
,
business_template
,
REQUEST
=
None
,
RESPONSE
=
None
):
"""
Save the BusinessTemplate in the servers's filesystem.
...
...
@@ -426,7 +426,7 @@ class TemplateTool (BaseTool):
# this looks like a subversion repository, try to check it out
LOG('
ERP5
', INFO, '
TemplateTool
doing
a
svn
checkout
of
%
s
' % url)
return self._download_svn(url, bt_id)
return self._download_local(file_path, bt_id)
finally:
os.remove(temppath)
...
...
@@ -856,7 +856,7 @@ class TemplateTool (BaseTool):
if title == property_dict['title']:
if (version_restriction is None) or (self.compareVersionStrings(property_dict['version'], version_restriction)):
if (result is None) or (self.compareVersions(property_dict['version'], result[2]) > 0):
result = (repository,
property_dict['id'], property_dict['version'])
result = (repository, property_dict['id'], property_dict['version'])
if result is not None:
return (result[0], result[1])
else:
...
...
@@ -1218,7 +1218,7 @@ class TemplateTool (BaseTool):
if name.endswith('
.
bt5
'):
name = name[:-4]
business_template_url_dict[name] = {
'
url
':
'
%
s
/%
s
' % (url, bt.filename),
'
url
': '
%
s
/%
s
' % (url, bt.filename),
'
revision
': bt.getRevision()
}
return business_template_url_dict
...
...
@@ -1318,9 +1318,9 @@ class TemplateTool (BaseTool):
update_catalog=_MARKER,
reinstall=False,
active_process=None,
force_keep_list=None,
force_keep_list=None,
only_newer=True):
"""
"""
This method download and install a bt5, from a URL.
keep_original_list can be used to make paths not touched at all
...
...
@@ -1436,7 +1436,7 @@ class TemplateTool (BaseTool):
for base_url in base_url_list:
url = "%s/%s" % (base_url, bt5_title)
if base_url == "INSTANCE_HOME_REPOSITORY":
url = "file://%s/bt5/%s" % (getConfiguration().instancehome,
url = "file://%s/bt5/%s" % (getConfiguration().instancehome,
bt5_title)
LOG('
ERP5
', INFO, "TemplateTool: INSTANCE_HOME_REPOSITORY is %s."
\
% url)
...
...
@@ -1452,7 +1452,7 @@ class TemplateTool (BaseTool):
return url
except (urllib2.HTTPError, OSError):
pass
LOG('
ERP5
', INFO, '
TemplateTool
:
%
s
was
not
found
into
the
url
list
:
'
LOG('
ERP5
', INFO, '
TemplateTool
:
%
s
was
not
found
into
the
url
list
:
'
'
%
s
.
' % (bt5_title, base_url_list))
return None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment