#coding: utf-8
import cloudfiles
import os


def collect(rule=None, container=None, dryrun=None):
    cloud = cloudfiles.get_connection(os.environ['user'], os.environ['key'])


    print  "ok"
@@ -19,27 +19,28 @@
 ort 
-cloudfiles%0Aimport o
+os%0A%0Aimport cloudfile
 s%0A%0A%0A
@@ -55,21 +55,16 @@
 ect(rule
-=None
 , contai
@@ -67,20 +67,18 @@
 ntainer=
-None
+''
 , dryrun
@@ -82,11 +82,12 @@
 run=
-Non
+Fals
 e):%0A
@@ -91,20 +91,19 @@
 ):%0A    c
-loud
+onn
  = cloud
@@ -166,21 +166,391 @@
 '%5D)%0A
-%0A%0A    print  %22ok%22
+    if container:%0A        containers = %5Bconn.get_container(container)%5D%0A    else:%0A        containers = conn.get_all_containers()%0A%0A    deleted = %5B%5D%0A    for cont in containers:%0A        for obj in cont.get_objects():%0A            if rule.apply(obj):%0A                if not dryrun:%0A                    cont.delete_object(obj.name)%0A                deleted.append(obj.name)%0A%0A    return deleted%0A%0A

Add collect function.