mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Update vendored pyxdg to 0.28
This commit is contained in:
parent
aed4e9261c
commit
5073ec0c6f
7 changed files with 95 additions and 66 deletions
|
@ -749,14 +749,16 @@ def install_mime_info(application, package_file):
|
|||
file with the same name (if the contents are different)"""
|
||||
application += '.xml'
|
||||
|
||||
new_data = open(package_file).read()
|
||||
with open(package_file) as f:
|
||||
new_data = f.read()
|
||||
|
||||
# See if the file is already installed
|
||||
package_dir = os.path.join('mime', 'packages')
|
||||
resource = os.path.join(package_dir, application)
|
||||
for x in BaseDirectory.load_data_paths(resource):
|
||||
try:
|
||||
old_data = open(x).read()
|
||||
with open(x) as f:
|
||||
old_data = f.read()
|
||||
except:
|
||||
continue
|
||||
if old_data == new_data:
|
||||
|
@ -770,7 +772,8 @@ def install_mime_info(application, package_file):
|
|||
new_file = os.path.join(BaseDirectory.save_data_path(package_dir), application)
|
||||
|
||||
# Write the file...
|
||||
open(new_file, 'w').write(new_data)
|
||||
with open(new_file, 'w') as f:
|
||||
f.write(new_data)
|
||||
|
||||
# Update the database...
|
||||
command = 'update-mime-database'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue