forked from Botanical/BotanJS
jwork no celery-mode, should resolve wildcard imports
This commit is contained in:
@@ -52,6 +52,22 @@ class Resolver:
|
||||
|
||||
fx = "/".join( self.EX_CLASS + x for x in lista[:-1] )
|
||||
|
||||
# resolve wildcard A.B.*
|
||||
if c[-2:] == ".*":
|
||||
elem = self.bMap.findall( ".//" + fx + self.EX_CLASS )
|
||||
|
||||
if elem == None:
|
||||
raise LookupError( "Namespace does not exists or contains no classes: " + c )
|
||||
|
||||
c = c[0:-1]
|
||||
for cl in elem:
|
||||
cl = c + cl.attrib[ "name" ]
|
||||
|
||||
if cl not in self.resolved:
|
||||
self.__resolve( cl, classList )
|
||||
|
||||
return
|
||||
|
||||
it = lista[-1]
|
||||
# Test if class
|
||||
elem = self.bMap.find( ".//" + fx + self.EX_CLASS + it )
|
||||
|
@@ -1,17 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
from celery import Celery
|
||||
from celery.utils.log import get_task_logger
|
||||
from botanjs.compressor.closure import Wrapper as ClosureWrapper
|
||||
from botanjs.compressor.yui import Wrapper as YUIWrapper
|
||||
from botanjs.classmap import ClassMap
|
||||
|
||||
app = Celery( "botanJWork" )
|
||||
log = get_task_logger( __name__ )
|
||||
CeleryExists = True
|
||||
try:
|
||||
from celery import Celery
|
||||
except ImportError:
|
||||
CeleryExists = False
|
||||
|
||||
if os.path.exists( "settings.ini" ):
|
||||
from botanjs.config import Config
|
||||
app.conf.update( BROKER_URL = Config["BotanJS"]["CeleryBroker"] )
|
||||
if CeleryExists:
|
||||
from celery.utils.log import get_task_logger
|
||||
app = Celery( "botanJWork" )
|
||||
log = get_task_logger( __name__ )
|
||||
|
||||
if os.path.exists( "settings.ini" ):
|
||||
from botanjs.config import Config
|
||||
app.conf.update( BROKER_URL = Config["BotanJS"]["CeleryBroker"] )
|
||||
|
||||
else:
|
||||
from botanjs.dummy import app
|
||||
from botanjs.dummy import log
|
||||
|
||||
class JWork:
|
||||
|
||||
|
Reference in New Issue
Block a user