Changeset 265
- Timestamp:
- 06/04/09 16:47:24 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
enpraxis.staticsite/trunk/enpraxis/staticsite/utilities/staticsiteutility.py
r264 r265 1 1 import Globals 2 import httplib 2 3 import os 3 4 … … 26 27 27 28 ssprops = context.portal_url.portal_properties.staticsite_properties 29 subdomain = ssprops.getProperty('subdomain') 28 30 rpath = self._getDeploymentPath(ssprops) 29 31 self.createDirectory(rpath) … … 36 38 review_state='Published') 37 39 for x in brains: 38 self.traverse(x, rpath )40 self.traverse(x, rpath, subdomain) 39 41 40 def traverse(self, brain, rpath ):42 def traverse(self, brain, rpath, subdomain): 41 43 """ Traverse the site. """ 42 44 brains = brain.portal_catalog.searchResults( … … 45 47 for x in brains: 46 48 url = x.getURL() 47 self.deployObject(url, x, rpath )48 if x.is PrincipiaFolderish:49 self.traverse(x, rpath )49 self.deployObject(url, x, rpath, subdomain) 50 if x.is_folderish: 51 self.traverse(x, rpath, subdomain) 50 52 51 def deployObject(self, url, brain, rpath ):53 def deployObject(self, url, brain, rpath, subdomain): 52 54 """ Deploy an object """ 55 portal_url = brain.portal_url() 53 56 if brain.is_folderish: 54 57 #create dir before processing html 55 portal_url = brain.portal_url() 56 folder_path = url.replace(portal_url, self.static_rootpath) 58 folder_path = url.replace(portal_url, rpath) 57 59 self.createDirectory(folder_path) 58 raw = self.httpget(url )60 raw = self.httpget(url, portal_url, subdomain) 59 61 data = self.runFilters(raw, None) 60 62 print url … … 64 66 return data 65 67 66 def httpget(self, url): 68 def httpget(self, url, portal_url, subdomain): 69 url = url.replace(portal_url, subdomain) 67 70 return url 68 71
Note: See TracChangeset
for help on using the changeset viewer.
