コード例 #1
0
ファイル: tasks.py プロジェクト: OmeGak/indico
def delete_file(path):
    """Deletes a file.

    This task is meant to be invoked with a delay, i.e. like this::

        delete_file.apply_async(args=[file_path], countdown=3600)

    :param path: The absolute path to the file.
    """
    if not os.path.isabs(path):
        raise ValueError('Path is not absolute: {}'.format(path))
    Logger.get().info('Deleting {}'.format(path))
    silentremove(path)
コード例 #2
0
def delete_file(path):
    """Deletes a file.

    This task is meant to be invoked with a delay, i.e. like this::

        delete_file.apply_async(args=[file_path], countdown=3600)

    :param path: The absolute path to the file.
    """
    if not os.path.isabs(path):
        raise ValueError('Path is not absolute: {}'.format(path))
    Logger.get().info('Deleting {}'.format(path))
    silentremove(path)
コード例 #3
0
 def delete(self, key):
     path = self._getFilePath(key, False)
     if os.path.exists(path):
         silentremove(path)
     return 1
コード例 #4
0
ファイル: cache.py プロジェクト: DirkHoffmann/indico
 def delete(self, key):
     path = self._getFilePath(key, False)
     if os.path.exists(path):
         silentremove(path)
     return 1