Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

making WordPress migration script work: lib path fixes, some newbies'…

… prints, and speacial WP URL fixes.
  • Loading branch information...
commit cbd91cfd8165773c8fba9a4f7270819ff86e4c87 1 parent be3102a
@menny menny authored committed
Showing with 22 additions and 11 deletions.
  1. +6 −3 migrate.py
  2. +16 −8 script/remote.py
View
9 migrate.py
@@ -277,7 +277,11 @@ def _convert_post_node(self, node, channel_link):
else:
post['published'] = self._parse_date(self._get_text(node, 'post_date',
ns=self.ns_wordpress))
- post['path'] = self._get_text(node, 'link')[len(channel_link):] or None
+ post_wp_path = self._get_text(node, 'link')[len(channel_link):] or None
+ post_wp_path = post_wp_path.replace("?", "")
+ post_wp_path = post_wp_path.replace("=", "/")
+ post['path'] = post_wp_path
+
post['title'] = self._get_text(node, 'title') or None
post['body'] = self._expand_wp_tags(
self._get_text(node, 'encoded',
@@ -341,6 +345,5 @@ def migrate_all(self, batch_size=20, items=None):
deferred.defer(self.migrate_all, batch_size, items[batch_size:])
else:
logging.warn("Migration finished; starting rebuild.")
- regen = post_deploy.PostRegenerator()
+ regen = post_deploy.ContentRegenerator()
deferred.defer(regen.regenerate)
-
View
24 script/remote.py
@@ -4,15 +4,18 @@
import os
import sys
-# Bloggart is currently based on Django 0.96
-from google.appengine.dist import use_library
-use_library('django', '0.96')
+#To run this script, from the application root folder (where migrate.py is located):
+#python script/remote.py
## Application specific
-SDK_DIR = '/usr/local/google_appengine'
-APP_DIR = '/home/aht/src/bloggart'
-APPID = 'bloggart-demo'
-EMAIL = 'my.email@host.dom'
+#make sure the variables below are correct.
+SDK_DIR = '/home/your_username/google_appengine'
+APP_DIR = '/home/your_username/git/bloggart'
+APPID = 'bloggart_GAE_app_ID'
+EMAIL = 'your_email@example.com'
+
+print "Your SDK folder is "+SDK_DIR;
+print "If this is incorrect, edit remote.py to reflect the correct path!"
REMOTE_API_PATH = '/remote_api'
@@ -23,12 +26,17 @@
os.path.join(SDK_DIR, 'lib', 'antlr3'),
os.path.join(SDK_DIR, 'lib', 'django'),
os.path.join(SDK_DIR, 'lib', 'webob'),
+ os.path.join(SDK_DIR, 'lib', 'fancy_urllib'),
os.path.join(SDK_DIR, 'lib', 'yaml', 'lib'),
APP_DIR,
os.path.join(APP_DIR, 'lib'),
]
sys.path = EXTRA_PATHS + sys.path
+# Bloggart is currently based on Django 0.96
+from google.appengine.dist import use_library
+use_library('django', '0.96')
+
from google.appengine.ext.remote_api import remote_api_stub
def attach(host=None):
@@ -73,4 +81,4 @@ def auth_func():
sys.ps1 = '%s <-- ' % (host or APPID)
import code
- code.interact(banner=BANNER, local=globals())
+ code.interact(banner=BANNER, local=globals())
Please sign in to comment.
Something went wrong with that request. Please try again.