#!/usr/bin/env python
#
# Copyright (c) 2002 Juri Pakaste
# You may use and distribute this software under the terms of the
# GNU General Public License, version 2 or later
#

import signal
import os
import sys
import time
import pygtk
pygtk.require("2.0")

def find_straw_lib():
    if os.environ.has_key("STRAW_LIB"):
        return os.environ["STRAW_LIB"]
    for d in sys.path:
        sd = os.path.join(d, 'straw')
        if os.path.isdir(sd):
            return sd
    h, t = os.path.split(os.path.split(os.path.abspath(sys.argv[0]))[0])
    if t == 'bin':
        libdir = os.path.join(h, 'lib')
        fp = os.path.join(libdir, 'straw')
        if os.path.isdir(fp):
            return libdir
    raise "FileNotFoundError", "couldn't find straw library dir"

sys.path.insert(0, find_straw_lib())

import straw

signal.signal(signal.SIGINT, signal.SIG_DFL)
s = straw.Main()
s.mainloop()
