# Path: newsreap/NNTPSettings.py
# NNTP_EOL = '\r\n'
# 
# Path: newsreap/NNTPMetaContent.py
# class NNTPMetaContent(NNTPContent):
#     """
#     An NNTP Meta representation
#     """
#     def __init__(self, filepath=None, part=0, work_dir=None, sort_no=2500,
#                  *args, **kwargs):
# 
#         super(NNTPMetaContent, self).__init__(
#             filepath=filepath,
#             part=part,
#             work_dir=work_dir, sort_no=sort_no, *args, **kwargs)
# 
#         self.content = list()
#         self._iter = None
# 
#     def key(self):
#         """
#         Returns a key that can be used for sorting with:
#             lambda x : x.key()
#         """
#         return '%.5d/MetaContent/%d' % (self.sort_no, id(self))
# 
#     def next(self):
#         """
#         Python 2 support
#         Support stream type functions and iterations
#         """
#         if not self._iter:
#             self._iter = iter(self.content)
# 
#         return next(self._iter)
# 
#     def __next__(self):
#         """
#         Python 3 support
#         Support iterating through list
#         """
#         if not self._iter:
#             self._iter = iter(self.content)
# 
#         return next(self._iter)
# 
#     def __iter__(self):
#         """
#         Mimic iter()
#         """
#         return iter(self.content)
# 
#     def __delitem__(self, key):
#         """
#         Mimic del action
#         """
#         del self.content[key]
# 
#     def __contains__(self, item):
#         """
#         Mimic 'in' directive
#         """
#         return item in self.content
# 
#     def __len__(self):
#         """
#         Support len() call
#         """
#         return len(self.content)
# 
#     def __repr__(self):
#         """
#         Keep it only possible to track 1 header
#         """
#         return '<NNTPMetaContent sort=%d content="%s" />' % (
#             self.sort_no, repr(self.content),
#         )


import re
from .NNTPSettings import NNTP_EOL
from .NNTPMetaContent import NNTPMetaContent
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.

# When printing of the object is required, content is returned as
# it appears in this list (sequentially).  Anything not matched
# here is simply printed at the end.
HEADER_PRINT_SEQUENCE = (
    'Subject',
    'From',
    'Date',
    'Message-ID',
    'Lines',
    'Size',
    'Newsgroups',
    'Content-Type',
    'Mime-Version',
    'Content-Transfer-Encoding',

    # Defined X-Entries
    'X-Newsposter',
)

# By maintaining a list of headers we can set manually that are defined by the
# NNTP Spec, we can automatically stick X- infront of anything else so that
# they are valid as well.
VALID_HEADER_ENTRIES = (
    'Subject',

# Path: newsreap/NNTPSettings.py
# NNTP_EOL = '\r\n'
# 
# Path: newsreap/NNTPMetaContent.py
# class NNTPMetaContent(NNTPContent):
#     """
#     An NNTP Meta representation
#     """
#     def __init__(self, filepath=None, part=0, work_dir=None, sort_no=2500,
#                  *args, **kwargs):
# 
#         super(NNTPMetaContent, self).__init__(
#             filepath=filepath,
#             part=part,
#             work_dir=work_dir, sort_no=sort_no, *args, **kwargs)
# 
#         self.content = list()
#         self._iter = None
# 
#     def key(self):
#         """
#         Returns a key that can be used for sorting with:
#             lambda x : x.key()
#         """
#         return '%.5d/MetaContent/%d' % (self.sort_no, id(self))
# 
#     def next(self):
#         """
#         Python 2 support
#         Support stream type functions and iterations
#         """
#         if not self._iter:
#             self._iter = iter(self.content)
# 
#         return next(self._iter)
# 
#     def __next__(self):
#         """
#         Python 3 support
#         Support iterating through list
#         """
#         if not self._iter:
#             self._iter = iter(self.content)
# 
#         return next(self._iter)
# 
#     def __iter__(self):
#         """
#         Mimic iter()
#         """
#         return iter(self.content)
# 
#     def __delitem__(self, key):
#         """
#         Mimic del action
#         """
#         del self.content[key]
# 
#     def __contains__(self, item):
#         """
#         Mimic 'in' directive
#         """
#         return item in self.content
# 
#     def __len__(self):
#         """
#         Support len() call
#         """
#         return len(self.content)
# 
#     def __repr__(self):
#         """
#         Keep it only possible to track 1 header
#         """
#         return '<NNTPMetaContent sort=%d content="%s" />' % (
#             self.sort_no, repr(self.content),
#         )


# Path: newsreap/NNTPHeader.py
import re
from .NNTPSettings import NNTP_EOL
from .NNTPMetaContent import NNTPMetaContent

#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.

# When printing of the object is required, content is returned as
# it appears in this list (sequentially).  Anything not matched
# here is simply printed at the end.
HEADER_PRINT_SEQUENCE = (
    'Subject',
    'From',
    'Date',
    'Message-ID',
    'Lines',
    'Size',
    'Newsgroups',
    'Content-Type',
    'Mime-Version',
    'Content-Transfer-Encoding',

    # Defined X-Entries
    'X-Newsposter',
)

# By maintaining a list of headers we can set manually that are defined by the
# NNTP Spec, we can automatically stick X- infront of anything else so that
# they are valid as well.
VALID_HEADER_ENTRIES = (
    'Subject',

    'From',