#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-

# Copyright (C) 2013 Thomas Bechtold <thomasbechtold@jpberlin.de>

# This file is part of d-feet.

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


#import os
#gi_typelib_path = ["/usr/local/lib/d-feet/girepository-1.0",]
#if 'GI_TYPELIB_PATH' in os.environ:
#    gi_typelib_path.append(os.environ['GI_TYPELIB_PATH'])
#os.environ['GI_TYPELIB_PATH'] = ":".join(gi_typelib_path)

#ld_library_path = ["/usr/local/lib/d-feet",]
#if 'LD_LIBRARY_PATH' in os.environ:
#    ld_library_path.append(os.environ['LD_LIBRARY_PATH'])
#os.environ['LD_LIBRARY_PATH'] = ":".join(ld_library_path)

import os
import sys
sys.path.insert(1, '/usr/local/lib/python3.6/site-packages')

import gettext, locale
from gettext import gettext as _
gettext.textdomain("d-feet")
locale.textdomain("d-feet")

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GObject
from dfeet.application import DFeetApp


if __name__ == "__main__":
    data_dir = "/usr/local/share/d-feet"
    #use local paths when debugging
    if os.getenv("DFEET_DEBUG") is not None:
        data_dir = os.path.join(os.path.dirname(__file__), "..", "data")
        Gtk.IconTheme.get_default().prepend_search_path(
            os.path.join(os.path.dirname(__file__), "..", "data", "icons"))
    #start the application
    app = DFeetApp(package="d-feet", version="0.3.14", data_dir=data_dir)
    sys.exit(app.run(sys.argv))
