#!/usr/local/bin/python2.7
# -*- coding: utf-8 -*-

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

# This file is part of d-feet.

# D-Feet 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 3 of the License, or
# (at your option) any later version.

# D-Feet 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 D-Feet.  If not, see <http://www.gnu.org/licenses/>.


#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/python2.7/site-packages')

import gettext
from gettext import gettext as _
gettext.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.8", data_dir=data_dir)
    sys.exit(app.run(sys.argv))
