MCPcopy Create free account
hub / github.com/ActiveState/code / createHTMLs

Method createHTMLs

recipes/Python/271246_pyAlbumpy/recipe-271246.py:301–330  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

299 return out
300
301 def createHTMLs(self):
302 # Create HTML files
303 os.chdir(self.dirName)
304 os.chdir(self.slideName)
305 self.count = 0
306 for x in self.files:
307 os.chdir(self.dirName)
308 file_size = int(os.stat(x)[6]/1024)
309 os.chdir(self.slideName)
310 file = self.slideName + x + '.htm'
311 fp = open(file,"w")
312 temp = """<html>
313 <head>
314 <title>%s</title>
315 <link rel="stylesheet" href="styles.css">
316 </head>
317 <body>
318 <center><h2>%s</h2></center>
319 <center><h4>%s (%s/%s)</h4></center>
320 <center><a href="../%s"><img src="../images/%s"></a></center>
321 <center><br><a href="../%s"><small>Download full-size image (%s kB)</small></a></center>
322 <center><br><b>%s%s<a href="../index.htm">Index</a>%s%s</b></center>
323 %s
324 <p style="padding-left:10px"><small>Created using <a href="http://premshree.resource-locator.com/python/pyAlbum.py"><small>pyAlbum.py</small></a></small></p>
325 </body>
326 </html>
327 """ % (self.title, self.title, x, self.count + 1, len(self.files), x, x, x, file_size, self.retPrevFile(self.count), self.retPipe(self.count), self.retPipe(self.count), self.retNextFile(self.count),self.exifInfo(x))
328 fp.write(temp)
329 fp.close()
330 self.count = self.count + 1
331
332 def exit(self):
333 # Done!

Callers 1

recipe-271246.pyFile · 0.80

Calls 8

retPrevFileMethod · 0.95
retPipeMethod · 0.95
retNextFileMethod · 0.95
exifInfoMethod · 0.95
chdirMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected