Skip to content
Permalink
Browse files

Minor tweaks for production serving.

  • Loading branch information...
jonthornton committed Apr 8, 2014
1 parent 157bb0f commit 51c155a37eb98be208267c7be37623c9d811eb10
Showing with 12 additions and 9 deletions.
  1. +1 −0 .gitignore
  2. +11 −9 wp2tumblr.py
@@ -1,5 +1,6 @@
.DS_Store
venv
.env
.Python
*.cfg
*.log
@@ -20,7 +20,7 @@
import pytumblr


app = Flask(__name__, static_folder='static', static_url_path='')
app = Flask(__name__)
app.config.from_envvar('WP2TUMBLR_SETTINGS')

POST_STATES = {
@@ -163,14 +163,16 @@ def do_import(tumblog_name, xml_file):
continue

post['body'] = item.getElementsByTagName('content:encoded')[0].firstChild.nodeValue.encode('utf-8', 'xmlcharrefreplace')
print post["title"]

g.tumblr.create_text(tumblog_name,
type=post['type'],
title=post['title'],
body=post['body'],
date=post['date'],
state=post['state'])

if app.debug:
print post["title"]
else:
g.tumblr.create_text(tumblog_name,
type=post['type'],
title=post['title'],
body=post['body'],
date=post['date'],
state=post['state'])

post_count += 1

0 comments on commit 51c155a

Please sign in to comment.
You can’t perform that action at this time.