|
|
@ -44,7 +44,6 @@ def auth_options(namespace, options, auths): |
|
|
|
# Exceptions |
|
|
|
# Exceptions |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NetworkError(Exception): |
|
|
|
class NetworkError(Exception): |
|
|
|
"""Base class for all network related exceptions.""" |
|
|
|
"""Base class for all network related exceptions.""" |
|
|
|
pass |
|
|
|
pass |
|
|
@ -92,10 +91,12 @@ class NetworkPermissionDeniedError(NetworkError): |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
# Warnings |
|
|
|
# Warnings |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
class NetworkWarning(Warning): |
|
|
|
class NetworkWarning(Warning): |
|
|
|
"""Base warning for networks.""" |
|
|
|
"""Base warning for networks.""" |
|
|
|
pass |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MessageTooLongWarning(NetworkWarning): |
|
|
|
class MessageTooLongWarning(NetworkWarning): |
|
|
|
"""The message is too long for the network.""" |
|
|
|
"""The message is too long for the network.""" |
|
|
|
pass |
|
|
|
pass |
|
|
@ -104,7 +105,6 @@ class MessageTooLongWarning(NetworkWarning): |
|
|
|
# The classes |
|
|
|
# The classes |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
#-------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NetworkData(object): |
|
|
|
class NetworkData(object): |
|
|
|
"""Provides an uniform way to access information about posts. The |
|
|
|
"""Provides an uniform way to access information about posts. The |
|
|
|
following fields should appear: |
|
|
|
following fields should appear: |
|
|
@ -143,6 +143,7 @@ class NetworkData(object): |
|
|
|
worry about this field themselves; :class:`Networks` will set it when |
|
|
|
worry about this field themselves; :class:`Networks` will set it when |
|
|
|
merging information from all networks. |
|
|
|
merging information from all networks. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self): |
|
|
|
def __init__(self): |
|
|
|
self.id = '' |
|
|
|
self.id = '' |
|
|
|
self.name = '' |
|
|
|
self.name = '' |
|
|
@ -189,7 +190,6 @@ class NetworkBase(object): |
|
|
|
if possible. |
|
|
|
if possible. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_setup(self): |
|
|
|
def is_setup(self): |
|
|
|
"""Should return a boolean indicating if the network have all |
|
|
|
"""Should return a boolean indicating if the network have all |
|
|
|
necessary options set up so it can retrieve information. |
|
|
|
necessary options set up so it can retrieve information. |
|
|
@ -244,12 +244,12 @@ class NetworkBase(object): |
|
|
|
|
|
|
|
|
|
|
|
def can_delete(self, message): |
|
|
|
def can_delete(self, message): |
|
|
|
"""Return True if the message can be deleted; False otherwise.""" |
|
|
|
"""Return True if the message can be deleted; False otherwise.""" |
|
|
|
return False; |
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
def can_reply(self, message): |
|
|
|
def can_reply(self, message): |
|
|
|
"""Return True if the message can be replied; False otherwise.""" |
|
|
|
"""Return True if the message can be replied; False otherwise.""" |
|
|
|
return False; |
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
def can_repost(self, message): |
|
|
|
def can_repost(self, message): |
|
|
|
"""Return True if the message can be resposted; False otherwise.""" |
|
|
|
"""Return True if the message can be resposted; False otherwise.""" |
|
|
|
return False; |
|
|
|
return False |
|
|
|