diff options
| author | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 05:45:15 +0100 | 
|---|---|---|
| committer | Philipp Hagemeister <phihag@phihag.de> | 2014-01-07 05:45:15 +0100 | 
| commit | ad848315378eb5eaf7f2a2b6e007653da16c0a46 (patch) | |
| tree | aedd40bc29e3d7929f88007cf13b35ef8004b7cb | |
| parent | 5f263296eaa72ddca232d734a2625bcd85771908 (diff) | |
[xattr] Coding style
| -rw-r--r-- | youtube_dl/PostProcessor.py | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/youtube_dl/PostProcessor.py b/youtube_dl/PostProcessor.py index 481c07a94..617a17ba9 100644 --- a/youtube_dl/PostProcessor.py +++ b/youtube_dl/PostProcessor.py @@ -523,6 +523,7 @@ class FFmpegMergerPP(FFmpegPostProcessor):          self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args)          return True, info +  class XAttrMetadataPP(PostProcessor):      # @@ -602,9 +603,9 @@ class XAttrMetadataPP(PostProcessor):                      assert(path.find(":") < 0)                      assert(os.path.exists(path)) -                    f = open(path+":"+key, "w") -                    f.write(value) -                    f.close() +                    ads_fn = path + ":" + key +                    with open(ads_fn, "w") as f: +                        f.write(value)          # Write the metadata to the file's xattrs          self._downloader.to_screen('[metadata] Writing metadata to file\'s xattrs...') @@ -613,13 +614,13 @@ class XAttrMetadataPP(PostProcessor):          try:              xattr_mapping = { -                'user.xdg.referrer.url':       'webpage_url', +                'user.xdg.referrer.url': 'webpage_url',                  # 'user.xdg.comment':            'description', -                'user.dublincore.title':       'title', -                'user.dublincore.date':        'upload_date', +                'user.dublincore.title': 'title', +                'user.dublincore.date': 'upload_date',                  'user.dublincore.description': 'description',                  'user.dublincore.contributor': 'uploader', -                'user.dublincore.format':      'format', +                'user.dublincore.format': 'format',              }              for xattrname, infoname in xattr_mapping.items(): | 
