docstring formatting
This commit is contained in:
parent
e262d48eec
commit
b4555e9845
|
@ -5,26 +5,20 @@ log = get_logger()
|
||||||
owners = {}
|
owners = {}
|
||||||
|
|
||||||
def reset_owners():
|
def reset_owners():
|
||||||
"""
|
""" Wipes out all file => owner associations """
|
||||||
Wipes out all file => owner associations
|
|
||||||
"""
|
|
||||||
global owners
|
global owners
|
||||||
owners = {}
|
owners = {}
|
||||||
|
|
||||||
|
|
||||||
def get_owner(f):
|
def get_owner(f):
|
||||||
"""
|
""" Get the owner id of the file 'f' """
|
||||||
Get the owner id of the file 'f'
|
|
||||||
"""
|
|
||||||
return owners[f] if f in owners else -1
|
return owners[f] if f in owners else -1
|
||||||
|
|
||||||
|
|
||||||
def add_file_owner(f,owner):
|
def add_file_owner(f,owner):
|
||||||
"""
|
""" Associate file f with owner. If owner is -1 then do we will not record
|
||||||
Associate file f with owner. If owner is -1 then do we will not record it
|
it because -1 means there is no owner. Returns True if f is being stored
|
||||||
because -1 means there is no owner. Returns True if f is being stored after
|
after the function. False otherwise. """
|
||||||
the function. False otherwise.
|
|
||||||
"""
|
|
||||||
if owner == -1: return False
|
if owner == -1: return False
|
||||||
if f in owners:
|
if f in owners:
|
||||||
if owner != owners[f]: # check for fishiness
|
if owner != owners[f]: # check for fishiness
|
||||||
|
@ -35,16 +29,12 @@ def add_file_owner(f,owner):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_owner(f):
|
def has_owner(f):
|
||||||
"""
|
""" True if f is owned by somebody. False otherwise. """
|
||||||
True if f is owned by somebody. False otherwise.
|
|
||||||
"""
|
|
||||||
return f in owners
|
return f in owners
|
||||||
|
|
||||||
def remove_file_owner(f):
|
def remove_file_owner(f):
|
||||||
"""
|
""" Try and delete any association made with file f. Returns true if
|
||||||
Try and delete any association made with file f. Returns true if the the
|
the the association was actually deleted. False otherwise. """
|
||||||
association was actually deleted. False otherwise.
|
|
||||||
"""
|
|
||||||
if f in owners:
|
if f in owners:
|
||||||
del owners[f]
|
del owners[f]
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue