File: remove_stage

package info (click to toggle)
python-parsley 1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: python: 9,897; makefile: 127
file content (28 lines) | stat: -rwxr-xr-x 389 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python
# -*- mode: python -*-
import os
import shutil


def main():

    bin_dir = os.path.dirname(os.path.realpath(__file__))
    parsley_dir = os.path.split(bin_dir)[0]
    stage_dir = os.path.join(parsley_dir, 'stage')
    if os.path.exists(stage_dir):
        print 'Removing stage dir'
        shutil.rmtree(stage_dir)

if __name__ == '__main__':
    main()