def skip_ignored_dirs(*args, **kwargs): """ Replacement for devappserver2.watchter_common.skip_ignored_dirs - to be monkeypatched into place. """ # Note that this function modifies the `dirs` list in place, it doesn't return anything. # Also note that `dirs` is a list of dir *names* not dir *paths*, which means that we can't # differentiate between /foo/bar and /moo/bar because we just get 'bar'. But allowing that # would require a whole load more monkey patching. from djangae import sandbox from google.appengine.tools.devappserver2 import watcher_common # since version 1.9.49 (which is incorrectly marked as [0, 0, 0] for now, until # https://code.google.com/p/googleappengine/issues/detail?id=13439 will be fixed, # skip_ignored_dirs have three arguments instead of one. To preserve # backwards compatibilty we check version here and use args to fetch one # or three arguments depending on version. We do not do any further error handling # here to make sure that this explicitly fail if there is another change in # the number of arguments with new SDK versions. current_version = _VersionList(GetVersionObject()['release']) if current_version == sandbox.TEMP_1_9_49_VERSION_NO: current_version = _VersionList('1.9.49') if current_version >= _VersionList('1.9.49'): dirpath, dirs, skip_files_re = args else: dirs = args[0] watcher_common._remove_pred(dirs, lambda d: d.startswith(watcher_common._IGNORED_PREFIX)) watcher_common._remove_pred( dirs, lambda d: any(regex.search(d) for regex in DJANGAE_RUNSERVER_IGNORED_DIR_REGEXES) )
def skip_ignored_dirs(*args, **kwargs): """ Replacement for devappserver2.watchter_common.skip_ignored_dirs - to be monkeypatched into place. """ # Note that this function modifies the `dirs` list in place, it doesn't return anything. # Also note that `dirs` is a list of dir *names* not dir *paths*, which means that we can't # differentiate between /foo/bar and /moo/bar because we just get 'bar'. But allowing that # would require a whole load more monkey patching. from djangae import sandbox from google.appengine.tools.devappserver2 import watcher_common # since version 1.9.49 (which is incorrectly marked as [0, 0, 0] for now, until # https://code.google.com/p/googleappengine/issues/detail?id=13439 will be fixed, # skip_ignored_dirs have three arguments instead of one. To preserve # backwards compatibilty we check version here and use args to fetch one # or three arguments depending on version. We do not do any further error handling # here to make sure that this explicitly fail if there is another change in # the number of arguments with new SDK versions. current_version = _VersionList(GetVersionObject()['release']) if current_version == sandbox.TEMP_1_9_49_VERSION_NO: current_version = _VersionList('1.9.49') if current_version >= _VersionList('1.9.49'): dirpath, dirs, skip_files_re = args else: dirs = args[0] watcher_common._remove_pred(dirs, lambda d: d.startswith(watcher_common._IGNORED_PREFIX)) watcher_common._remove_pred( dirs, lambda d: any(regex.search(d) for regex in DJANGAE_RUNSERVER_IGNORED_DIR_REGEXES) )
def skip_ignored_dirs(dirs): """ Replacement for devappserver2.watchter_common.skip_ignored_dirs - to be monkeypatched into place. """ # Note that this function modifies the `dirs` list in place, it doesn't return anything. # Also note that `dirs` is a list of dir *names* not dir *paths*, which means that we can't # differentiate between /foo/bar and /moo/bar because we just get 'bar'. But allowing that # would require a whole load more monkey patching. from google.appengine.tools.devappserver2 import watcher_common watcher_common._remove_pred(dirs, lambda d: d.startswith(watcher_common._IGNORED_PREFIX)) watcher_common._remove_pred( dirs, lambda d: any(regex.search(d) for regex in DJANGAE_RUNSERVER_IGNORED_DIR_REGEXES) )
def skip_ignored_dirs(dirs): """ Replacement for devappserver2.watchter_common.skip_ignored_dirs - to be monkeypatched into place. """ # Note that this function modifies the `dirs` list in place, it doesn't return anything. # Also note that `dirs` is a list of dir *names* not dir *paths*, which means that we can't # differentiate between /foo/bar and /moo/bar because we just get 'bar'. But allowing that # would require a whole load more monkey patching. from google.appengine.tools.devappserver2 import watcher_common watcher_common._remove_pred(dirs, lambda d: d.startswith(watcher_common._IGNORED_PREFIX)) watcher_common._remove_pred( dirs, lambda d: any(regex.search(d) for regex in DJANGAE_RUNSERVER_IGNORED_DIR_REGEXES) )