Rev 17: Shorten the key names. in lp:~jameinel/+junk/file_locking
John Arbash Meinel
john at arbash-meinel.com
Mon Sep 21 20:18:28 BST 2009
At lp:~jameinel/+junk/file_locking
------------------------------------------------------------
revno: 17
revision-id: john at arbash-meinel.com-20090921191820-9bf1bga0r9srf2ju
parent: john at arbash-meinel.com-20090921191730-wv111xgffuxh7h8c
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: file_locking
timestamp: Mon 2009-09-21 14:18:20 -0500
message:
Shorten the key names.
-------------- next part --------------
=== modified file 'file_lock.py'
--- a/file_lock.py 2009-09-21 19:17:30 +0000
+++ b/file_lock.py 2009-09-21 19:18:20 +0000
@@ -185,9 +185,9 @@
# Note that this is slightly wrong if you have a per-directory username
global_conf = _mod_config.GlobalConfig()
nonce = osutils.rand_chars(20)
- s = rio.Stanza(hostname=osutils.get_host_name(),
+ s = rio.Stanza(host=osutils.get_host_name(),
pid=str(os.getpid()),
- start_time=str(int(time.time())),
+ time=str(int(time.time())),
nonce=nonce,
user=global_conf.username(),
file_id=file_id,
=== modified file 'tests/test_file_lock.py'
--- a/tests/test_file_lock.py 2009-09-21 19:17:30 +0000
+++ b/tests/test_file_lock.py 2009-09-21 19:18:20 +0000
@@ -94,16 +94,16 @@
'active_locks: 1\n'
'\n'
'file_id: file-id-1\n'
- 'hostname: %s\n'
+ 'host: %s\n'
'nonce: %s\n'
'pid: %s\n'
- 'start_time: %s\n'
+ 'time: %s\n'
'user: %s\n'
'\n' % (s._HEADER,
- info['hostname'],
+ info['host'],
info['nonce'],
os.getpid(),
- info['start_time'],
+ info['time'],
info['user'],
), s.to_bytes(li))
info2 = li.create_lock('file-id-2')
@@ -114,28 +114,28 @@
'active_locks: 2\n'
'\n'
'file_id: file-id-1\n'
- 'hostname: %s\n'
+ 'host: %s\n'
'nonce: %s\n'
'pid: %s\n'
- 'start_time: %s\n'
+ 'time: %s\n'
'user: %s\n'
'\n'
'file_id: file-id-2\n'
- 'hostname: %s\n'
+ 'host: %s\n'
'nonce: %s\n'
'pid: %s\n'
- 'start_time: %s\n'
+ 'time: %s\n'
'user: %s\n'
'\n' % (s._HEADER,
- info['hostname'],
+ info['host'],
info['nonce'],
os.getpid(),
- info['start_time'],
+ info['time'],
info['user'],
- info2['hostname'],
+ info2['host'],
info2['nonce'],
os.getpid(),
- info2['start_time'],
+ info2['time'],
info2['user'],
), s.to_bytes(li))
More information about the bazaar-commits
mailing list