increment beta to 0.9.0

mostly documentation updates
master
endorphant 2016-05-22 22:30:59 -04:00
parent d300c19a2c
commit d3d839f910
1 changed files with 59 additions and 26 deletions

View File

@ -40,7 +40,7 @@ import chatter
import inflect import inflect
import util import util
__version__ = "0.8.7" __version__ = "0.9.0"
__author__ = "endorphant <endorphant@tilde.town)" __author__ = "endorphant <endorphant@tilde.town)"
#__name__ = "_ttpb: wip/beta version of the ttbp console interface" #__name__ = "_ttpb: wip/beta version of the ttbp console interface"
@ -165,7 +165,7 @@ def check_init():
## PATCH CHECK HERE ## PATCH CHECK HERE
if not updated(): if not updated():
print(update_version()) update_version()
## when ready, enter main program and load core engine ## when ready, enter main program and load core engine
raw_input("press <enter> to explore your feels.\n\n") raw_input("press <enter> to explore your feels.\n\n")
@ -665,17 +665,19 @@ def view_feed():
entries.append("~"+entry[5]+pad+"\ton "+entry[3]+" ("+p.no("word", entry[2])+") ") entries.append("~"+entry[5]+pad+"\ton "+entry[3]+" ("+p.no("word", entry[2])+") ")
#print_menu(entries)
list_entries(metas, entries, "most recent global entries: \n\n") list_entries(metas, entries, "most recent global entries: \n\n")
redraw() redraw()
return return
##### ## misc helpers
def find_ttbps(): def find_ttbps():
# looks for users with a valid ttbp config and returns a list of them '''
returns a list of users with a ttbp by checking for a valid ttbprc
'''
users = [] users = []
for townie in os.listdir("/home"): for townie in os.listdir("/home"):
@ -685,7 +687,9 @@ def find_ttbps():
return users return users
def www_neighbors(users): def www_neighbors(users):
# takes a raw list of valid users and formats for www view '''
takes a list of users with publiishing turned on and prepares it for www output
'''
userList = [] userList = []
@ -723,7 +727,9 @@ def www_neighbors(users):
core.write_global_feed(sortedUsers) core.write_global_feed(sortedUsers)
def list_select(options, prompt): def list_select(options, prompt):
# runs the prompt for the list until a valid index is imputted '''
given a list, cycles through the prompt until a valid index is imputted
'''
ans = "" ans = ""
invalid = True invalid = True
@ -747,7 +753,9 @@ def list_select(options, prompt):
return ans return ans
def input_yn(query): def input_yn(query):
# returns boolean True or False '''
given a query, returns boolean True or False by processing y/n input
'''
try: try:
ans = raw_input(query+" [y/n] ") ans = raw_input(query+" [y/n] ")
@ -763,7 +771,9 @@ def input_yn(query):
return False return False
def publishing(username = USER): def publishing(username = USER):
# checks .ttbprc for whether or not user wants their blog published online '''
checks .ttbprc for whether or not user opted for www publishing
'''
ttbprc = {} ttbprc = {}
@ -776,7 +786,9 @@ def publishing(username = USER):
return ttbprc.get("publishing") return ttbprc.get("publishing")
def select_editor(): def select_editor():
# setup helper for editor selection '''
setup helper for editor selection
'''
print_menu(EDITORS) print_menu(EDITORS)
choice = raw_input("\npick your favorite text editor: ") choice = raw_input("\npick your favorite text editor: ")
@ -786,7 +798,9 @@ def select_editor():
return EDITORS[int(choice)] return EDITORS[int(choice)]
def select_publish_dir(): def select_publish_dir():
# setup helper for publish directory selection '''
setup helper for publish directory selection
'''
current = SETTINGS.get("publish dir") current = SETTINGS.get("publish dir")
republish = False republish = False
@ -818,7 +832,9 @@ otherwise, pick another location: """)
return choice return choice
def select_publishing(): def select_publishing():
# setup helper for toggling publishing '''
setup helper for toggling publishing
'''
publish = input_yn("""\ publish = input_yn("""\
do you want to publish your feels online? do you want to publish your feels online?
@ -839,16 +855,19 @@ please enter\
return publish return publish
def unpublish(): def unpublish():
# remove user's published directory, if it exists '''
remove user's published directory, if it exists
'''
dir = SETTINGS.get("publish dir") dir = SETTINGS.get("publish dir")
if dir: if dir:
publishDir = os.path.join(PUBLIC, dir) publishDir = os.path.join(PUBLIC, dir)
subprocess.call(["rm", publishDir]) subprocess.call(["rm", publishDir])
#subprocess.call(["rm", WWW])
def update_publishing(): def update_publishing():
# handler to update publishing directory, or wipe it '''
updates publishing directory if user is publishing. otherwise, wipe it.
'''
global SETTINGS global SETTINGS
@ -866,7 +885,9 @@ def update_publishing():
SETTINGS.update({"publish dir": None}) SETTINGS.update({"publish dir": None})
def make_publish_dir(dir): def make_publish_dir(dir):
# setup helper to create publishing directory '''
setup helper to create publishing directory
'''
if not os.path.exists(WWW): if not os.path.exists(WWW):
subprocess.call(["mkdir", WWW]) subprocess.call(["mkdir", WWW])
@ -884,10 +905,12 @@ def make_publish_dir(dir):
print("\n\tpublishing to "+LIVE+USER+"/"+SETTINGS.get("publish dir")+"/\n\n") print("\n\tpublishing to "+LIVE+USER+"/"+SETTINGS.get("publish dir")+"/\n\n")
##### PATCHES ##### PATCHING UTILITIES
def updated(): def updated():
# checks to see if current user is up to the same version as system '''
checks to see if current user is up to the same version as system
'''
versionFile = os.path.join(PATH, "version") versionFile = os.path.join(PATH, "version")
if not os.path.exists(versionFile): if not os.path.exists(versionFile):
@ -901,7 +924,9 @@ def updated():
return False return False
def update_version(): def update_version():
# updates user to current version '''
updates user to current version
'''
global SETTINGS global SETTINGS
@ -947,8 +972,10 @@ def update_version():
ttbprc.close() ttbprc.close()
else: # version at least 0.8.6 else: # version at least 0.8.6
userVersion = open(versionFile, 'r').read()
# from 0.8.6 to 0.8.7 # from 0.8.6 to 0.8.7
if open(versionFile, 'r').read() == "0.8.6": if userVersion == "0.8.6":
print("\nresetting your publishing settings...\n") print("\nresetting your publishing settings...\n")
SETTINGS.update({"publishing":select_publishing()}) SETTINGS.update({"publishing":select_publishing()})
update_publishing() update_publishing()
@ -959,8 +986,14 @@ def update_version():
# increment user versionfile # increment user versionfile
open(versionFile, "w").write(__version__) open(versionFile, "w").write(__version__)
print("you're all good to go, "+chatter.say("friend")+"!")
return "you're all good to go, "+chatter.say("friend")+"!\n" # version 0.9.0 patch notes:
print("""
ver. 0.9.0 features:
* browsing other people's feels from neighbor view
* documentation browser
""")
##### #####