Updates the loaded modules by checking if they are still in sys.modules
763409
def _update_loaded_modules(self):
        
        system_modules = sys.modules.keys()
        for module in list(self.loaded_modules):
            if module not in system_modules:
                self.processed_filepaths.pop(module)
                self.loaded_modules.remove(module)
1371993
def _check_module(folder):
        
        if not folder.exists():
            folder.mkdir(parents=True, exist_ok=True, mode=0o755)
            (folder / '__init__.py').touch()
30677
def run(self):
        
        self.modnames_to_reload = []
        for modname, module in list(sys.modules.items()):
            if modname not in self.previous_modules:
                # Decide if a module can be reloaded or not
                if self.is_module_reloadable(module, modname):
                    self.modnames_to_reload.append(modname)
                    del sys.modules[modname]
                else:
                    continue

        # Report reloaded modules
        if self.verbose and self.modnames_to_reload:
            modnames = self.modnames_to_reload
            _print("\x1b[4;33m%s\x1b[24m%s\x1b[0m"\
                   % ("Reloaded modules", ": "+", ".join(modnames)))
686565
def unload_module(self, module_name):
        """"""
        module = self.loaded_modules.get(module_name)
        if not module:
            _log.warning("Ignoring request to unload non-existant module '%s'",
                         module_name)
            return False

        module.stop(reloading=False)
        del self.loaded_modules[module_name]
        self.module_ordering.remove(module_name)
        return True
1343203
def register_module(module=None):
    

    global REGISTERED_MODULES

    if module is None:
        # Note: inspect.getmodule() can return the wrong module if it has been imported with different relatives paths.
        module = sys.modules.get(inspect.currentframe().f_back.f_globals["__name__"])

    REGISTERED_MODULES.add(module)
    return True
1306094
def untrace_modules(self, modules):
        

        for module in modules:
            foundations.trace.untrace_module(module)
        self.__model__refresh_attributes()
        return True
74885
function ensure(files, options) {
    // Update the global array of represented modules
    unused = filterRepresented(unused, files, options)

    verbose.writeln('Unrepresented modules list currently at ', unused)

    // Only print message when all targets have been run
    if (++numRuns === getNumTargets()) {
      if (unused.length) {
        if (options.report) {
          log.writeln('\nPackages left out:')
          log.writeln(unused.join('\n'))
        }
      } else if (options.report) {
        log.ok('All modules have something copied.')
      }
    }
  }
243103
def module_refresh(self, force_refresh=False, notify=False):
        '''
        
        '''
        log.debug('Refreshing modules. Notify=%s', notify)
        self.functions, self.returners, _, self.executors = self._load_modules(force_refresh, notify=notify)

        self.schedule.functions = self.functions
        self.schedule.returners = self.returners
6203
def post_execute(self):
        
        newly_loaded_modules = set(sys.modules) - self.loaded_modules
        for modname in newly_loaded_modules:
            _, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])
            if pymtime is not None:
                self._reloader.modules_mtimes[modname] = pymtime

        self.loaded_modules.update(newly_loaded_modules)
697998
function(mods) {
			for (var i = 0, len = mods.length; i < len; i++) {
				if (self.get_module_status(mods[i]) !== internal.states.initialized) {
					return false;
				}
			}

			return true;
		}
999066
def update_module_types():
    
    local_url = config["local_server"]["url"]
    server = Server(local_url)
    db = server[FIRMWARE_MODULE_TYPE]
    temp_folder = mkdtemp()
    for _id in db:
        if _id.startswith("_"):
            continue
        obj = db[_id]
        new_obj = update_record(FirmwareModuleType(obj), temp_folder)
        new_obj["_rev"] = obj["_rev"]
        if new_obj != obj:
            db[_id] = new_obj
    rmtree(temp_folder)
256705
def update(self, module_name=None):
        
        if not module_name:
            return self._module.force_update()
        else:
            module_info = self._get_module_info(module_name)
            if module_info:
                module_info["module"].force_update()
1237021
def do_reload(self, args):
		""""""
		if args.module is not None:
			if args.module not in self.frmwk.modules:
				self.print_error('Invalid Module Selected.')
				return
			module = self.frmwk.modules[args.module]
		elif self.frmwk.current_module:
			module = self.frmwk.current_module
		else:
			self.print_error('Must \'use\' module first')
			return
		self.reload_module(module)
354833
public function updateModule()
	{
		$this->moduleHandle->cacheModuleConfig();	//oke
		$this->moduleHandle->setModules();	//oke
		$this->moduleHandle->updateModuleAddon();
	}
87860
async def unloadmodule(self, module, ignoreDependencies = False):
        '''
        
        '''
        self._logger.debug('Try to unload module %r', module)
        if hasattr(module, '_instance'):
            self._logger.debug('Module %r is loaded, module state is %r', module, module._instance.state)
            inst = module._instance
            if inst.state == ModuleLoadStateChanged.LOADING or inst.state == ModuleLoadStateChanged.LOADED:
                # Wait for loading
                # Wait for succeeded or failed
                sm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.SUCCEEDED)
                fm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.FAILED)
                await M_(sm, fm)
            elif inst.state == ModuleLoadStateChanged.UNLOADING or inst.state == ModuleLoadStateChanged.UNLOADED:
                um = ModuleLoadStateChanged.createMatcher(module, ModuleLoadStateChanged.UNLOADED)
                await um
        if hasattr(module, '_instance') and (module._instance.state == ModuleLoadStateChanged.SUCCEEDED or
                                             module._instance.state == ModuleLoadStateChanged.FAILED):
            self._logger.info('Unloading module %r', module)
            inst = module._instance
            # Change state to unloading to prevent more dependencies
            await inst.changestate(ModuleLoadStateChanged.UNLOADING, self)
            if not ignoreDependencies:
                deps = [d for d in inst.dependedBy if hasattr(d, '_instance') and d._instance.state != ModuleLoadStateChanged.UNLOADED]
                ums = [ModuleLoadStateChanged.createMatcher(d, ModuleLoadStateChanged.UNLOADED) for d in deps]
                for d in deps:
                    self.subroutine(self.unloadmodule(d), False)
                await self.wait_for_all(*ums)
            await inst.unload(self)
            del self.activeModules[inst.getServiceName()]
            self._logger.info('Module %r is unloaded', module)
            if not ignoreDependencies:
                for d in module.depends:
                    if hasattr(d, '_instance') and module in d._instance.dependedBy:
                        self._removeDepend(module, d)
1295977
def update_version_module(check_name, old_ver, new_ver):
    
    version_file = get_version_file(check_name)
    contents = read_file(version_file)

    contents = contents.replace(old_ver, new_ver)
    write_file(version_file, contents)
123164
def _import_modules(dir_path):
    

    def _import_module(module):
        """ Imports the specified module.
            """
        # already loaded, skip
        if module in mods_loaded:
            return False

        __import__(module)
        mods_loaded.append(module)

    mods_loaded = []

    # check if provided path exists
    if not os.path.isdir(dir_path):
        return

    try:
        # update import search path
        sys.path.insert(0, dir_path)

        # check for modules in the dir path
        for entry in os.listdir(dir_path):
            path = os.path.join(dir_path, entry)

            if os.path.isdir(path):  # directory
                _import_module(entry)

            elif _RE_PY_EXT.search(entry):  # python file
                if not _RE_INIT_PY.match(entry):  # exclude init
                    name = _RE_PY_EXT.sub('', entry)
                    _import_module(name)
    finally:
        # remove inserted path
        sys.path.pop(0)