119
119
input_file.close()
121
dest_filepath = base_path + '/debian/widelands.appdata.xml'
122
dest_file = codecs.open(dest_filepath, encoding='utf-8', mode='w')
121
appdata_filepath = base_path + '/debian/widelands.appdata.xml'
122
dest_file = codecs.open(appdata_filepath, encoding='utf-8', mode='w')
123
123
dest_file.write(appdata)
124
124
dest_file.close()
136
136
input_file.close()
138
dest_filepath = base_path + '/debian/org.widelands.widelands.desktop'
139
dest_file = codecs.open(dest_filepath, encoding='utf-8', mode='w')
138
desktop_filepath = base_path + '/debian/org.widelands.widelands.desktop'
139
dest_file = codecs.open(desktop_filepath, encoding='utf-8', mode='w')
140
140
dest_file.write(desktop)
141
141
dest_file.close()
145
from subprocess import call
146
call(['appstreamcli', 'validate', base_path + '/debian/widelands.appdata.xml'])
145
from subprocess import call, Popen, PIPE
148
call(['appstreamcli', 'validate', appdata_filepath])
150
# Validate desktop file. We don't get return codes, so we have to parse it
151
process = Popen(['desktop-file-validate', desktop_filepath],
152
stderr=PIPE, stdout=PIPE, stdin=PIPE)
153
desktop_result = process.communicate()
154
if desktop_result[0] != '':
155
print(desktop_result[0])