r252350 - in collective.migrator/trunk: . collective.migrator.egg-info collective/migrator collective/migrator/recipes
"Suresh V" <svn-changes-z4DKO/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.collective.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: sureshvv
Date: Tue Apr 30 04:14:06 2013
New Revision: 252350
Modified:
collective.migrator/trunk/collective.migrator.egg-info/PKG-INFO
collective.migrator/trunk/collective.migrator.egg-info/SOURCES.txt
collective.migrator/trunk/collective/migrator/buildout.cfg
collective.migrator/trunk/collective/migrator/migrator.py
collective.migrator/trunk/collective/migrator/recipes/utils.py
collective.migrator/trunk/setup.py
Log:
remove zope.testbrowser dependency
Modified: collective.migrator/trunk/collective.migrator.egg-info/PKG-INFO
==============================================================================
--- collective.migrator/trunk/collective.migrator.egg-info/PKG-INFO (original)
+++ collective.migrator/trunk/collective.migrator.egg-info/PKG-INFO Tue Apr 30 04:14:06 2013
@@ -1,4 +1,4 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: collective.migrator
Version: 1.9.dev0
Summary: Tool and buildout recipes for zope/plone content migration
Modified: collective.migrator/trunk/collective.migrator.egg-info/SOURCES.txt
==============================================================================
--- collective.migrator/trunk/collective.migrator.egg-info/SOURCES.txt (original)
+++ collective.migrator/trunk/collective.migrator.egg-info/SOURCES.txt Tue Apr 30 04:14:06 2013
@@ -25,7 +25,6 @@
collective/migrator/scripts/site_config.py
collective/migrator/scripts/sitemap.py
collective/migrator/templates/__init__.py
-collective/migrator/templates/eggs.cfg
collective/migrator/templates/instance.cfg
collective/migrator/templates/migrate_frontpage.cfg
collective/migrator/templates/migrate_junk.cfg
Modified: collective.migrator/trunk/collective/migrator/buildout.cfg
==============================================================================
--- collective.migrator/trunk/collective/migrator/buildout.cfg (original)
+++ collective.migrator/trunk/collective/migrator/buildout.cfg Tue Apr 30 04:14:06 2013
@@ -1,6 +1,5 @@
[buildout]
-extends = templates/eggs.cfg
- templates/instance.cfg
+extends = templates/instance.cfg
templates/migrate_frontpage.cfg
templates/migrate_users.cfg
templates/migrate_props.cfg
Modified: collective.migrator/trunk/collective/migrator/migrator.py
==============================================================================
--- collective.migrator/trunk/collective/migrator/migrator.py (original)
+++ collective.migrator/trunk/collective/migrator/migrator.py Tue Apr 30 04:14:06 2013
@@ -2,7 +2,7 @@
"""
import logging, os, sys, shutil, urllib2
-BOOTSTRAP_URL = 'http://python-distribute.org/bootstrap.py'
+BOOTSTRAP_URL = 'http://downloads.buildout.org/2/bootstrap.py'
logger = logging.getLogger('migrator')
@@ -36,6 +36,7 @@
mig_templates_dir = os.path.join(mig_dir, 'templates')
shutil.copytree(templates_dir, mig_templates_dir)
os.chdir(mig_dir)
+ os.system('%s/bin/easy_install requests' % mig_dir)
ez = {}
exec urllib2.urlopen(BOOTSTRAP_URL).read() in ez
- os.system('bin/buildout')
+ os.system('%s/bin/buildout' % mig_dir)
Modified: collective.migrator/trunk/collective/migrator/recipes/utils.py
==============================================================================
--- collective.migrator/trunk/collective/migrator/recipes/utils.py (original)
+++ collective.migrator/trunk/collective/migrator/recipes/utils.py Tue Apr 30 04:14:06 2013
@@ -1,10 +1,10 @@
import os
import time
import base64
-from zope.testbrowser.browser import Browser
from urllib2 import HTTPError
import subprocess
import urllib
+import requests
import os.path
from StringIO import StringIO
@@ -13,6 +13,19 @@
Browsers = {}
+class Browser:
+
+ def __init__(self, user, pwd):
+ self.user = user
+ self.pwd = pwd
+
+ def open(self, url):
+ self.r = requests.get(url, auth=(self.user, self.pwd))
+
+ @property
+ def contents(self):
+ return self.r.text
+
def get_zmi(instance):
zmi = instance.get('zmi', None)
@@ -118,15 +131,12 @@
host_name, host_port = (instance['host'], instance['port'])
key = '%s:%s' % (host_name, host_port)
if key not in Browsers:
- br = Browser()
pwd_file = instance.get('pwd_file', None)
if pwd_file:
zmi_user, zmi_pwd = get_login_details(pwd_file)
- br.addHeader('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (zmi_user, zmi_pwd)))
elif instance.get('zmi_user', None):
zmi_user, zmi_pwd = (instance['zmi_user'], instance['zmi_pwd'])
- br.addHeader('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (zmi_user, zmi_pwd)))
- Browsers[key] = br
+ Browsers[key] = Browser(zmi_user, zmi_pwd)
return Browsers[key]
Modified: collective.migrator/trunk/setup.py
==============================================================================
--- collective.migrator/trunk/setup.py (original)
+++ collective.migrator/trunk/setup.py Tue Apr 30 04:14:06 2013
@@ -41,7 +41,8 @@
zip_safe=False,
test_suite = 'collective.migrator.tests',
install_requires=[
- 'virtualenv',
- ],
+ 'virtualenv',
+ # 'requests',
+ ],
entry_points=entry_points,
)
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1