#!/usr/bin/env python3
# -*- coding: utf-8-unix -*-

# Profile running gaupol.main.main.
# Usage: See gaupol --help.

# Unless planning on lazy loading modules,
# we're not interested in profiling imports.

import atexit
import bisect
import chardet
import contextlib
import copy
import cProfile
import enchant
import functools
import gettext
import inspect
import itertools
import json
import linecache
import locale
import math
import optparse
import os
import pickle
import platform
import pstats
import random
import re
import shutil
import string
import subprocess
import sys
import tempfile
import time
import traceback
import urllib.error
import urllib.parse
import urllib.request
import webbrowser

from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Pango

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