def printAllMetadata(name): timestamps = Metadata.getProjectfileTimestamps(name) print "Project creation: \t" + str(datetime.datetime.fromtimestamp(timestamps["creation"])) print "Project last modified:\t" + str(datetime.datetime.fromtimestamp(timestamps["modification"])) for key, value in Metadata.getAnnotations(name).iteritems(): print "%s:\t\t%s" % (key, value)
def data(self, index, role): if not index.isValid(): return QVariant() elif role != Qt.DisplayRole and role != Qt.EditRole: return QVariant() project = File.allProjects(os.getcwd())[index.row()] metadatakey = Metadata.listUsedAnnotations(os.getcwd())[index.column()] annotations = Metadata.getAnnotations(project) if annotations.has_key(metadatakey): metadatavalue = annotations[metadatakey] else: metadatavalue = "<NOT SET>" return QVariant(metadatavalue)
def printMetadata(name, key): annotations = Metadata.getAnnotations(name) if annotations.has_key(key): print "%s: %s" % (key, annotations[key]) else: print "%s: %s" % (key, "<NOT SET>")