25
25
default = "zip" ,
26
26
help = "Extension of the file that's going to be uploaded, default 'zip'" ,
27
27
)
28
+ @click .option ("--skip_conversion" , "-s" , is_flag = True , default = False , required = False , help = "Skip Conversion Engine" )
28
29
@click .pass_context
29
- def create (ctx , instance , body , filename = None , path = None , extension = "zip" ):
30
+ def create (ctx , instance , body , filename = None , path = None , extension = "zip" , skip_conversion = False ):
30
31
base_name = (
31
32
os .path .splitext (filename )[0 ]
32
33
if filename
@@ -35,7 +36,7 @@ def create(ctx, instance, body, filename=None, path=None, extension="zip"):
35
36
36
37
file_data = get_file_data (path , base_name , category = extension )
37
38
file_id = create_file (
38
- ctx .obj ["token" ], instance , body , extension , filename = filename
39
+ ctx .obj ["token" ], instance , body , extension , filename = filename , skip_conversion = skip_conversion
39
40
)
40
41
url = "/files/%d/upload-url/" % file_id
41
42
response = request ("get" , url , token = ctx .obj ["token" ])
@@ -46,13 +47,14 @@ def create(ctx, instance, body, filename=None, path=None, extension="zip"):
46
47
update_file_metadata (ctx , file_id )
47
48
48
49
49
- def create_file (token , app_id , file_body , category , filename = None ):
50
+ def create_file (token , app_id , file_body , category , filename = None , skip_conversion = False ):
50
51
payload = {
51
52
"app" : app_id ,
52
53
"body" : file_body ,
53
54
"downloadUrl" : "https://admin.pitcher.com/downloads/Pitcher%20HTML5%20Folder.zip" ,
54
55
"category" : category ,
55
56
"dont_convert" : True ,
57
+ "skip_conversion" : skip_conversion ,
56
58
}
57
59
58
60
if filename :
0 commit comments