# Path: mdweb/Exceptions.py
# class PageMetaInfFieldException(Exception):
#     """Invalid field in page metadata."""
# 
#     pass
# 
# Path: mdweb/metafields.py
# META_FIELDS = {
#     'title': ('unicode', None),
#     'nav_name': ('unicode', None),
#     'description': ('unicode', None),
#     'author': ('unicode', None),
#     'date': ('date', None),
#     'order': ('int', 0),
#     'template': ('unicode', None),
#     'teaser': ('unicode', None),
#     'teaser_image': ('unicode', None),
#     'sitemap_priority': ('unicode', None),
#     'sitemap_changefreq': ('unicode', None),
#     'published': ('bool', True),
# }


import re
import dateparser
from six import string_types
from mdweb.Exceptions import PageMetaInfFieldException
from mdweb.metafields import META_FIELDS as MDW_META_FIELDS
        """

        # NOTE: This regex leaves blank lines and comments in but that will
        # be handled in the line processing loop
        line_regex = '(?P<line>[a-zA-Z0-9 ]+:(?:(?![\n]+\w)[\w\W\r\n])+)'
        line_matches = re.findall(line_regex, meta_inf_string)
        line_blocks = line_matches

        for line_block in line_blocks:
            # Split the line block into seperate lines and process each line
            lines = line_block.split('\n')
            processed_line = ''
            for line in lines:
                # Remove blank lines and comments
                if line.strip(' ') == '' or re.match(r'^ *#', line):
                    continue
                # Strip beginning and trailing whitespace and newlines
                line = line.strip(' \t\n\r')

                processed_line += ' ' + line

            match = re.search(self.FIELD_VALUE_REGEX, processed_line)
            if match is None:
                raise PageMetaInfFieldException(
                    "Improperly formated metainf line '%s'" % processed_line)

            key = match.group('key').strip().lower().replace(' ', '_')
            value = match.group('value').strip()
            
            if '' == value:

# Path: mdweb/Exceptions.py
# class PageMetaInfFieldException(Exception):
#     """Invalid field in page metadata."""
# 
#     pass
# 
# Path: mdweb/metafields.py
# META_FIELDS = {
#     'title': ('unicode', None),
#     'nav_name': ('unicode', None),
#     'description': ('unicode', None),
#     'author': ('unicode', None),
#     'date': ('date', None),
#     'order': ('int', 0),
#     'template': ('unicode', None),
#     'teaser': ('unicode', None),
#     'teaser_image': ('unicode', None),
#     'sitemap_priority': ('unicode', None),
#     'sitemap_changefreq': ('unicode', None),
#     'published': ('bool', True),
# }


# Path: mdweb/BaseObjects.py
import re
import dateparser
from six import string_types
from mdweb.Exceptions import PageMetaInfFieldException
from mdweb.metafields import META_FIELDS as MDW_META_FIELDS

        """

        # NOTE: This regex leaves blank lines and comments in but that will
        # be handled in the line processing loop
        line_regex = '(?P<line>[a-zA-Z0-9 ]+:(?:(?![\n]+\w)[\w\W\r\n])+)'
        line_matches = re.findall(line_regex, meta_inf_string)
        line_blocks = line_matches

        for line_block in line_blocks:
            # Split the line block into seperate lines and process each line
            lines = line_block.split('\n')
            processed_line = ''
            for line in lines:
                # Remove blank lines and comments
                if line.strip(' ') == '' or re.match(r'^ *#', line):
                    continue
                # Strip beginning and trailing whitespace and newlines
                line = line.strip(' \t\n\r')

                processed_line += ' ' + line

            match = re.search(self.FIELD_VALUE_REGEX, processed_line)
            if match is None:
                raise PageMetaInfFieldException(
                    "Improperly formated metainf line '%s'" % processed_line)

            key = match.group('key').strip().lower().replace(' ', '_')
            value = match.group('value').strip()
            
            if '' == value:

                raise PageMetaInfFieldException(