예제 #1
0
def gen_page_set( multipage_def, multipage_style, multipage_content, mp_dct, movies_dct, img_dct, embeds_dct ):

	# iterate over pages...
	for page_def in multipage_def:

		accum_ids = []
	
		# intialize page style and content from template...
		tot_style = multipage_style
		tot_content = multipage_content
		tot_on = ""
		tot_off = ""

		# expand each asset...
		if page_def['asset_name'].startswith("mp"):
			style, content, scriptlet_dct = gen_movie_panels.expand_item( accum_ids, page_def, img_dct, movies_dct, mp_dct, embeds_dct )

			tot_style += style
			tot_content += content
			tot_on = scriptlet_dct['on']
			tot_off = scriptlet_dct['off']	

		else:
			print "ERROR: Cannot process this asset type->", page_def
			sys.exit(1)

		# create all the html content...
                style = "%s" % (tot_style)
                content = tot_content
                head_script = "" #subpage_head_script
                load_script  = tot_on

		# get the page name...
		page_name = page_def['page_name']

                # write the file...
                common.gen_page( "%s.html" % page_name, style, "", content, head_script, load_script )
예제 #2
0
			gen_multipage_gallery.gen_pages( page_def[0], template_style, template_content, movie_panels_dct, movies_dct, images_dct )

		elif page_def[0]['asset_name'].startswith("mss_"):
			for item_def in page_def:
				if ( item_def['asset_name'].startswith("mss_") ):
					gen_multipage_slideshow.gen_pages( item_def, template_style, template_content, movie_panels_dct, movies_dct, \
						images_dct, image_sets_dct )
				else:
					print "ERROR: gen_page: Cannot process->", item_def
					sys.exit(1)

		else:
			print "MAIN - GENERATING PAGE FOR", page_name

			# generate the subpage content...	
			subpage_style, subpage_content, subpage_head_script, subpage_load_script = \
				gen_page( accum_ids, page_name, page_def, movies_dct, images_dct, menus_dct, \
					movie_panels_dct, click_panels_dct, \
					slide_shows_dct, embeds_dct, cpo_dct )

			# create all the html content...	
			style = '%s' % (template_style + subpage_style)
			content = template_content + subpage_content
			head_script = subpage_head_script
			load_script  = subpage_load_script

			# write the file...
			common.gen_page( "%s.html" % page_name, style, content, head_script, load_script )
	
		
예제 #3
0
def gen_page_set( multipage_def, multipage_style, multipage_content, mp_dct, movies_dct, img_dct, is_dct ):

	# find the is and the rest...
	is_def = None
	remaining_defs = []
	for page_def in multipage_def:
                if page_def['asset_name'].startswith("is"):
                        is_def = page_def
		else:
			remaining_defs.append( page_def )

	# expand the IS...
	asset_defs = gen_image_set.expand_def( is_dct, is_def )
	for asset in asset_defs:
			
		accum_ids = []

		# intialize page style and content from template...
		tot_style = multipage_style
		tot_content = multipage_content
		tot_on = ""
		tot_off = ""

		cur_page_name = asset['page_name']
	
		alldefs = remaining_defs + [ asset ]
		for page_def in alldefs:

                	# expand each asset...
                	if page_def['asset_name'].startswith("img"):
				# determine the script, if any...
                        	script = None
                        	ahref = None
				exturl = None

				print "MSS IMG DEF->", page_def
                        	if page_def.has_key("link") and page_def["link"]!="":
                                	link = page_def["link"]
					print "LINK PAGE DEF->", link, page_def.keys(), page_def['asset_name'], page_def['link']
                                	if link.startswith("option:"):
                                        	ltype,parm = link.split(":")
                                        	funcname = "func_%s_%s" % (menu_name, parm)
                                        	test = action_scripts[funcname]
                                        	script = "%s ();" % funcname
                                	elif link.startswith("url:"):
                                        	idx = link.find(":") + 1
                                        	ahref = link[idx:]
                                	elif link.startswith("nurl:"):
                                        	idx = link.find(":") + 1
                                        	ahref = link[idx:]
                                        	exturl = True
					elif link.startswith("mss"):
                                        	idx = link.find(":") + 1
						directive = link[idx:]
						ahref = get_link( page_def, is_dct, directive, cur_page_name )
						print "MS LINK->", ahref
                                	else:
                                        	print "ERROR: multipage_slide_show: Unknown link type", page_def
						sys.exit(1)

                        	style, content, foo, scriptlet_dct = gen_images.expand_item( accum_ids, page_def, img_dct, script, None, ahref, exturl )

                        	tot_style += style
                        	tot_content += content
				tot_on += scriptlet_dct["on"]
				tot_off += scriptlet_dct["off"]

			elif page_def.has_key('type') and page_def['type'] == "image_set":

				# Note, we are requiring a valid cap file...
                                if page_def.has_key('cap_file') and page_def['cap_file']!=None:
					print "WARNING: Got cap file->", page_def['cap_file']	
				else:	
					print "WARNING: No cap file->", page_def
					time.sleep(2)
					continue

				style, content, foo, scriptlet_dct = gen_image_set.expand_item( accum_ids, page_def, is_dct, None, None, None )
                        	tot_style += style
                        	tot_content += content
				tot_on += scriptlet_dct["on"]
				tot_off += scriptlet_dct["off"]

				# expand the caption too...
                                if page_def.has_key('cap_path'):
					style, content, foo, scriptlet_dct = \
						gen_image_set.expand_caption( accum_ids, page_def )
                                	tot_style += style
                                	tot_content += content
                                	tot_on += scriptlet_dct["on"]
                                	tot_off += scriptlet_dct["off"]

			else:
				print "ERROR: Cannot process this asset type->", page_def
				sys.exit(1)

		# create all the html content...
		style = "%s" % (tot_style)
		content = tot_content
		head_script = "" #subpage_head_script
		load_script  = tot_on #subpage_load_script

		# get the page name...
		page_name = asset['page_name']

		# write the file...
		common.gen_page( "%s.html" % page_name, style, content, head_script, load_script )