File: clean_syn.py

package info (click to toggle)
synopsis 0.8.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,112 kB
  • ctags: 12,996
  • sloc: cpp: 34,254; ansic: 33,620; python: 10,975; sh: 7,261; xml: 6,369; makefile: 773; asm: 445
file content (54 lines) | stat: -rw-r--r-- 1,714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# Copyright (C) 2005 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#

import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log

from distutils.command.clean import clean

class clean_syn(clean):

    def finalize_options(self):
        
        clean.finalize_options(self)
        
        build_clib = self.distribution.get_command_obj('build_clib')
        build_clib.ensure_finalized()
        self.build_ctemp = build_clib.build_ctemp

    def run(self):

        clean.run(self)

        # Remove the build/ctemp.<plat> directory (unless it's already
        # gone).
        if os.path.exists(self.build_ctemp):
            remove_tree(self.build_ctemp, dry_run=self.dry_run)

        # Remove installed clib, if installed locally.
        for d in ['include', 'lib', 'bin']:
            if os.path.exists(d):
                remove_tree(d, dry_run=self.dry_run)

        # Remove the generated documentation.
#        prefix = 'share/doc/Synopsis/html/Manual'
#        for d in ['cxx', 'python', 'sxr']:
#            if os.path.exists(os.path.join(prefix, d)):
#                remove_tree(os.path.join(prefix, d), dry_run=self.dry_run)
#
#        prefix = 'share/doc/Synopsis/html'
#        for d in ['Tutorial', 'DevGuide']:
#            if os.path.exists(os.path.join(prefix, d)):
#                remove_tree(os.path.join(prefix, d), dry_run=self.dry_run)
#
#        prefix = 'share/doc/Synopsis'
#        if os.path.exists(os.path.join(prefix, 'examples')):
#            remove_tree(os.path.join(prefix, 'examples'), dry_run=self.dry_run)