Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
try:
lock_url2 = client.lock_acquire("foo", wait=3)
except RDLMException:
print "Can't acquire the lock"
print("Can't acquire the lock")

# Release the lock
result = client.lock_release(lock_url)
if not(result):
print "Can't release the lock"
print("Can't release the lock"))))

### Context Manager API

Expand Down
2 changes: 1 addition & 1 deletion lock-acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
try:
lock_url = client.lock_acquire(args.resource_name, lifetime=args.timeout,
wait=args.wait)
print lock_url
print(lock_url)
return_code = 0
except RDLMLockWaitExceededException:
sys.stderr.write("Can't acquire the lock on %s resource in %i second(s)\n" %
Expand Down
22 changes: 11 additions & 11 deletions lock-get.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import argparse
import sys
from rdlmpy import RDLMClient
from urlparse import urlparse
from urllib.parse import urlparse

parser = argparse.ArgumentParser(description='Get some informations about a lock')
parser.add_argument("lock_url", type=str, help="Lock Url (returned by lock-acquire.py)")
Expand All @@ -26,18 +26,18 @@
return_code = 3
lock = client.lock_get(args.lock_url)
if lock:
print "url: %s" % lock.url
print "timeout: %s (seconds)" % lock.lifetime
print "wait: %s (seconds)" % lock.wait
print "title: %s" % lock.title
print("url: %s" % lock.url)
print("timeout: %s (seconds)" % lock.lifetime)
print("wait: %s (seconds)" % lock.wait)
print("title: %s" % lock.title)
if lock.active:
print "state: active"
print "active_since: %s" % lock.active_since
print "active_expires: %s" % lock.active_expires
print("state: active")
print("active_since: %s" % lock.active_since)
print("active_expires: %s" % lock.active_expires)
else:
print "state: waiting"
print "wait_since: %s" % lock.wait_since
print "wait_expires: %s" % lock.wait_expires
print("state: waiting")
print("wait_since: %s" % lock.wait_since)
print("wait_expires: %s" % lock.wait_expires)
return_code = 0
else:
sys.stderr.write("Can't find the lock\n")
Expand Down
4 changes: 2 additions & 2 deletions lock-list-locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
password=args.password)
for lock in locks:
if lock.active:
print "active: %s since %s [%s]" % (lock.url, lock.active_since, lock.title)
print("active: %s since %s [%s]" % (lock.url, lock.active_since, lock.title))
else:
print "waiting: %s since %s [%s]" % (lock.url, lock.wait_since, lock.title)
print("waiting: %s since %s [%s]" % (lock.url, lock.wait_since, lock.title))
2 changes: 1 addition & 1 deletion lock-list-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

names = client.resource_get_all(args.username, args.password)
for name in names:
print name
print(name)
2 changes: 1 addition & 1 deletion pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==1.2.3
requests>=2.20.0