#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Profile running gaupol.main.main.
Usage: See gaupol --help.
"""
import atexit, bisect, codecs, collections, contextlib, copy, functools, \
gettext, glob, itertools, json, linecache, locale, optparse, os, pickle, \
platform, random, re, shutil, stat, string, subprocess, sys, tempfile, time, \
traceback, urllib.parse, urllib.request, webbrowser, xml.etree.ElementTree

from gi.repository import Gdk, GdkPixbuf, GdkX11, GLib, GObject, Gst, \
GstPbutils, GstVideo, Gtk, GtkSpell, Pango

file_dir = os.path.dirname(os.path.abspath(__file__))
root_dir = os.path.abspath(os.path.join(file_dir, ".."))
sys.path.insert(0, root_dir)
os.chdir(root_dir)
os.environ["GAUPOL_DEBUG"] = ""
import aeidon, gaupol, cProfile, pstats
cProfile.run("gaupol.main.main(sys.argv[1:])", "gaupol.prof")
stats = pstats.Stats("gaupol.prof")
stats.sort_stats("cumulative")
stats.print_stats("gaupol", .1)
os.remove("gaupol.prof")
