import shutil as _shutil
import subprocess as _subprocess
import tempfile as _tempfile
-import urlparse as _urlparse
+try: # Python 3
+ import urllib.parse as _urllib_parse
+except ImportError: # Python 2
+ import urlparse as _urllib_parse
-__version__ = '0.2'
+__version__ = '0.3'
_LOG = _logging.getLogger('git-publish')
_LOG.addHandler(_logging.StreamHandler())
('jdoe', 'example.com', 2222, '/a/b/c')
"""
_LOG.debug("parse {} using Git's URL syntax".format(remote))
- p = _urlparse.urlparse(remote)
+ p = _urllib_parse.urlparse(remote)
assert p.scheme == 'ssh', p.scheme
assert p.params == '', p.params
assert p.query == '', p.query
_shutil.move(_os_path.join(bare, 'hooks', 'post-update.sample'),
_os_path.join(bare, 'hooks', 'post-update'))
git(repo=bare, args=['--bare', 'update-server-info'])
- _os.chmod(bare, 0755)
+ _os.chmod(bare, 0o0755)
return bare
def recursive_copy(source, user, host, port, path):