aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2013-01-30 16:41:13 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2013-01-30 16:41:13 -0500
commit613b81dd22fde850c04d3b3a26c609555ca9d194 (patch)
tree85c944add986f8d96de0999e197609d15e25dec6
parente4d8a595f0f863b365728f27632e39a767c31e79 (diff)
parent017a7954c855e213a5f3559a1bb7868d69ae43c1 (diff)
downloaddotfiles-613b81dd22fde850c04d3b3a26c609555ca9d194.tar.gz
dotfiles-613b81dd22fde850c04d3b3a26c609555ca9d194.tar.bz2
dotfiles-613b81dd22fde850c04d3b3a26c609555ca9d194.zip
Merge branch 'release/0.5.6'v0.5.6
-rw-r--r--AUTHORS.rst1
-rw-r--r--HISTORY.rst5
-rw-r--r--dotfiles/core.py22
3 files changed, 17 insertions, 11 deletions
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 7e14a61..ad4512c 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -15,3 +15,4 @@ Patches and Suggestions
- Reinout van Rees <reinout@vanrees.org>
- Daniel Harding
- Gary Oberbrunner
+- Alexandre Rossi <alexandre.rossi@gmail.com>
diff --git a/HISTORY.rst b/HISTORY.rst
index d53e88d..ca040a8 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,11 @@
History
-------
+0.5.6
++++++
+
+* Restore python 3 compatibility
+
0.5.5
+++++
diff --git a/dotfiles/core.py b/dotfiles/core.py
index 93e45f1..20f9a1a 100644
--- a/dotfiles/core.py
+++ b/dotfiles/core.py
@@ -13,7 +13,7 @@ import shutil
import fnmatch
-__version__ = '0.5.5'
+__version__ = '0.5.6'
__author__ = 'Jon Bernard'
__license__ = 'ISC'
@@ -83,9 +83,9 @@ else:
else:
stat = CreateSymbolicLinkA(name, target, is_dir)
if win32_verbose:
- print "CreateSymbolicLink(name=%s, target=%s, is_dir=%d) = %#x"%(name,target,is_dir, stat)
+ print("CreateSymbolicLink(name=%s, target=%s, is_dir=%d) = %#x"%(name,target,is_dir, stat))
if not stat:
- print "Can't create symlink %s -> %s"%(name, target)
+ print("Can't create symlink %s -> %s"%(name, target))
raise ctypes.WinError()
def symlink(target, name):
@@ -101,7 +101,7 @@ else:
assert path
has_link_attr = GetFileAttributes(path) & FILE_ATTRIBUTE_REPARSE_POINT
if win32_verbose:
- print "islink(%s): attrs=%#x: %s"%(path, GetFileAttributes(path), has_link_attr != 0)
+ print("islink(%s): attrs=%#x: %s"%(path, GetFileAttributes(path), has_link_attr != 0))
return has_link_attr != 0
def DeviceIoControl(hDevice, ioControlCode, input, output):
@@ -119,7 +119,7 @@ else:
status = _DevIoCtl(hDevice, ioControlCode, input,
input_size, output, output_size, bytesReturned, None)
if win32_verbose:
- print "DeviceIOControl: status = %d" % status
+ print("DeviceIOControl: status = %d" % status)
if status != 0:
return output[:bytesReturned.value]
else:
@@ -140,7 +140,7 @@ else:
# This wouldn't return true if the file didn't exist, as far as I know.
if not islink(path):
if win32_verbose:
- print "readlink(%s): not a link."%path
+ print("readlink(%s): not a link."%path)
return None
# Open the file correctly depending on the string type.
@@ -153,7 +153,7 @@ else:
# Minimum possible length (assuming length of the target is bigger than 0)
if not buffer or len(buffer) < 9:
if win32_verbose:
- print "readlink(%s): no reparse buffer."%path
+ print("readlink(%s): no reparse buffer."%path)
return None
# Parse and return our result.
@@ -192,16 +192,16 @@ else:
start = SubstituteNameOffset + SymbolicLinkReparseSize
actualPath = buffer[start : start + SubstituteNameLength].decode("utf-16")
# This utf-16 string is null terminated
- index = actualPath.find(u"\0")
+ index = actualPath.find("\0")
if index > 0:
actualPath = actualPath[:index]
- if actualPath.startswith(u"\\??\\"): # ASCII 92, 63, 63, 92
+ if actualPath.startswith("\\??\\"): # ASCII 92, 63, 63, 92
ret = actualPath[4:] # strip off leading junk
else:
ret = actualPath
if win32_verbose:
- print "readlink(%s->%s->%s): index(null) = %d"%\
- (path,repr(actualPath),repr(ret),index)
+ print("readlink(%s->%s->%s): index(null) = %d"%\
+ (path,repr(actualPath),repr(ret),index))
return ret
def realpath(fpath):