1054.1.1
by Nicolas Maître
conform to PEP394 (draft) by referring to "python2" in the shebangs since gtg is |
1 |
#!/usr/bin/env python2
|
1248.1.1
by Izidor Matušov
Updated every license in the head of files |
2 |
# -*- coding: utf-8 -*-
|
3 |
# -----------------------------------------------------------------------------
|
|
4 |
# Getting Things GNOME! - a personal organizer for the GNOME desktop
|
|
5 |
# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
|
|
6 |
#
|
|
7 |
# This program is free software: you can redistribute it and/or modify it under
|
|
8 |
# the terms of the GNU General Public License as published by the Free Software
|
|
9 |
# Foundation, either version 3 of the License, or (at your option) any later
|
|
10 |
# version.
|
|
11 |
#
|
|
12 |
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
14 |
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
15 |
# details.
|
|
16 |
#
|
|
17 |
# You should have received a copy of the GNU General Public License along with
|
|
18 |
# this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19 |
# -----------------------------------------------------------------------------
|
|
20 |
||
377.1.1
by Bertrand Rousseau
- add a script to automate profiling |
21 |
import GTG.gtg |
22 |
import cProfile |
|
23 |
import pstats |
|
24 |
from optparse import OptionParser |
|
25 |
||
26 |
parser = OptionParser() |
|
27 |
parser.add_option("-d", "--debug", |
|
508
by Luca Invernizzi
pep8ification (1957->1924) |
28 |
action="store_true", dest="debug", help="enable debug output") |
377.1.1
by Bertrand Rousseau
- add a script to automate profiling |
29 |
(options, args) = parser.parse_args() |
30 |
||
508
by Luca Invernizzi
pep8ification (1957->1924) |
31 |
cProfile.run("GTG.gtg.main(options, args)", filename="gtg.profile") |
377.1.1
by Bertrand Rousseau
- add a script to automate profiling |
32 |
|
33 |
p = pstats.Stats('gtg.profile') |
|
34 |
p.sort_stats('cumulative').print_stats(15) |
|
35 |
p.sort_stats('time').print_stats(15) |
|
508
by Luca Invernizzi
pep8ification (1957->1924) |
36 |
p.sort_stats('calls').print_stats(15) |