Exemplo n.º 1
0
 def clean(self, scm, dist):
     term.green("Removing bytecode files...")
     for filename in shell.dirs('.', '__pycache__'):
         shell.rm_rf(filename)
     for filename in shell.files('.', '*.py[co]'):
         shell.rm(filename)
     for filename in shell.files('.', '*$py.class'):
         shell.rm(filename)
Exemplo n.º 2
0
 def clean(self, scm, dist):
     term.green("Removing bytecode files...")
     for filename in shell.dirs('.', '__pycache__'):
         shell.rm_rf(filename)
     for filename in shell.files('.', '*.py[co]'):
         shell.rm(filename)
     for filename in shell.files('.', '*$py.class'):
         shell.rm(filename)
Exemplo n.º 3
0
    def clean(self, scm, dist):
        term.green("Removing python byte code...")
        for name in shell.dirs('.', '__pycache__'):
            shell.rm_rf(name)
        for name in shell.files('.', '*.py[co]'):
            shell.rm(name)

        term.green("Removing c extensions...")
        for name in shell.files('.', '*.so'):
            shell.rm(name)
        for name in shell.files('.', '*.pyd'):
            shell.rm(name)

        shell.rm_rf(self.dirs['build'])
Exemplo n.º 4
0
    def clean(self, scm, dist):
        term.green("Removing python byte code...")
        for name in shell.dirs('.', '__pycache__'):
            shell.rm_rf(name)
        for name in shell.files('.', '*.py[co]'):
            shell.rm(name)
        for name in shell.files('.', '*$py.class'):
            shell.rm(name)

        term.green("Removing c extensions...")
        for name in shell.files('.', '*.so'):
            shell.rm(name)
        for name in shell.files('.', '*.pyd'):
            shell.rm(name)

        shell.rm_rf(self.dirs['build'])
Exemplo n.º 5
0
Arquivo: make.py Projeto: ndparker/tdi
    def clean(self, scm, dist):
        term.green("Removing python byte code...")
        for name in shell.dirs(".", "__pycache__"):
            shell.rm_rf(name)
        for name in shell.files(".", "*.py[co]"):
            shell.rm(name)
        for name in shell.files(".", "*$py.class"):
            shell.rm(name)

        term.green("Removing c extensions...")
        for name in shell.files(".", "*.so"):
            shell.rm(name)
        for name in shell.files(".", "*.pyd"):
            shell.rm(name)

        shell.rm_rf(self.dirs["build"])
Exemplo n.º 6
0
Arquivo: make.py Projeto: ndparker/wtf
 def clean(self, scm, dist):
     if scm:
         term.green("Removing userdocs...")
         shell.rm_rf(self.dirs['userdoc'])
     shell.rm_rf(self.dirs['userdoc_build'])
Exemplo n.º 7
0
Arquivo: make.py Projeto: ndparker/wtf
 def clean(self, scm, dist):
     if scm:
         term.green("Removing apidocs...")
         shell.rm_rf(self.dirs['apidoc'])
Exemplo n.º 8
0
Arquivo: make.py Projeto: ndparker/wtf
 def clean(self, scm, dist):
     term.green("Removing coverage files...")
     shell.rm_rf(self.dirs['coverage'])
     shell.rm('.coverage')
Exemplo n.º 9
0
 def clean(self, scm, dist):
     if scm:
         term.green("Removing website...")
         shell.rm_rf(self.dirs['website'])
     shell.rm_rf(self.dirs['_website'])
