Re: [Tutor] sorry seems like it was sent in html
On 05/13/2012 07:22 PM, Keitaro Kaoru wrote: > is that better? not html... ? Your message is still html. The following section of code shows no indentation, so is very hard to interpret. > > def seen(mgr, room, user, msg, args): > name = args.lower().split(" ")[0] > if not name.isalnum(): return Html("Non-alphanumeric name, seriously?") > data = shared_db.get("seen:" + name) > if data == None: > return Html("I have no records about this user.") > data = json.loads(data) > ifdata[1] == "join": > return Html("Last seen%s join%s,%s ago.", name, > data[0], tdelta(data[2])) > elif data[1] == "leave": > return Html("Last seen%s leave%s,%s ago.", name, > data[0], tdelta(data[2])) > elif data[1] == "message": > return Html("Last seen%s message in%s,%s ago: > \"%s\"", name, data[0], tdelta(data[2]), data[3]) > return Html("I have no records about this user.") > > as you can see i only use some of the command. it doesnt produce an error > message tho.. just repeats "return Error("%s I couldn't find %s > anywhere", user.name.title(), name.title())" > > The following excerpt will show some of the html you sent: Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable is that better? not html... ? hey. Austin here for some reason this co= mmand. all it does it produces theerror message at the bottom.. = itll say my name and the persons name imtrying to send the messa= ge to but thats it. heres the command.=A0 mgr.addCommand("tell", 1, "send a person= a message to the rooms he is in",tell, unlisted =3D True)<= In addition you keep starting new threads. Use Reply-all to keep related messages together, and don't change the subject line if it's supposed to be part of the same thread. I can't tell what this message's context is. You start it with "hey Austin" but I don't see any other messages from an Austin, except about a year ago from an Austin Rodgers. I guess I need to back off. You don't list your imports, so people can only guess. But clearly you're using some libraries I'm not familiar with. Ask a clearer question, and somebody can probably help. -- DaveA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] sorry seems like it was sent in html
On 14/05/2012 00:22, Keitaro Kaoru wrote: is that better? not html... ? hey. Austin here for some reason this command. all it does it produces the error message at the bottom.. itll say my name and the persons name im trying to send the message to but thats it. heres the command. mgr.addCommand("tell", 1, "send a person a message to the rooms he is in", tell, unlisted = True) mgr is wahh ? def tell(mgr, croom, user, msg, args): name = args.lower().split(" ")[0] if not name.isalnum(): return Html("Non-alphanumeric name, seriously?") data = shared_db.get("seen:" + name) if data == None: return Html("I have no records about this user.") data = json.loads(data) for room in mgr.rooms: if data[1] == "join": mgr.sendObject(target, Html("%s,%s wants to tell you%s", name.title, user.name.title$ else: return Error("%s I couldn't find %s anywhere", user.name.title(), name.title()) i built it off these 2 commands def broadcast(mgr, croom, user, msg, args): for room in mgr.rooms: mgr.sendObject(room, Html("Broadcast by%s:%s", user.name, args)) def seen(mgr, room, user, msg, args): name = args.lower().split(" ")[0] if not name.isalnum(): return Html("Non-alphanumeric name, seriously?") data = shared_db.get("seen:" + name) if data == None: return Html("I have no records about this user.") data = json.loads(data) ifdata[1] == "join": return Html("Last seen%s join%s,%s ago.", name, data[0], tdelta(data[2])) elif data[1] == "leave": return Html("Last seen%s leave%s,%s ago.", name, data[0], tdelta(data[2])) elif data[1] == "message": return Html("Last seen%s message in%s,%s ago: \"%s\"", name, data[0], tdelta(data[2]), data[3]) return Html("I have no records about this user.") as you can see i only use some of the command. it doesnt produce an error message tho.. just repeats "return Error("%s I couldn't find %s anywhere", user.name.title(), name.title())" ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor No :( Please cut and past the exact code that you're using and the exception that you're getting, without that that it's impossible for us to help you. -- Cheers. Mark Lawrence. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor