# Path: pages/parser.py
# def parse_page(dirpath):
#     """ Parse a page given a relative file path """
#     filename, msg = read_content_file(dirpath)
# 
#     content = msg.get_payload()
#     content_type = determine_page_content_type(content)
# 
#     data = {
#         'headers': dict(msg.items()),
#         'content': content,
#         'content_type': content_type,
#         'filename': filename,
#     }
# 
#     return data


import re
import shutil
import os
import traceback
from django.core.management.base import BaseCommand
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from bs4 import BeautifulSoup
from ...models import Page, Image
from ...parser import parse_page





def fix_image_path(src):
    if src.startswith('http'):
        return src

# Path: pages/parser.py
# def parse_page(dirpath):
#     """ Parse a page given a relative file path """
#     filename, msg = read_content_file(dirpath)
# 
#     content = msg.get_payload()
#     content_type = determine_page_content_type(content)
# 
#     data = {
#         'headers': dict(msg.items()),
#         'content': content,
#         'content_type': content_type,
#         'filename': filename,
#     }
# 
#     return data


# Path: pages/management/commands/import_pages_from_svn.py
import re
import shutil
import os
import traceback
from django.core.management.base import BaseCommand
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from bs4 import BeautifulSoup
from ...models import Page, Image
from ...parser import parse_page






def fix_image_path(src):
    if src.startswith('http'):
        return src

    if not src.startswith('/'):