#NEWLINE# def insertPrevNextLinks( slides , filename , ext ) : #NEWLINE# #INDENT# for slide in slides : #NEWLINE# #INDENT# for ( name , offset ) in ( ( 'previous' , ( - 1 ) ) , ( 'next' , ( + 1 ) ) ) : #NEWLINE# #INDENT# if ( ( ( slide . pos > 0 ) and ( name == 'previous' ) ) or ( ( slide . pos < ( len ( slides ) - 1 ) ) and ( name == 'next' ) ) ) : #NEWLINE# #INDENT# for node in domhelpers . findElementsWithAttribute ( slide . dom , 'class' , name ) : #NEWLINE# #INDENT# if ( node . tagName == 'a' ) : #NEWLINE# #INDENT# node . setAttribute ( 'href' , ( '%s-%d%s' % ( filename [ 0 ] , ( slide . pos + offset ) , ext ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# text = dom . Text ( ) #NEWLINE# text . data = slides [ ( slide . pos + offset ) ] . title #NEWLINE# node . appendChild ( text ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for node in domhelpers . findElementsWithAttribute ( slide . dom , 'class' , name ) : #NEWLINE# #INDENT# pos = 0 #NEWLINE# for child in pos . parentNode . childNodes : #NEWLINE# #INDENT# if ( child is node ) : #NEWLINE# #INDENT# del node . parentNode . childNodes [ pos ] #NEWLINE# break #NEWLINE# #UNINDENT# pos += 1