initial structure printing
This commit is contained in:
		
							parent
							
								
									114b733497
								
							
						
					
					
						commit
						77cafed642
					
				
							
								
								
									
										3
									
								
								bin/config/footer.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								bin/config/footer.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
|     </div> | ||||
|   </body> | ||||
| </html> | ||||
							
								
								
									
										11
									
								
								bin/config/header.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								bin/config/header.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> | ||||
| <html> | ||||
|   <head> | ||||
|     <title>~endorphant</title> | ||||
|     <link rel="stylesheet" href="style.css" /> | ||||
|   </head> | ||||
|   <body> | ||||
|     <div id="meta"> | ||||
|       <h1><a href="#">~endorphant</a>@<a href="../">tilde.town</a></h1> | ||||
|     </div> | ||||
| 
 | ||||
							
								
								
									
										46
									
								
								bin/tlog.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								bin/tlog.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | ||||
| #!/usr/bin/python | ||||
| 
 | ||||
| import os | ||||
| 
 | ||||
| WWW = os.path.join("..","www") | ||||
| CONFIG = os.path.join("config") | ||||
| 
 | ||||
| HEADER = [] | ||||
| FOOTER = [] | ||||
| 
 | ||||
| infile = open(os.path.join(CONFIG, "header.txt"), 'r') | ||||
| for line in infile: | ||||
|     HEADER.append(line.rstrip()) | ||||
| infile.close() | ||||
| 
 | ||||
| infile = open(os.path.join(CONFIG, "header.txt"), 'r') | ||||
| for line in infile: | ||||
|     FOOTER.append(line.rstrip()) | ||||
| infile.close() | ||||
| 
 | ||||
| def write(outurl): | ||||
|     outfile = open(os.path.join(WWW, outurl), "w") | ||||
| 
 | ||||
|     for line in HEADER: | ||||
|         outfile.write(line) | ||||
| 
 | ||||
|     for line in write_placeholder(): | ||||
|         outfile.write(line) | ||||
| 
 | ||||
|     for line in FOOTER: | ||||
|         outfile.write(line) | ||||
| 
 | ||||
|     outfile.close() | ||||
| 
 | ||||
| def write_placeholder(): | ||||
| 
 | ||||
|     entry = [ | ||||
|         "<div id=\"tlogs\">", | ||||
|         "<p><a name=\"$today\"></a><br /><br /></p>", | ||||
|         "<div class=\"entry\">", | ||||
|         "<h5><a href=\"$today\">DD</a> month YYYY</h5>", | ||||
|         "<p>Feacby waeohaku aywoaeeo fepopo lyhili todepoae, taenga. Ypaogeni, ypnorani geahwaga diioanee aotrilco, aenoail. Oypo, weahipae kucogoyp fyeoim kyreeo? El godineng fengo aheoba himalidi trcoimao imypfe oaeha. In, trratr amlypoga cohitata macoipta? Ta, yeahta ahoyio, feanikre taneypel, bynekuim, enoyha. Adahilre, lylyno, aetaay aoimeo taquam toegeem? Rebyma maquag qunohi, fekyno fyniypdi. Eoaeby ikaeem goenkuao enacli, taliel agerhaza quema nonoimli. Ad amcory, aeypye raanaban lyaekuto coyega, adionige?</p>", | ||||
|         "</div>" | ||||
|     ] | ||||
| 
 | ||||
|     return entry | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user