Fix of issue 3007.
svn: r12619
This commit is contained in:
parent
9b5749fc8e
commit
ccf9f5b311
@ -1068,15 +1068,17 @@ def find_revisions(name):
|
|||||||
|
|
||||||
def find_locker_name(dirpath):
|
def find_locker_name(dirpath):
|
||||||
"""
|
"""
|
||||||
Opens the lock file if it exists, reads the contexts and returns
|
Opens the lock file if it exists, reads the contexts which is "USERNAME"
|
||||||
the contents, which should be like "Locked by USERNAME".
|
and returns the contents, with correct string before "USERNAME",
|
||||||
|
so the message can be printed with correct locale.
|
||||||
If a file is encountered with errors, we return 'Unknown'
|
If a file is encountered with errors, we return 'Unknown'
|
||||||
This data is displayed in the time column of the manager
|
This data is displayed in the time column of the manager
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
fname = os.path.join(dirpath, "lock")
|
fname = os.path.join(dirpath, "lock")
|
||||||
ifile = open(fname)
|
ifile = open(fname)
|
||||||
last = ifile.read().strip()
|
username = ifile.read().strip()
|
||||||
|
last = _("Locked by %s") % username
|
||||||
ifile.close()
|
ifile.close()
|
||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
last = _("Unknown")
|
last = _("Unknown")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user