def is_available(self, robotname): for d in util.get_robot_dirs(): fname = '%s.py' % robotname fpath = os.path.join(d, fname) if os.path.exists(fpath): return True return False
def robot_module_file(self, robot): for d in util.get_robot_dirs(): fname = '%s.py' % robot fpath = os.path.join(d, fname) if os.path.exists(fpath): return os.path.abspath(fpath) return None
def fingerprint(name): fname = '%s.py' % name rdirs = util.get_robot_dirs() for d in rdirs: pth = os.path.join(d, fname) if os.path.exists(pth): break m = hashlib.md5() for line in file(pth): m.update(line) return m.hexdigest()
def show_available(self): available = self.ui.availablerobots selected = self.ui.selectedrobots robotpaths = set() rdirs = util.get_robot_dirs() for d in rdirs: g = '%s/*.py' % d found = glob.glob(g) found = [f for f in found if conf.template not in f] robotpaths.update(found) for robotpath in robotpaths: d, filename = os.path.split(robotpath) robotname = filename[:-3] if not available.findItems(robotname, QtCore.Qt.MatchExactly): item = QtGui.QListWidgetItem(robotname, available)