def openTable(self, tableName): """ Open a table input from. By default, tables belong to the parents, because they have already finished executing :param tableName: Name of the table to be opened :return: :class:`remus.db.table.ReadTable` In the case of a target:: e02d038d-98a3-494a-9a27-c04b4516ced4:/submit_20120110/the_child The call:: self.openTable('input') Would open the table:: e02d038d-98a3-494a-9a27-c04b4516ced4:/submit_20120110/input Because openTable opens in the parent directory (because the parent has already completed) """ tablePath = db_join(self.__instance__, self.__tablepath__, "..", tableName) return self.__manager__._openTable(tablePath.instance, tablePath.table)
def __run__(self): tpath = db_join( self.__instance__, self.__tablepath__, "..", self.__keyTable__) self.init() src = self.__manager__._openTable(tpath.instance, tpath.table) print "src", src.getPath() for key, val in src: print key self.map(key, val)
def addFollowTarget(self, child_name, child, depends=None, chdir=None): """ A follow target is a delayed callback, that isn't run until all of a targets children have complete """ if depends is None: self.__manager__._addChild(self, child_name, child, depends=self.__tablepath__ + "@follow", chdir=chdir) else: refs = [] if isinstance(depends, str): depends = [depends] for d in depends: refs.append(db_join(self.__instance__, self.__tablepath__, d).table) self.__manager__._addChild(self, child_name, child, depends=refs, chdir=chdir)
def getcwd(self): return db_join(self.__instance__, self.__tablepath__)
def openTable(self, tableName): i = db_join(self.__instance__, tableName) print "open table:", i return self.__manager__._openTable(i.instance, i.table)
def copyFrom(self, path, srcPath): srcPath = db_join(self.__instance__, self.__tablepath__, srcPath) self.__manager__._copyFrom(path, srcPath)
def copyTo(self, path, dstPath): dstPath = db_join(self.__instance__, self.__tablepath__, dstPath) self.__manager__._copyTo(path, dstPath)
def createFile(self, dstPath, info = {}): dstPath = db_join(self.__instance__, self.__tablepath__, dstPath) self.__manager__._createFile(dstPath, info)