30
30
31
31
32
32
class Type2Creator :
33
- def __init__ (self , recipe ):
34
- self .app_dir = recipe .AppDir .path ()
35
- self .target_arch = recipe .AppImage .arch ()
36
- self .app_name = recipe .AppDir .app_info .name ()
37
- self .app_version = recipe .AppDir .app_info .version ()
38
- self .update_information = recipe .AppImage ["update-information" ]() or "None"
33
+ def __init__ (self , appdir , target_arch , update_information , sign_key , output_filename ):
34
+ self .app_dir = appdir
35
+ self .target_arch = target_arch
36
+ self .update_information = update_information
39
37
self .guess_update_information = False
40
38
41
39
if self .update_information == "None" :
@@ -47,15 +45,11 @@ def __init__(self, recipe):
47
45
self .update_information = None
48
46
self .guess_update_information = True
49
47
50
- self .sing_key = recipe . AppImage [ "sign-key" ]() or "None"
48
+ self .sing_key = sign_key
51
49
if self .sing_key == "None" :
52
50
self .sing_key = None
53
51
54
- fallback_file_name = os .path .join (
55
- os .getcwd (),
56
- "%s-%s-%s.AppImage" % (self .app_name , self .app_version , self .target_arch ),
57
- )
58
- self .target_file = recipe .AppImage .file_name () or fallback_file_name
52
+ self .target_file = output_filename
59
53
60
54
def create (self ):
61
55
self ._assert_target_architecture ()
@@ -67,7 +61,7 @@ def create(self):
67
61
self ._generate_appimage (runtime_path )
68
62
69
63
def _generate_appimage (self , runtime_path ):
70
- appimage_tool = AppImageToolCommand (self .app_dir , self .file_name )
64
+ appimage_tool = AppImageToolCommand (self .app_dir , self .target_file )
71
65
appimage_tool .target_arch = self .target_arch
72
66
appimage_tool .update_information = self .update_information
73
67
appimage_tool .guess_update_information = self .guess_update_information
0 commit comments