/usr/share/pyshared/dfeet/_util.py is in d-feet 0.1.14-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import os
# TODO: Check against other Unix's
def get_proc_from_pid(pid):
procpath = '/proc/' + str(pid) + '/cmdline'
fullpath = ''
try:
f = open(procpath, 'r')
fullpath = f.readline().split('\0')
f.close()
except:
pass
return fullpath
# TODO: figure out more robust way to do this
def get_ui_dir():
try:
ui_dir = os.environ['DFEET_DATA_PATH']
except:
ui_dir = "../ui"
return ui_dir
def print_method(m):
def decorator(*args):
print "call:", m,args
r = m(*args)
print "return:", r
return r
return decorator
|