diff --git a/TODO b/TODO index e3bd3dc..12d506b 100644 --- a/TODO +++ b/TODO @@ -19,3 +19,5 @@ bugs: considerable tweaks to python-twitter) * "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround. * Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue +* If an @ appears anywhere in a status update, links after it try to resolve to user: links... need to work on my regexes +* "/home/user/code/hrafn/apithreads.py", line 241: UnboundLocalError: local variable 'user' referenced before assignment diff --git a/apithreads.py b/apithreads.py index 3933cf9..fb6e36c 100644 --- a/apithreads.py +++ b/apithreads.py @@ -389,23 +389,16 @@ gobject.signal_new("friendship-changed", SigProxy, # We use these classes to emulate a Status object when we need # one to be built out of something else. -class User(): +class User(object): def __init__(self): - self.screen_name = None - self.name = None self.profile = Profile() -class Profile(): - def __init__(self): - self.image_url = None - -class Status(): +class Profile(object): + pass + +class Status(object): def __init__(self): self.user = User() - self.id = None - self.created_at = None - self.in_reply_to_screen_name = None - self.in_reply_to_status_id = None def results_to_statuses(results, api): @@ -435,7 +428,9 @@ def results_to_statuses(results, api): created_at = re.sub(',', '', result.created_at) created_split = re.split(' ', created_at) status.created_at = created_split[0] + ' ' + created_split[2] + ' ' + created_split[1] + ' ' + created_split[4] + ' ' + created_split[5] + ' ' + created_split[3] + status.text = result.text + status.source = result.source # If this is in reply to something, get the relevant tweet if result.to_user_id is not None: @@ -465,6 +460,7 @@ def dms_to_statuses(direct_messages): status.user.profile.image_url = dm.sender.profile.image_url status.created_at = dm.created_at status.text = dm.text + status.source = None statuses.append(status) return statuses