Exemplo n.º 10
0
    def run(self):
        from _setup.util import SafeConfigParser as parser
        parser = parser()
        parser.read('package.cfg', **cfgread)
        strversion = parser.get('package', 'version.number')
        shortversion = tuple(map(int, strversion.split('.')[:2]))

        shell.rm_rf(self.dirs['_website'])
        shell.cp_r(self.dirs['userdoc_source'],
                   _os.path.join(self.dirs['_website'], 'src'))
        shell.rm_rf(_os.path.join(self.dirs['_website'], 'build'))
        shell.rm_rf(self.dirs['website'])
        _os.makedirs(self.dirs['website'])
        filename = _os.path.join(self.dirs['_website'], 'src',
                                 'website_download.txt')
        fp = textopen(filename)
        try:
            download = fp.read()
        finally:
            fp.close()
        filename = _os.path.join(self.dirs['_website'], 'src', 'index.txt')
        fp = textopen(filename)
        try:
            indexlines = fp.readlines()
        finally:
            fp.close()

        fp = textopen(filename, 'w')
        try:
            for line in indexlines:
                if line.startswith('.. placeholder: Download'):
                    line = download
                fp.write(line)
        finally:
            fp.close()

        shell.cp_r(
            self.dirs['apidoc'],
            _os.path.join(self.dirs['website'], 'doc-%d.%d' % shortversion))
        shell.cp_r(
            self.dirs['apidoc'],
            _os.path.join(self.dirs['_website'], 'src',
                          'doc-%d.%d' % shortversion))
        fp = textopen(_os.path.join(self.dirs['_website'], 'src', 'conf.py'),
                      'a')
        try:
            fp.write("\nepydoc = dict(rcssmin=%r)\n" % (_os.path.join(
                shell.native(self.dirs['_website']),
                "src",
                "doc-%d.%d" % shortversion,
            ), ))
            fp.write("\nexclude_trees.append(%r)\n" % "doc-%d.%d" %
                     shortversion)
        finally:
            fp.close()
        from _setup.dev import userdoc
        userdoc.sphinx(
            build=shell.native(_os.path.join(self.dirs['_website'], 'build')),
            source=shell.native(_os.path.join(self.dirs['_website'], 'src')),
            target=shell.native(self.dirs['website']),
        )
        shell.rm(_os.path.join(self.dirs['website'], '.buildinfo'))
Exemplo n.º 11
0
 def clean(self, scm, dist):
     if scm:
         term.green("Removing userdocs...")
         shell.rm_rf(self.dirs['userdoc'])
     shell.rm_rf(self.dirs['userdoc_build'])
Exemplo n.º 12
0
 def clean(self, scm, dist):
     if scm:
         term.green("Removing apidocs...")
         shell.rm_rf(self.dirs['apidoc'])
Exemplo n.º 13
0
Arquivo: make.py Projeto: ndparker/wtf
    def run(self):
        from _setup.util import SafeConfigParser as parser
        parser = parser()
        parser.read('package.cfg', **cfgread)
        strversion = parser.get('package', 'version.number')
        shortversion = tuple(map(int, strversion.split('.')[:2]))

        shell.rm_rf(self.dirs['_website'])
        shell.cp_r(
            self.dirs['userdoc_source'],
            _os.path.join(self.dirs['_website'], 'src')
        )
        shell.rm_rf(_os.path.join(self.dirs['_website'], 'build'))
        shell.rm_rf(self.dirs['website'])
        _os.makedirs(self.dirs['website'])
        filename = _os.path.join(
            self.dirs['_website'], 'src', 'website_download.txt'
        )
        fp = textopen(filename)
        try:
            download = fp.read()
        finally:
            fp.close()
        filename = _os.path.join(self.dirs['_website'], 'src', 'index.txt')
        fp = textopen(filename)
        try:
            indexlines = fp.readlines()
        finally:
            fp.close()

        fp = textopen(filename, 'w')
        try:
            for line in indexlines:
                if line.startswith('.. placeholder: Download'):
                    line = download
                fp.write(line)
        finally:
            fp.close()

        shell.cp_r(
            self.dirs['apidoc'],
            _os.path.join(self.dirs['website'], 'doc-%d.%d' % shortversion)
        )
        shell.cp_r(
            self.dirs['apidoc'],
            _os.path.join(
                self.dirs['_website'], 'src', 'doc-%d.%d' % shortversion
            )
        )
        fp = textopen(_os.path.join(
            self.dirs['_website'], 'src', 'conf.py'
        ), 'a')
        try:
            fp.write("\nepydoc = dict(wtf=%r)\n" % (
                _os.path.join(
                    shell.native(self.dirs['_website']),
                    "src",
                    "doc-%d.%d" % shortversion,
                ),
            ))
            fp.write("\nexclude_trees.append(%r)\n" %
                "doc-%d.%d" % shortversion
            )
        finally:
            fp.close()
        from _setup.dev import userdoc
        userdoc.sphinx(
            build=shell.native(_os.path.join(self.dirs['_website'], 'build')),
            source=shell.native(_os.path.join(self.dirs['_website'], 'src')),
            target=shell.native(self.dirs['website']),
        )
        shell.rm(_os.path.join(self.dirs['website'], '.buildinfo'))
Exemplo n.º 14
0
 def clean(self, scm, dist):
     _term.green("Removing dist files...")
     _shell.rm_rf(self._dist)
