0d6d4d44e7c0150a5b46baa2aa467f1d0738eadc
David Blume first commit; just disconne...

David Blume authored 8 years ago

1) #!/usr/bin/env python
2) # -*- coding: utf-8 -*-
3) #
4) # "Hello Friends" in Chinese: 朋友你好
David Blume Compatibility with Python 2.

David Blume authored 8 years ago

5) from __future__ import print_function
David Blume first commit; just disconne...

David Blume authored 8 years ago

6) import os
7) import sys
8) import time
9) from argparse import ArgumentParser
David Blume Compatibility with Python 2.

David Blume authored 8 years ago

10) import counter.counter
11) import sitesize.sitesize
David Blume first commit; just disconne...

David Blume authored 8 years ago

12) 
13) 
14) def set_v_print(verbose):
15)     """
16)     Defines the function v_print.
17)     It prints if verbose is true, otherwise, it does nothing.
18)     See: http://stackoverflow.com/questions/5980042
19)     :param verbose: A bool to determine if v_print will print its args.
20)     """
21)     global v_print
22)     if verbose:
23)         def v_print(*s):
David Blume Compatibility with Python 2.

David Blume authored 8 years ago

24)             print(' '.join([i.encode('utf8') for i in s]))
David Blume first commit; just disconne...

David Blume authored 8 years ago

25)     else:
26)         v_print = lambda *s: None
27) 
28) 
29) def main(debug):
30)     start_time = time.time()
31)     localdir = os.path.abspath(os.path.dirname(sys.argv[0]))
David Blume Compatibility with Python 2.

David Blume authored 8 years ago

32)     v_print("Running counter...")
33)     counter.counter.run()
34)     v_print("Running sitesize...")
35)     sitesize.sitesize.run()
36)     print("Done.  That took %1.2fs." % (time.time() - start_time))