# Path: KPC/classes.py
# class Error:
#     '''An individual error from a check against an entry. One check
#     usually returns list of errors or empty list if there's no error.
#     '''
#     SUCCESS = 0
#     DEPRECATED = 1
#     WARNING = 2
#     ERROR = 3
# 
#     def __init__(self, message):
#         self.pos = 0
#         self.level = Error.ERROR
#         self.message = message
# 
# class BaseCheck:
#     '''Base class to check an entry from PO files. Subclasses should
#     implement check() function. check() returns list of errors if any.
#     '''
#     def _get_context(self, entry):
#         if not hasattr(self, 'get_context'):
#             return {}
#         fields = {}
#         # parse msgstr
#         for line in entry.msgstr.split('\n'):
#             try:
#                 k, v = line.split(': ', 1)
#                 fields[k] = v
#             except ValueError:
#                 pass
#         return self.get_context(entry, fields)
# 
#     def _check(self, entry, context):
#         return self.check(entry, context)


import re
from KPC.classes import Error, BaseCheck
    # 레이블이면 True
    def identify(self, entry):
        # 여러 줄 레이블 아님
        if '\n' in entry.msgid:
            return False
        # GConf schema or GSettings schema file
        if entry.references and ('.schemas' in entry.references[0] or
                                 '.gschema' in entry.references[0]):
            return False

        words = [x for x in entry.msgid.split(' ') if len(x)]
        # 모든 단어가 대문자로 시작하면 레이블
        if ''.join([x[0] for x in words]).isupper():
            return True
        # 단축키가 있으면
        if '_' in entry.msgid:
            return True
        if entry.msgid.endswith('...'):
            return True
        elif entry.msgid.endswith('\u2026'):
            return True
        return False

    def check(self, entry, context):
        if not self.identify(entry):
            return []
        msgid = normalize_msg(entry.msgid)
        msgstr = normalize_msg(entry.msgstr)
        for d in data:
            re_msgid = d['re_msgid']

# Path: KPC/classes.py
# class Error:
#     '''An individual error from a check against an entry. One check
#     usually returns list of errors or empty list if there's no error.
#     '''
#     SUCCESS = 0
#     DEPRECATED = 1
#     WARNING = 2
#     ERROR = 3
# 
#     def __init__(self, message):
#         self.pos = 0
#         self.level = Error.ERROR
#         self.message = message
# 
# class BaseCheck:
#     '''Base class to check an entry from PO files. Subclasses should
#     implement check() function. check() returns list of errors if any.
#     '''
#     def _get_context(self, entry):
#         if not hasattr(self, 'get_context'):
#             return {}
#         fields = {}
#         # parse msgstr
#         for line in entry.msgstr.split('\n'):
#             try:
#                 k, v = line.split(': ', 1)
#                 fields[k] = v
#             except ValueError:
#                 pass
#         return self.get_context(entry, fields)
# 
#     def _check(self, entry, context):
#         return self.check(entry, context)


# Path: KPC/checks/terminology/common-labels.py
import re
from KPC.classes import Error, BaseCheck

    # 레이블이면 True
    def identify(self, entry):
        # 여러 줄 레이블 아님
        if '\n' in entry.msgid:
            return False
        # GConf schema or GSettings schema file
        if entry.references and ('.schemas' in entry.references[0] or
                                 '.gschema' in entry.references[0]):
            return False

        words = [x for x in entry.msgid.split(' ') if len(x)]
        # 모든 단어가 대문자로 시작하면 레이블
        if ''.join([x[0] for x in words]).isupper():
            return True
        # 단축키가 있으면
        if '_' in entry.msgid:
            return True
        if entry.msgid.endswith('...'):
            return True
        elif entry.msgid.endswith('\u2026'):
            return True
        return False

    def check(self, entry, context):
        if not self.identify(entry):
            return []
        msgid = normalize_msg(entry.msgid)
        msgstr = normalize_msg(entry.msgstr)
        for d in data:
            re_msgid = d['re_msgid']

            re_msgstr = d['re_msgstr']