Changeset 355
- Timestamp:
- 07/09/09 16:04:16 (4 years ago)
- Location:
- enpraxis.staticsite/trunk
- Files:
-
- 2 edited
-
enpraxis.staticsite.egg-info/PKG-INFO (modified) (1 diff)
-
enpraxis/staticsite/utilities/staticsiteutility.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
enpraxis.staticsite/trunk/enpraxis.staticsite.egg-info/PKG-INFO
r321 r355 1 1 Metadata-Version: 1.0 2 2 Name: enpraxis.staticsite 3 Version: 1.0dev-r 2943 Version: 1.0dev-r345 4 4 Summary: Create a static web site from your plone instance. 5 5 Home-page: http://svn.plone.org/svn/plone/plone.example -
enpraxis.staticsite/trunk/enpraxis/staticsite/utilities/staticsiteutility.py
r354 r355 131 131 self.processDocument(url, portal, dpath, ssprops) 132 132 else: 133 # Write the object to the filesystem 133 134 raw = self._httpget(url) 134 135 self._writeFile(path, raw) 136 # Process the view of the object 135 137 aurl = urlparse(url) 136 138 aurl = urlunparse((aurl[0], aurl[1], aurl[2] + '-view.html', aurl[3], aurl[4], aurl[5])) 137 139 print 'vvv '+ aurl 138 140 self.processDocument(url + '/view', portal, dpath, ssprops, alturl=aurl) 141 # If it is an image process the fullscreen view 139 142 if ctype in ['Image']: 140 143 aurl = urlparse(url) … … 204 207 205 208 def deployDocumentActions(self, portal, current, dpath, soup, ssprops): 209 # Look for document actions 206 210 raw_da = soup.find('div', {'class':'documentActions'}) 207 211 if raw_da: 212 # Step through document actions and see if they are in the soup 208 213 da = portal.portal_actions.document_actions.listActions() 209 214 for x in da: 215 # If we are not ignoring the action 210 216 if x.id not in ssprops.getProperty('actions_to_ignore'): 217 # Find the action in the soup 211 218 act = raw_da.find('li', id='document-action-%s' %x.id) 212 219 if act: 213 220 link = act.find('a') 214 221 if link and link.has_key('href'): 222 # Process the action 215 223 url = link['href'] 216 224 upath = urlparse(link['href']) 217 if upath[2].split('/')[-1] in ssprops.getProperty('views_to_add'): 225 p = upath[2].split('/') 226 # If we are going to add the action, process it 227 if p[-1] in ssprops.getProperty('views_to_add'): 218 228 mpath = self._getObjPath(url, portal.portal_url(), dpath) 219 229 mpath = os.path.split(mpath) … … 221 231 asoup = BeautifulSoup(raw) 222 232 body = self.runDocumentFilters(portal, current, asoup, ssprops) 223 mpath = '%s-%s.html' %(mpath[0], mpath[1]) 224 self._writeFile(mpath, body) 233 q = p[:-1] 234 results = portal.portal_catalog.searchResults(query={'path':'/'.join(q[:-1]),}, id=q[-1]) 235 if results: 236 if results[0].is_folderish: 237 mpath = '%s/index-%s.html' %(mpath[0], mpath[1]) 238 else: 239 mpath = '%s-%s.html' %(mpath[0], mpath[1]) 240 self._writeFile(mpath, body) 225 241 226 242 def runViewFilters(self, id, portal, current, soup, ssprops):
Note: See TracChangeset
for help on using the changeset viewer.
