Example #1
0
    def __init__(self, cfgsetsp):
        # ~ another instance to not use ptrs
        """

        :rtype :
        """
        self.cfgsets = config_settings.CfgSettings()
Example #2
0
def reload_all():
    print '>> Bootstrapping...'
    global cfgsets, sugg, ds, mega_parall, wrp, apiresp, auth
    cfgsets = config_settings.CfgSettings()
    cfgsets.cgen['large_server'] = LARGESERVER
    sugg = SuggestionResponses(cfgsets.cfg, cfgsets.cgen)
    ds = DeepsearchModule.DeepSearch(cfgsets.cfg_deep, cfgsets.cgen)
    mega_parall = megasearch.DoParallelSearch(cfgsets.cfg, cfgsets.cgen, ds)
    wrp = Warper(cfgsets.cgen, cfgsets.cfg, ds)
    apiresp = ApiResponses(cfgsets.cfg, wrp)
    auth = miscdefs.Auth(cfgsets)
Example #3
0
def reload_all():
	print '>> Bootstrapping...'
	global cfgsets, sugg, ds, mega_parall, wrp, apiresp, auth, getsmartinfo, testserver
	cfgsets = config_settings.CfgSettings()	
	cfgsets.cgen['large_server'] = LARGESERVER
	sugg = SuggestionResponses(cfgsets.cfg, cfgsets.cgen)
	ds = DeepsearchModule.DeepSearch(cfgsets.cfg_deep, cfgsets.cgen)
	wrp = Warper (cfgsets.cgen, cfgsets.cfg, ds)
	mega_parall = megasearch.DoParallelSearch(cfgsets.cfg, cfgsets.cgen, ds, wrp)
	apiresp = ApiResponses(cfgsets.cfg, cfgsets.cgen, wrp, ds)
	getsmartinfo = nzbsanity.GetNZBInfo(cfgsets.cfg, cfgsets.cgen, ds,  app)
	auth = miscdefs.Auth(cfgsets)
	testserver = miscdefs.ChkServer(cfgsets.cgen)
Example #4
0
    def __init__(self):
        import urlparse

        cfgsets = config_settings.CfgSettings()

        self.cgen = cfgsets.cgen
        self.logsdir = SearchModule.resource_path('logs/nzbmegasearch.log')
        self.scriptsdir = SearchModule.resource_path('get_stats.sh')
        self.cfg_urlidx = []
        self.excludeurls = ['http://ftdworld.net', 'https://nzbx.co']
        if (cfgsets.cfg is not None):
            self.config = cfgsets.cfg
            for i in xrange(len(self.config)):
                if (self.config[i]['builtin'] == 0):
                    self.cfg_urlidx.append(i)
Example #5
0
        if (argv == 'daemon'):
            print '====== DAEMON MODE ======'
            miscdefs.daemonize(logsdir)

# ~ detect if started from gunicorn
oshift_dirconf = os.getenv('OPENSHIFT_DATA_DIR', '')
if (__name__ == 'mega2' and len(oshift_dirconf) == 0):
    print '====== GUNICORN + NGIX server ======'
    LARGESERVER = True

# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
cver = miscdefs.ChkVersion(DEBUGFLAG)
print '>> version: ' + str(cver.ver_notify['curver'])
motd = motd + ' v.' + str(cver.ver_notify['curver']) + ' large_server: ' + str(
    LARGESERVER) + ' debug: ' + str(DEBUGFLAG)
cfgsets = config_settings.CfgSettings()
first_time = 0
# ~ init logger
log = loginit()

if (cfgsets.cfg is None or cfgsets.cfg_deep is None):
    first_time = 1
    '>> It will be configured'

certdir = SearchModule.resource_path('certificates/')
templatedir = SearchModule.resource_path('templates')
app = Flask(__name__, template_folder=templatedir)

# ~ bootstrap
import nzbsanity