MobileBlur

Diff
Login

Differences From Artifact [9bbb533900]:

To Artifact [d331c61dda]:


62
63
64
65
66
67
68
69


70
71
72
73




74
75
76
77
78
79
80
62
63
64
65
66
67
68

69
70
71
72
73

74
75
76
77
78
79
80
81
82
83
84







-
+
+



-
+
+
+
+








    def begin(self):
        """
        Many imports can be made for a single import statement. This method
        help the management of this aspect.
        """

    def __call__(self, name, globals={}, locals={}, fromlist=[], level=-1):
    def __call__(self, name, globals=None, locals=None,
		 fromlist=None, level=-1):
        """
        The import method itself.
        """
        return _STANDARD_PYTHON_IMPORTER(name, globals, locals, fromlist,
        return _STANDARD_PYTHON_IMPORTER(name,
					 globals,
					 locals,
					 fromlist,
                                         level)

    def end(self):
        """
        Needed for clean up.
        """

93
94
95
96
97
98
99
100


101
102
103
104




105

106
107
108
109
110
111
112
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121







-
+
+




+
+
+
+
-
+







        # Avoid reloading cause by file modifications of reload:
        self._tl = threading.local()
        self._tl._modules_loaded = None

    def begin(self):
        self._tl._modules_loaded = set()

    def __call__(self, name, globals={}, locals={}, fromlist=[], level=-1):
    def __call__(self, name, globals=None, locals=None,
		 fromlist=None, level=-1):
        """
        The import method itself.
        """

	globals = globals or {}
	locals = locals or {}
	fromlist = fromlist or []

        call_begin_end = self._tl._modules_loaded == None
        call_begin_end = self._tl._modules_loaded is None
        if call_begin_end:
            self.begin()

	try:
            self._tl.globals = globals
            self._tl.locals = locals
            self._tl.level = level
238
239
240
241
242
243
244
245


246
247
248
249




250
251
252
253
254
255
256
247
248
249
250
251
252
253

254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270







-
+
+




+
+
+
+







        """

        if file_path.startswith(self.__web2py_path_os_path_sep):
            file_path = file_path[self.__web2py_path_os_path_sep_len:]
            return self.__RE_APP_DIR.match(file_path)
        return False

    def __call__(self, name, globals={}, locals={}, fromlist=[], level=-1):
    def __call__(self, name, globals=None, locals=None,
		 fromlist=None, level=-1):
        """
        The import method itself.
        """

	globals = globals or {}
	locals = locals or {}
	fromlist = fromlist or []

        self.begin()
        #try:
        # if not relative and not from applications:
        if not name.startswith(".") and level <= 0 \
                    and not name.startswith("applications.") \
                    and isinstance(globals, dict):
            # Get the name of the file do the import
304
305
306
307
308
309
310
311


318
319
320
321
322
323
324
325
326
327








+
+
            prefix += "." + name
        return result

class _Web2pyDateTrackerImporter(_Web2pyImporter, _DateTrackerImporter):
    """
    Like _Web2pyImporter but using a _DateTrackerImporter.
    """