Repository: plone/Products.CMFPlone

Issue:
Deprecation warnings re: portal_url in scripts.py and styles.py
I see several deprecation warnings like the following in the master branch of Products.CMFPlone:

```
.../Products.CMFPlone/Products/CMFPlone/resources/browser/scripts.py:87: DeprecationWarning: Use site_url instead. ViewletBase.portal_url will be removed in Plone 4
  self.portal_url,
```



Discussion:

Resolving patch:
diff --git a/Products/CMFPlone/resources/browser/scripts.py b/Products/CMFPlone/resources/browser/scripts.py
--- a/Products/CMFPlone/resources/browser/scripts.py
+++ b/Products/CMFPlone/resources/browser/scripts.py
@@ -19,7 +19,7 @@ def get_data(self, bundle, result):
                         url = urlparse(script.js)
                         if url.netloc == '':
                             # Local
-                            src = "%s/%s" % (self.portal_url, script.js)
+                            src = "%s/%s" % (self.site_url, script.js)
                         else:
                             src = "%s" % (script.js)
 
@@ -42,7 +42,7 @@ def get_data(self, bundle, result):
                     'bundle': bundle_name,
                     'conditionalcomment': bundle.conditionalcomment,
                     'src': '%s/%s?version=%s' % (
-                        self.portal_url, bundle.jscompilation,
+                        self.site_url, bundle.jscompilation,
                         bundle.last_compilation)
                 })
 
@@ -54,7 +54,7 @@ def scripts(self):
         # We always add jquery resource
         result.append({
             'src': '%s/%s' % (
-                self.portal_url,
+                self.site_url,
                 self.registry.records['plone.resources/jquery.js'].value),
             'conditionalcomment': None,
             'bundle': 'basic'
@@ -63,35 +63,35 @@ def scripts(self):
             # We need to add require.js and config.js
             result.append({
                 'src': '%s/%s' % (
-                    self.portal_url,
+                    self.site_url,
                     self.registry.records['plone.resources.less-variables'].value),  # noqa
                 'conditionalcomment': None,
                 'bundle': 'basic'
             })
             result.append({
                 'src': '%s/%s' % (
-                    self.portal_url,
+                    self.site_url,
                     self.registry.records['plone.resources.lessc'].value),
                 'conditionalcomment': None,
                 'bundle': 'basic'
             })
             # result.append({
             #     'src': '%s/%s' % (
-            #         self.portal_url,
+            #         self.site_url,
             #         self.registry.records['plone.resources.less-modify'].value),
             #     'conditionalcomment': None,
             #     'bundle': 'basic'
             # })
         result.append({
             'src': '%s/%s' % (
-                self.portal_url,
+                self.site_url,
                 self.registry.records['plone.resources.requirejs'].value),
             'conditionalcomment': None,
             'bundle': 'basic'
         })
         result.append({
             'src': '%s/%s' % (
-                self.portal_url,
+                self.site_url,
                 self.registry.records['plone.resources.configjs'].value),
             'conditionalcomment': None,
             'bundle': 'basic'
@@ -108,7 +108,7 @@ def scripts(self):
                         url = urlparse(data.js)
                         if url.netloc == '':
                             # Local
-                            src = "%s/%s" % (self.portal_url, data.js)
+                            src = "%s/%s" % (self.site_url, data.js)
                         else:
                             src = "%s" % (data.js)
 
@@ -129,7 +129,7 @@ def scripts(self):
                 'bundle': 'diazo',
                 'conditionalcomment': '',
                 'src': '%s/%s' % (
-                    self.portal_url, origin)
+                    self.site_url, origin)
             })
 
         return result
diff --git a/Products/CMFPlone/resources/browser/styles.py b/Products/CMFPlone/resources/browser/styles.py
--- a/Products/CMFPlone/resources/browser/styles.py
+++ b/Products/CMFPlone/resources/browser/styles.py
@@ -19,7 +19,7 @@ def get_urls(self, style, bundle):
             url = urlparse(css)
             if url.netloc == '':
                 # Local
-                src = "%s/%s" % (self.portal_url, css)
+                src = "%s/%s" % (self.site_url, css)
             else:
                 src = "%s" % (css)
 
@@ -65,7 +65,7 @@ def get_data(self, bundle, result):
                     'rel': 'stylesheet',
                     'conditionalcomment': bundle.conditionalcomment,
                     'src': '%s/%s?version=%s' % (
-                        self.portal_url,
+                        self.site_url,
                         bundle.csscompilation,
                         bundle.last_compilation
                     )
@@ -94,7 +94,7 @@ def styles(self):
             url = urlparse(origin)
             if url.netloc == '':
                 # Local
-                src = "%s/%s" % (self.portal_url, origin)
+                src = "%s/%s" % (self.site_url, origin)
             else:
                 src = "%s" % (origin)
 


Test patch: