Comment and clean setup.
This commit is contained in:
parent
422f9ff449
commit
d006ab1b1a
14
setup.py
14
setup.py
@ -17,6 +17,13 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
|
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
"""
|
||||||
|
Radicale setup file.
|
||||||
|
|
||||||
|
To install, type ``python setup.py install`` as superuser.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
@ -24,23 +31,29 @@ from distutils.core import setup, Command
|
|||||||
from distutils.command.build_scripts import build_scripts
|
from distutils.command.build_scripts import build_scripts
|
||||||
|
|
||||||
class BuildScripts(build_scripts):
|
class BuildScripts(build_scripts):
|
||||||
|
"""Build the package."""
|
||||||
def run(self):
|
def run(self):
|
||||||
|
"""Run building."""
|
||||||
self.mkpath(self.build_dir)
|
self.mkpath(self.build_dir)
|
||||||
for script in self.scripts:
|
for script in self.scripts:
|
||||||
root, _ = os.path.splitext(script)
|
root, _ = os.path.splitext(script)
|
||||||
self.copy_file(script, os.path.join(self.build_dir, root))
|
self.copy_file(script, os.path.join(self.build_dir, root))
|
||||||
|
|
||||||
class Clean(Command):
|
class Clean(Command):
|
||||||
|
"""Clean up package temporary files."""
|
||||||
description = "clean up package temporary files"
|
description = "clean up package temporary files"
|
||||||
user_options = []
|
user_options = []
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
|
"""Pre-processing."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
|
"""Post-processing."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
"""Run clean up."""
|
||||||
path = os.path.abspath(os.path.dirname(__file__))
|
path = os.path.abspath(os.path.dirname(__file__))
|
||||||
for pathname, _, files in os.walk(path):
|
for pathname, _, files in os.walk(path):
|
||||||
for filename in filter(self._should_remove, files):
|
for filename in filter(self._should_remove, files):
|
||||||
@ -55,6 +68,7 @@ class Clean(Command):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _should_remove(filename):
|
def _should_remove(filename):
|
||||||
|
"""Return if ``filename`` should be considered as temporary."""
|
||||||
return (os.path.splitext(filename)[1] == ".pyc" or
|
return (os.path.splitext(filename)[1] == ".pyc" or
|
||||||
os.path.splitext(filename)[1] == ".pyo" or
|
os.path.splitext(filename)[1] == ".pyo" or
|
||||||
filename.endswith("~") or
|
filename.endswith("~") or
|
||||||
|
Loading…
Reference in New Issue
Block a user