Top.Mail.Ru
PyAC - Python Album Creator — LiveJournal
? ?
PyAC - Python Album Creator

> Recent Entries
> Archive
> Friends
> Profile
> My Website

September 27th, 2004


premshree
Image
04:17 pm - Fix for slides creation
If you have used PyAC for creating slides of presentations, you must’ve faced problems in the oredering of slides—that’s because the slides are sorted by name, which means a slide named Slide10.JPG is ordered before one that's name Slide2.JPG. To fix it, you will have to make changes to the doFiles() function. The modified function should like like this:
def doFiles(self):
	self.files = []
	for x in os.listdir(self.dirName):
		os.chdir(self.dirName)
		if(os.path.isfile(x)):
			self.files.append(x)

	files_no = []
	for x in self.files:
		m = re.match("([A-Za-z]*)(\d*)\.(JPG)", x)
		if m != None :
			slide_name = m.group(1)
			image_ext = m.group(3)
			files_no.append(m.group(2))
	files_no_counter = 0
	while files_no_counter < len(files_no):
		files_no[files_no_counter] = int(files_no[files_no_counter])
		files_no_counter = files_no_counter + 1
	files_no.sort()
	files_counter = 0
	while files_counter < len(self.files):
		self.files[files_counter] = slide_name + str(files_no[files_counter]) + "." + 

image_ext
		files_counter = files_counter + 1
This fix along with other changes will make way to the next version of PyAC.

(Leave a comment)

May 29th, 2004


premshree
Image
12:50 pm - Now supports user templates
PyAC now supports templates. To use a template, all you have to do (currently) is:
  • Create two templates (whatever extension)—one for the index file, the other for the HTMLs.
  • Make changes to the code (in the last few lines) to point to the newly created templates.
Of course, things will get better with time. At the moment, there's no documentation. After some more improvements, that'll get done.

Sample template for index file:
<html>
	<head>
		<title>%%title%%</title>
		<link rel="stylesheet" href="htmls/styles.css">
	</head>
	<body>
		<center><h2>%%title%%</h2></center>
		<table align="center"><tr>
		%%images%%
	</body>
</html>
Sample template for the image files:
<html>
	<head>
		<title>%%title%%</title>
		<link rel="stylesheet" href="styles.css">
	</head>
	<body>
		<center><h2>%%title%%</h2></center>
		<center><h4>%%image_file_name%%<br>
(%%current_image%%/%%total_images%%)</h4></center> %%image%% %%download_link%% <center><b><br>%%previous_link%% |
%%index_link%% |
%%next_link%%</b></center> %%exif_info%% </body> </html>
The tags with “%%” are custom PyAC tags. As I said, these things will be documented later.

Download this version (PyAC 0.0.2) from here. Be sure to make changes to the path to the templates in the code—they have been absolutely set.

(2 comments | Leave a comment)

April 18th, 2004


premshree
Image
05:42 am - pyac-announce List
Subscribe to the pyac-announce mailing list for PyAC releases and news.

Subscribe at http://lists.sourceforge.net/lists/listinfo/pyac-announce

(Leave a comment)

April 14th, 2004


premshree
Image
07:37 am - PyAC is live
PyAC is now live at http://pyac.sourceforge.net/.

(Leave a comment)


> Go to Top
LiveJournal.com
Image