Move constants into const module

This commit is contained in:
Philipp Hörist 2018-04-23 18:22:47 +02:00
parent 86bfc81ad3
commit 4f2033faff
2 changed files with 56 additions and 52 deletions

View file

@ -53,6 +53,59 @@ class PathType(IntEnum):
FOLDER = 1 FOLDER = 1
FOLDER_OPTIONAL = 2 FOLDER_OPTIONAL = 2
@unique
class KindConstant(IntEnum):
STATUS = 0
GCSTATUS = 1
GC_MSG = 2
SINGLE_MSG_RECV = 3
CHAT_MSG_RECV = 4
SINGLE_MSG_SENT = 5
CHAT_MSG_SENT = 6
ERROR = 7
def __str__(self):
return str(self.value)
@unique
class ShowConstant(IntEnum):
ONLINE = 0
CHAT = 1
AWAY = 2
XA = 3
DND = 4
OFFLINE = 5
@unique
class TypeConstant(IntEnum):
AIM = 0
GG = 1
HTTP_WS = 2
ICQ = 3
MSN = 4
QQ = 5
SMS = 6
SMTP = 7
TLEN = 8
YAHOO = 9
NEWMAIL = 10
RSS = 11
WEATHER = 12
MRIM = 13
NO_TRANSPORT = 14
@unique
class SubscriptionConstant(IntEnum):
NONE = 0
TO = 1
FROM = 2
BOTH = 3
@unique
class JIDConstant(IntEnum):
NORMAL_TYPE = 0
ROOM_TYPE = 1
THANKS = u"""\ THANKS = u"""\
Alexander Futász Alexander Futász

View file

@ -43,6 +43,9 @@ from enum import IntEnum, unique
from gajim.common import exceptions from gajim.common import exceptions
from gajim.common import app from gajim.common import app
from gajim.common import configpaths from gajim.common import configpaths
from gajim.common.const import (
JIDConstant, KindConstant, ShowConstant, TypeConstant,
SubscriptionConstant)
import sqlite3 as sqlite import sqlite3 as sqlite
@ -53,58 +56,6 @@ CACHE_DB_PATH = configpaths.get('CACHE_DB')
import logging import logging
log = logging.getLogger('gajim.c.logger') log = logging.getLogger('gajim.c.logger')
@unique
class JIDConstant(IntEnum):
NORMAL_TYPE = 0
ROOM_TYPE = 1
@unique
class KindConstant(IntEnum):
STATUS = 0
GCSTATUS = 1
GC_MSG = 2
SINGLE_MSG_RECV = 3
CHAT_MSG_RECV = 4
SINGLE_MSG_SENT = 5
CHAT_MSG_SENT = 6
ERROR = 7
def __str__(self):
return str(self.value)
@unique
class ShowConstant(IntEnum):
ONLINE = 0
CHAT = 1
AWAY = 2
XA = 3
DND = 4
OFFLINE = 5
@unique
class TypeConstant(IntEnum):
AIM = 0
GG = 1
HTTP_WS = 2
ICQ = 3
MSN = 4
QQ = 5
SMS = 6
SMTP = 7
TLEN = 8
YAHOO = 9
NEWMAIL = 10
RSS = 11
WEATHER = 12
MRIM = 13
NO_TRANSPORT = 14
@unique
class SubscriptionConstant(IntEnum):
NONE = 0
TO = 1
FROM = 2
BOTH = 3
class Logger: class Logger:
def __init__(self): def __init__(self):