Refactor parse_time into its own utils file.

This commit is contained in:
Rapptz
2015-09-04 22:00:22 -04:00
parent b00ad4ad79
commit b4e6591c9d
4 changed files with 48 additions and 19 deletions

View File

@ -24,18 +24,20 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
import requests
import json, re, time, copy
from collections import deque
from threading import Timer
from ws4py.client.threadedclient import WebSocketClient
from sys import platform as sys_platform
from . import endpoints
from .errors import InvalidEventName, InvalidDestination, GatewayNotFound
from .user import User
from .channel import Channel, PrivateChannel
from .server import Server, Member, Permissions, Role
from .message import Message
from .utils import parse_time
import requests
import json, re, time, copy
from collections import deque
from threading import Timer
from ws4py.client.threadedclient import WebSocketClient
from sys import platform as sys_platform
def _null_event(*args, **kwargs):
pass
@ -238,7 +240,7 @@ class Client(object):
continue
value = data[attr]
if 'time' in attr:
setattr(message, attr, message._parse_time(value))
setattr(message, attr, parse_time(value))
else:
setattr(message, attr, value)
self._invoke_event('on_message_edit', older_message, message)