forked from endorphant/ttbp
		
	moving paths to point to user
This commit is contained in:
		
							parent
							
								
									5bf0c207a3
								
							
						
					
					
						commit
						6dab09e611
					
				
							
								
								
									
										14
									
								
								bin/core.py
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								bin/core.py
									
									
									
									
									
								
							| @ -2,10 +2,14 @@ | |||||||
| 
 | 
 | ||||||
| import os | import os | ||||||
| 
 | 
 | ||||||
| PATH = os.path.join("/home", "endorphant", "projects", "ttbp", "bin") | SOURCE = os.path.join("/home", "endorphant", "projects", "ttbp", "bin") | ||||||
| WWW = os.path.join(PATH, "..","www") | USER = os.path.basename(os.path.expanduser("~")) | ||||||
|  | PATH = os.path.join("/home", USER, ".ttbp") | ||||||
|  | 
 | ||||||
|  | LIVE = "http://tilde.town/~" | ||||||
|  | WWW = os.path.join(PATH, "www") | ||||||
| CONFIG = os.path.join(PATH, "config") | CONFIG = os.path.join(PATH, "config") | ||||||
| DATA = os.path.join(os.path.expanduser("~"), ".ttbp", "entries") | DATA = os.path.join(PATH, "entries") | ||||||
| #DATA = os.path.join("..", "data") | #DATA = os.path.join("..", "data") | ||||||
| 
 | 
 | ||||||
| MONTHS = { | MONTHS = { | ||||||
| @ -32,7 +36,9 @@ for file in os.listdir(DATA): | |||||||
|     filename = os.path.join(DATA, file) |     filename = os.path.join(DATA, file) | ||||||
|     if os.path.isfile(filename) and os.path.splitext(filename)[1] == ".txt": |     if os.path.isfile(filename) and os.path.splitext(filename)[1] == ".txt": | ||||||
|         FILES.append(file) |         FILES.append(file) | ||||||
|  |         print(file) | ||||||
| 
 | 
 | ||||||
|  | FILES.sort() | ||||||
| FILES.reverse() | FILES.reverse() | ||||||
| print("found: "+str(FILES)) | print("found: "+str(FILES)) | ||||||
| 
 | 
 | ||||||
| @ -54,7 +60,7 @@ def write(outurl="default.html"): | |||||||
| 
 | 
 | ||||||
|     outfile.close() |     outfile.close() | ||||||
| 
 | 
 | ||||||
|     return os.path.join(WWW, outurl) |     return os.path.join(LIVE+USER,os.path.basename(os.path.realpath(WWW)),outurl) | ||||||
| 
 | 
 | ||||||
| def write_entry(file): | def write_entry(file): | ||||||
|     # dump given file into entry format, return as list of strings |     # dump given file into entry format, return as list of strings | ||||||
|  | |||||||
| @ -1,20 +0,0 @@ | |||||||
| <!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> |  | ||||||
| 
 |  | ||||||
|     <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> |  | ||||||
|     </div> |  | ||||||
|   </body> |  | ||||||
| </html> |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user