Exemplo n.º 15
0
Arquivo: make.py Projeto: ndparker/tdi
    def run(self):
        from _setup.util import SafeConfigParser as parser

        parser = parser()
        parser.read("package.cfg", **cfgread)
        strversion = parser.get("package", "version.number")
        shortversion = tuple(map(int, strversion.split(".")[:2]))

        shell.rm_rf(self.dirs["_website"])
        shell.cp_r(self.dirs["userdoc_source"], _os.path.join(self.dirs["_website"], "src"))
        for filename in shell.files(_os.path.join(self.dirs["_website"], "src"), "*.txt"):
            fp = textopen(filename, "r")
            try:
                content = fp.read().replace("../examples/", "examples/")
            finally:
                fp.close()
            fp = textopen(filename, "w")
            try:
                fp.write(content)
            finally:
                fp.close()

        shell.cp_r(self.dirs["examples"], _os.path.join(self.dirs["_website"], "src", "examples"))
        shell.rm_rf(_os.path.join(self.dirs["_website"], "build"))
        shell.rm_rf(self.dirs["website"])
        _os.makedirs(self.dirs["website"])
        filename = _os.path.join(self.dirs["_website"], "src", "website_download.txt")
        fp = textopen(filename)
        try:
            download = fp.read()
        finally:
            fp.close()
        filename = _os.path.join(self.dirs["_website"], "src", "index.txt")
        fp = textopen(filename)
        try:
            indexlines = fp.readlines()
        finally:
            fp.close()

        fp = textopen(filename, "w")
        try:
            for line in indexlines:
                if line.startswith(".. placeholder: Download"):
                    line = download
                fp.write(line)
        finally:
            fp.close()

        shell.cp_r(self.dirs["examples"], _os.path.join(self.dirs["website"], "examples"))
        for top, dirs, _ in shell.walk(_os.path.join(self.dirs["website"], "examples")):
            if ".svn" in dirs:
                dirs.remove(".svn")
                shell.rm_rf(_os.path.join(top, ".svn"))
            if ".git" in dirs:
                dirs.remove(".git")
                shell.rm_rf(_os.path.join(top, ".git"))

        shell.cp_r(self.dirs["apidoc"], _os.path.join(self.dirs["website"], "doc-%d.%d" % shortversion))
        shell.cp_r(self.dirs["apidoc"], _os.path.join(self.dirs["_website"], "src", "doc-%d.%d" % shortversion))
        fp = textopen(_os.path.join(self.dirs["_website"], "src", "conf.py"), "a")
        try:
            fp.write(
                "\nepydoc = dict(tdi=%r)\n"
                % (_os.path.join(shell.native(self.dirs["_website"]), "src", "doc-%d.%d" % shortversion),)
            )
            fp.write("\nexclude_trees.append(%r)\n" % "doc-%d.%d" % shortversion)
            fp.write("\nexclude_trees.append('examples')\n")
        finally:
            fp.close()
        from _setup.dev import userdoc

        userdoc.sphinx(
            build=shell.native(_os.path.join(self.dirs["_website"], "build")),
            source=shell.native(_os.path.join(self.dirs["_website"], "src")),
            target=shell.native(self.dirs["website"]),
        )
        shell.rm(_os.path.join(self.dirs["website"], ".buildinfo"))
        fp = open(_os.path.join(self.dirs["website"], "examples", ".htaccess"), "wb")
        try:
            fp.write("Options -Indexes\n")
            fp.write("<Files *.py>\n")
            fp.write("ForceType text/plain\n")
            fp.write("</Files>\n")
            fp.write("<Files *.out>\n")
            fp.write("ForceType text/plain\n")
            fp.write("</Files>\n")
        finally:
            fp.close()
Exemplo n.º 16
0
 def clean(self, scm, dist):
     term.green("Removing coverage files...")
     shell.rm_rf(self.dirs['coverage'])
     shell.rm('.coverage')
     shell.rm_rf('.tox')
     shell.rm_rf('.cache')
Exemplo n.º 17
0
 def clean(self, scm, dist):
     _term.green("Removing dist files...")
     _shell.rm_rf(self._dist)
Exemplo n.º 18
0
Arquivo: make.py Projeto: ndparker/wtf
 def clean(self, scm, dist):
     if scm:
         term.green("Removing website...")
         shell.rm_rf(self.dirs['website'])
     shell.rm_rf(self.dirs['_website'])
Exemplo n.º 19
0
Arquivo: make.py Projeto: ndparker/tdi
 def clean(self, scm, dist):
     term.green("Removing dist files...")
     shell.rm_rf(self.dirs["dist"])