def package_source(self): """ :returns: this subcommand's source. :rtype: str """ source_path = os.path.join(self._dir(), 'source') return util.read_file(source_path)
def package_version(self): """ :returns: this subcommand's version. :rtype: str """ version_path = os.path.join(self._dir(), 'version') return util.read_file(version_path)
def package_revision(self): """ :returns: this subcommand's version. :rtype: str """ version_path = os.path.join(self._dir(), 'version') return util.read_file(version_path)
def package_revision(self): """ :returns: this subcommand's revision. :rtype: str """ revision_path = os.path.join(self._dir(), "version") return util.read_file(revision_path)
def _data(self, path): """Returns the content of the supplied file, relative to the base path. :param path: The relative path to the file to read :type path: str :returns: File content of the supplied path :rtype: str """ full_path = os.path.join(self.path, path) return util.read_file(full_path)
def _data(self, revision, name): """Returns the content of the file named `name` in the directory named `revision` :param revision: the package revision :type revision: str :param name: file name :type name: str :returns: File content of the supplied path :rtype: str """ path = os.path.join(revision, name) full_path = os.path.join(self.path, path) return util.read_file(full_path)