diff --git a/setup.py b/setup.py index 90b622ca..933f4ad8 100755 --- a/setup.py +++ b/setup.py @@ -9,15 +9,7 @@ import glob import os import sys -def import_terminator(): - from types import ModuleType - module = ModuleType('terminator') - module_file = open('terminator', 'r') - exec module_file in module.__dict__ - return module - -TERMINATOR_BUILD = True -APP_VERSION = import_terminator().APP_VERSION +from terminatorlib.version import * PO_DIR = 'po' MO_DIR = os.path.join('build', 'mo') diff --git a/terminator b/terminator index fa7aa247..a666bcb4 100755 --- a/terminator +++ b/terminator @@ -17,20 +17,21 @@ """Terminator by Chris Jones """ -# Global defines -APP_NAME = 'terminator' -APP_VERSION = '0.9' - # import standard python libs import os, platform, sys, string, time, math, subprocess from optparse import OptionParser +#import version details +from terminatorlib.version import * + try: import gettext gettext.install (APP_NAME) except: - def _ (text): + import __builtin__ + def _t (text): return text + __builtin__.__dict__['_'] = _t # import unix-lib import pwd @@ -65,10 +66,9 @@ else: try: import gobject, gtk, pango except: - if not TERMINATOR_BUILD: - err (_("You need to install the python bindings for " \ - "gobject, gtk and pango to run Terminator.")) - sys.exit(1) + err (_("You need to install the python bindings for " \ + "gobject, gtk and pango to run Terminator.")) + sys.exit(1) # import a library for viewing URLs try: diff --git a/terminatorlib/encoding.py b/terminatorlib/encoding.py index 5851b6be..014795cb 100644 --- a/terminatorlib/encoding.py +++ b/terminatorlib/encoding.py @@ -105,4 +105,4 @@ class TerminatorEncoding: def get_list(): return TerminatorEncoding.encodings get_list = staticmethod(get_list) - \ No newline at end of file + diff --git a/terminatorlib/version.py b/terminatorlib/version.py new file mode 100644 index 00000000..7dcc5486 --- /dev/null +++ b/terminatorlib/version.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# TerminatorVersion - version number +# Copyright (C) 2008 cmsj@tenshu.net +# +# 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, version 2 only. +# +# 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 + +"""TerminatorVersion by Chris Jones + +TerminatorEncoding supplies our version number. +""" + +APP_NAME='Terminator' +APP_VERSION='0.9'