listener/app_engine/appengine_django/__init__.py
def FindCommandsInZipfile(management_dir):
    """
    Given a path to a management directory, returns a list of all the command
    names that are available.

    This implementation also works when Django is loaded from a zip.

    Returns an empty list if no commands are defined.
    """
    zip_marker = ".zip%s" % os.sep
    if zip_marker not in management_dir:
      return FindCommandsInZipfile.orig(management_dir)

    # Django is sourced from a zipfile, ask zip module for a list of files.
    filename, path = management_dir.split(zip_marker)
    zipinfo = zipfile.ZipFile("%s.zip" % filename)

    # Add commands directory to management path.
    path = os.path.join(path, "commands")

    # The zipfile module returns paths in the format of the operating system
    # that created the zipfile! This may not match the path to the zipfile
    # itself. Convert operating system specific characters to a standard
    # character (#) to compare paths to work around this.
    path_normalise = re.compile(r"[/\\]")
    path = path_normalise.sub("#", path)
    def _IsCmd(t):
      """Returns true if t matches the criteria for a command module."""
      filename = os.path.basename(t)
      t = path_normalise.sub("#", t)
      if not t.startswith(path):
        return False
      if filename.startswith("_") or not t.endswith(".py"):
        return False
      return True

    return [os.path.basename(f)[:-3] for f in zipinfo.namelist() if _IsCmd(f)]

    Given a path to a management directory, returns a list of all the command
    names that are available.

    This implementation also works when Django is loaded from a zip.

    Returns an empty list if no commands are defined.
    
Given a path to a management directory, returns a list of all the command
names that are available.

This implementation also works when Django is loaded from a zip.

Returns an empty list if no commands are defined.
Given a path to a management directory returns a list of all the command names that are available . This implementation also works when Django is loaded from a zip . Returns an empty list if no commands are defined .
def FindCommandsInZipfile(management_dir):
    zip_marker = ".zip%s" % os.sep
    if zip_marker not in management_dir:
      return FindCommandsInZipfile.orig(management_dir)
    filename, path = management_dir.split(zip_marker)
    zipinfo = zipfile.ZipFile("%s.zip" % filename)
    path = os.path.join(path, "commands")
    path_normalise = re.compile(r"[/\\]")
    path = path_normalise.sub("#", path)
    def _IsCmd(t):
      filename = os.path.basename(t)
      t = path_normalise.sub("#", t)
      if not t.startswith(path):
        return False
      if filename.startswith("_") or not t.endswith(".py"):
        return False
      return True
    return [os.path.basename(f)[:-3] for f in zipinfo.namelist() if _IsCmd(f)]
def FindCommandsInZipfile ( management_dir ) : zip_marker = ".zip%s" % os . sep if zip_marker not in management_dir : return FindCommandsInZipfile . orig ( management_dir ) filename , path = management_dir . split ( zip_marker ) zipinfo = zipfile . ZipFile ( "%s.zip" % filename ) path = os . path . join ( path , "commands" ) path_normalise = re . compile ( r"[/\\]" ) path = path_normalise . sub ( "#" , path ) def _IsCmd ( t ) : """Returns true if t matches the criteria for a command module.""" filename = os . path . basename ( t ) t = path_normalise . sub ( "#" , t ) if not t . startswith ( path ) : return False if filename . startswith ( "_" ) or not t . endswith ( ".py" ) : return False return True return [ os . path . basename ( f ) [ : - 3 ] for f in zipinfo . namelist ( ) if _IsCmd ( f ) ]
Given a path to a management directory, returns a list of all the command
names that are available.
Given a path to a management directory returns a list of all the command names that are available .
"""
    Given a path to a management directory, returns a list of all the command
    names that are available.

    This implementation also works when Django is loaded from a zip.

    Returns an empty list if no commands are defined.
    """ # Django is sourced from a zipfile, ask zip module for a list of files. # Add commands directory to management path. # The zipfile module returns paths in the format of the operating system # that created the zipfile! This may not match the path to the zipfile # itself. Convert operating system specific characters to a standard # character (#) to compare paths to work around this. """Returns true if t matches the criteria for a command module."""
management_dir