summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <zilch@src.gnome.org>2003-01-21 23:59:16 +0000
committerJohan Dahlin <zilch@src.gnome.org>2003-01-21 23:59:16 +0000
commit17385959f702c0f5f36265da0cc3c1f252c1ebb9 (patch)
tree05cc547a859b111fffbe7cf9eff7183e4e21d882
parente629eefa0cc088523cf242e58dfd966f36553e41 (diff)
downloadpygobject-17385959f702c0f5f36265da0cc3c1f252c1ebb9.tar.gz
Import codegen here instead, needs to be fixed in the future though.
* dsextras.py (Template.generate): Import codegen here instead, needs to be fixed in the future though. * Makefile.am (EXTRA_DIST): Added dsextras.py
-rw-r--r--dsextras.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/dsextras.py b/dsextras.py
index 9e7e9a2c..4ef3e9ee 100644
--- a/dsextras.py
+++ b/dsextras.py
@@ -1,3 +1,9 @@
+#
+# dsextras.py - Extra classes and utilities
+#
+# TODO:
+# Make it possible to import codegen from another dir
+#
from commands import getoutput, getstatusoutput
from distutils.command.build_ext import build_ext
from distutils.command.install_lib import install_lib
@@ -7,10 +13,6 @@ import os
import string
import sys
-from codegen.override import Overrides
-from codegen.defsparser import DefsParser
-from codegen.codegen import register_types, write_source, FileOutput
-
GLOBAL_INC = []
GLOBAL_MACROS = []
@@ -140,6 +142,14 @@ class Template:
return 0
def generate(self):
+ # We must insert it first, otherwise python will try '.' first,
+ # in which it exist a "bogus" codegen (the third import line
+ # here will fail)
+ sys.path.insert(0, 'codegen')
+ from override import Overrides
+ from defsparser import DefsParser
+ from codegen import register_types, write_source, FileOutput
+
if self.check_dates():
return