tests/readlink.py
author Kevin Bullock <kbullock@ringworld.org>
Wed, 16 Nov 2011 15:29:57 -0600
changeset 15621 013688350c7d
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
bookmarks: update and updatecurrentbookmark return status This makes bookmarks.update() and bookmarks.updatecurrentbookmark() return True or False to indicate whether the bookmark was updated or not. This allows callers to e.g. abort if the update failed.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)