def get_file_type(filename): get = FileInfo(('pfileinfo','-v','0', 'type','--type-only',property_name,filename)) result = get.run() if result != 0: return None result = get.get_stdout_msg() if len(result) and result[-1] == '\n': result = result[:-1] return result
def get_file_type(filename): get = FileInfo(('pfileinfo', '-v', '0', 'type', '--type-only', property_name, filename)) result = get.run() if result != 0: return None result = get.get_stdout_msg() if len(result) and result[-1] == '\n': result = result[:-1] return result
def get_file_property(filename, property_name): get = FileInfo(('pfileinfo','-v','0', 'get','--value-only',property_name,filename)) try: result = get.run() except ECommand: return None if result != 0: return None result = get.get_stdout_msg() if len(result) and result[-1] == '\n': result = result[:-1] return result
def get_file_property(filename, property_name): get = FileInfo(('pfileinfo', '-v', '0', 'get', '--value-only', property_name, filename)) try: result = get.run() except ECommand: return None if result != 0: return None result = get.get_stdout_msg() if len(result) and result[-1] == '\n': result = result[:-1] return result
def set_file_property(filename, property_name, property_value): set = FileInfo(('pfileinfo','-v','0', 'set',property_name,property_value,filename,filename)) result = set.run() return result
def set_file_property(filename, property_name, property_value): set = FileInfo(('pfileinfo', '-v', '0', 'set', property_name, property_value, filename, filename)) result = set.run() return result