sorting user list in preparation for neighbor browsing

master
endorphant 2016-05-03 13:52:07 -04:00
parent 7f150238a9
commit 0cbb1836be
1 changed files with 6 additions and 1 deletions

View File

@ -307,6 +307,8 @@ def send_feedback(subject="none", mailbox=os.path.join(FEEDBACK, USER+"-"+time.s
def view_neighbors(users): def view_neighbors(users):
userList = []
for user in users: for user in users:
userRC = json.load(open(os.path.join("/home", user, ".ttbp", "config", "ttbprc"))) userRC = json.load(open(os.path.join("/home", user, ".ttbp", "config", "ttbprc")))
url = LIVE+user+"/"+userRC["publish dir"] url = LIVE+user+"/"+userRC["publish dir"]
@ -320,7 +322,10 @@ def view_neighbors(users):
user = "~"+user user = "~"+user
if len(user) < 8: if len(user) < 8:
user += "\t" user += "\t"
print("\t"+user+"\t"+url+pad+"\t("+p.no("feel", count)+")") userList.append("\t"+user+"\t"+url+pad+"\t("+p.no("feel", count)+")")
userList.sort()
print_menu(userList)
raw_input("\n\npress <enter> to go back home.\n\n") raw_input("\n\npress <enter> to go back home.\n\n")
redraw() redraw()