def label(self, context): if self.desttype == "file": return "Check Coding standard of <b>%s</b>" % (os_utils.display_name(os.path.basename(self.file.name()))) elif self.desttype == "dir": return "Check Coding standard of files in <b>%s</b>" % ( os_utils.display_name(os.path.basename(os.path.dirname(self.dir))) ) elif self.desttype == "project": return "Check Coding standard of files in <b>%s</b>" % (os_utils.display_name(self.project.name())) return ""
def __contextual_label_for_gnatstub(context): """ Used to create the label for the gnatstub contextual menu. """ fmt = "Generate Body of <b>{}</b>" name = os.path.basename(context.file().path) return fmt.format(os_utils.display_name(name))
def __contextualMenuLabel(context): data = context.gnatcheck if data.desttype == "file": fmt = "Check Coding standard of <b>{}</b>" name = os.path.basename(data.file.path) elif data.desttype == "dir": fmt = "Check Coding standard of files in <b>{}</b>" name = os.path.basename(os.path.dirname(data.dir)) elif data.desttype == "project": fmt = "Check Coding standard of files in <b>{}</b>" name = data.project.name() else: return "" return fmt.format(os_utils.display_name(name))