bgneal@2: #!/usr/bin/env python
bgneal@2: """
bgneal@2: A simple script to convert my Blogofile restructured text posts into the format
bgneal@2: expected by Pelican.
bgneal@2:
bgneal@2: """
bgneal@2: # Copyright (C) 2014 by Brian Neal.
bgneal@2: #
bgneal@2: # Permission is hereby granted, free of charge, to any person obtaining a copy
bgneal@2: # of this software and associated documentation files (the "Software"), to deal
bgneal@2: # in the Software without restriction, including without limitation the rights
bgneal@2: # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
bgneal@2: # copies of the Software, and to permit persons to whom the Software is
bgneal@2: # furnished to do so, subject to the following conditions:
bgneal@2: #
bgneal@2: # The above copyright notice and this permission notice shall be included in
bgneal@2: # all copies or substantial portions of the Software.
bgneal@2: #
bgneal@2: # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
bgneal@2: # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
bgneal@2: # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
bgneal@2: # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
bgneal@2: # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
bgneal@2: # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
bgneal@2: # THE SOFTWARE.
bgneal@2:
bgneal@2: import datetime
bgneal@2: import os
bgneal@2: import re
bgneal@2: import time
bgneal@2:
bgneal@2:
bgneal@2: SRC_DIR = os.path.expanduser('~/coding/python/virtualenvs/blogofile/blog/_posts')
bgneal@2: DST_DIR = os.path.expanduser('~/coding/python/venvs/blog/blog-pelican/content')
bgneal@2:
bgneal@2: TITLE_RE = re.compile(r'^title: (?P