예제 #1
0
파일: setup.py 프로젝트: mattst88/portage
 def run(self):
     if not os.path.exists("doc/portage.html"):
         self.run_command("docbook")
     self.data_files = [
         (self.htmldir, glob.glob("doc/*.html")),
     ]
     install_data.run(self)
예제 #2
0
파일: setup.py 프로젝트: mattst88/portage
    def run(self):
        def re_sub_file(path, pattern, repl):
            print("Rewriting %s" % path)
            with codecs.open(path, "r", "utf-8") as f:
                data = f.read()
            data = re.sub(pattern, repl, data, flags=re.MULTILINE)
            with codecs.open(path, "w", "utf-8") as f:
                f.write(data)

        if create_entry_points:
            re_sub_file("cnf/repos.conf", r"= /", "= %(EPREFIX)s/")
            re_sub_file("cnf/make.globals", r'DIR="/', 'DIR="${EPREFIX}/')

        self.run_command("build_man")

        def process_data_files(df):
            for d, files in df:
                # substitute man sources
                if d.startswith("$mandir/"):
                    files = [os.path.join(self.build_base, v) for v in files]

                # substitute variables in path
                d = subst_vars(d, self.paths)
                yield (d, files)

        old_data_files = self.data_files
        self.data_files = process_data_files(self.data_files)

        install_data.run(self)
        self.data_files = old_data_files
예제 #3
0
    def run(self):

        # Try to build/add documentation
        try:
            cwd = os.getcwd()
            copytree('expyriment', 'documentation/sphinx/expyriment')
            os.chdir('documentation/sphinx/')
            call([sys.executable, "./create_rst_api_reference.py"])
            call([
                "sphinx-build", "-b", "html", "-d", "_build/doctrees", ".",
                "_build/html"
            ])
            os.chdir(cwd)
            self.data_files.append(
                ('share/expyriment/documentation/html',
                 glob('documentation/sphinx/_build/html/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_downloads',
                 glob('documentation/sphinx/_build/html/_downloads/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_images',
                 glob('documentation/sphinx/_build/html/_images/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_sources',
                 glob('documentation/sphinx/_build/html/_sources/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_static',
                 glob('documentation/sphinx/_build/html/_static/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_static/css',
                 glob('documentation/sphinx/_build/html/_static/css/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_static/fonts',
                 glob('documentation/sphinx/_build/html/_static/fonts/*.*')))
            self.data_files.append(
                ('share/expyriment/documentation/html/_static/js',
                 glob('documentation/sphinx/_build/html/_static/js/*.*')))
        except:
            html_created = False
            warning = "HTML documentation NOT created! (sphinx and numpydoc installed?)"
            os.chdir(cwd)

        # Install data
        install_data.run(self)

        # Clean up Sphinx folder
        rmtree("documentation/sphinx/expyriment", ignore_errors=True)
        rmtree("documentation/sphinx/_build", ignore_errors=True)
        for file_ in glob("documentation/sphinx/expyriment.*"):
            remove_file(file_)
        remove_file("documentation/sphinx/Changelog.rst")
        #remove_file("documentation/sphinx/CommandLineInterface.rst")
        remove_file("documentation/sphinx/sitemap.yml")
예제 #4
0
파일: setup.py 프로젝트: mattst88/portage
 def run(self):
     if not os.path.exists("doc/api/build/html/index.html"):
         self.run_command("apidoc")
     self.data_files = [
         (
             os.path.join(self.htmldir, "api"),
             glob.glob("doc/api/build/html/*.html") +
             glob.glob("doc/api/build/html/*.js"),
         ),
         (
             os.path.join(self.htmldir, "api/_static"),
             glob.glob("doc/api/build/html/_static/*"),
         ),
     ]
     install_data.run(self)
예제 #5
0
파일: setup.py 프로젝트: lukasHD/pyFAI
    def run(self):
        global installDir

        install_cmd = self.get_finalized_command('install')
#        self.install_dir = join(getattr(install_cmd,'install_lib'), "data")
        self.install_dir = getattr(install_cmd, 'install_lib')
        print("DATA to be installed in %s" % self.install_dir)
        installDir = os.path.join(self.install_dir, installDir)
        return install_data.run(self)
예제 #6
0
파일: setup.py 프로젝트: coquellen/pyFAI
    def run(self):
        global installDir

        install_cmd = self.get_finalized_command('install')
        #        self.install_dir = join(getattr(install_cmd,'install_lib'), "data")
        self.install_dir = getattr(install_cmd, 'install_lib')
        print("DATA to be installed in %s" % self.install_dir)
        installDir = os.path.join(self.install_dir, installDir)
        return install_data.run(self)
예제 #7
0
파일: setup.py 프로젝트: gyakovlev/portage
    def run(self):
        self.run_command("build_man")

        def process_data_files(df):
            for d, files in df:
                # substitute man sources
                if d.startswith("$mandir/"):
                    files = [os.path.join(self.build_base, v) for v in files]

                # substitute variables in path
                d = subst_vars(d, self.paths)
                yield (d, files)

        old_data_files = self.data_files
        self.data_files = process_data_files(self.data_files)

        install_data.run(self)
        self.data_files = old_data_files
예제 #8
0
파일: setup.py 프로젝트: chrplr/expyriment
    def run(self):

        # Try to build/add documentation
        try:
            cwd = os.getcwd()
            copytree('expyriment', 'documentation/sphinx/expyriment')
            os.chdir('documentation/sphinx/')
            call([sys.executable, "./create_rst_api_reference.py"])
            call(["sphinx-build", "-b", "html", "-d", "_build/doctrees", ".", "_build/html"])
            os.chdir(cwd)
            self.data_files.append(('share/expyriment/documentation/html',
                               glob('documentation/sphinx/_build/html/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_downloads',
                               glob('documentation/sphinx/_build/html/_downloads/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_images',
                               glob('documentation/sphinx/_build/html/_images/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_sources',
                               glob('documentation/sphinx/_build/html/_sources/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_static',
                               glob('documentation/sphinx/_build/html/_static/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_static/css',
                               glob('documentation/sphinx/_build/html/_static/css/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_static/fonts',
                               glob('documentation/sphinx/_build/html/_static/fonts/*.*')))
            self.data_files.append(('share/expyriment/documentation/html/_static/js',
                               glob('documentation/sphinx/_build/html/_static/js/*.*')))
        except:
            html_created = False
            warning = "HTML documentation NOT created! (sphinx and numpydoc installed?)"
            os.chdir(cwd)

        # Install data
        install_data.run(self)

        # Clean up Sphinx folder
        rmtree("documentation/sphinx/expyriment", ignore_errors=True)
        rmtree("documentation/sphinx/_build", ignore_errors=True)
        for file_ in glob("documentation/sphinx/expyriment.*"):
            remove_file(file_)
        remove_file("documentation/sphinx/Changelog.rst")
        remove_file("documentation/sphinx/CommandLineInterface.rst")
        remove_file("documentation/sphinx/sitemap.yml")
예제 #9
0
파일: setup.py 프로젝트: kif/sift_pyocl
 def run(self):
     install_cmd = self.get_finalized_command('install')
     self.install_dir = getattr(install_cmd, 'install_lib')
     print("DATA to be installed in %s" % self.install_dir)
     return install_data.run(self)
예제 #10
0
파일: setup.py 프로젝트: twguest/sift_pyocl
 def run(self):
     install_cmd = self.get_finalized_command('install')
     self.install_dir = getattr(install_cmd, 'install_lib')
     print("DATA to be installed in %s" % self.install_dir)
     return install_data.run(self)