{"action":"created","comment":{"url":"https://api.github.com/repos/SFTtech/openage/pulls/comments/65100820","id":65100820,"diff_hunk":"@@ -222,18 +223,55 @@ def convert_metadata(args):\n             player_palette.save_visualization(outfile)\n \n \n+def extract_mediafiles_names_map(files_to_convert, args):\n+    \"\"\" Gets names from the *.bin files, make them lowercase \"\"\"\n+    if GameVersion.age2_fe in args.game_versions:\n+        suffix = '.bina'\n+    else:\n+        suffix = '.bin'\n+\n+    names_map = dict()\n+\n+    for filepath in files_to_convert:\n+        filename = b'/'.join(filepath.parts).decode()\n+        if filename.endswith(suffix):\n+            try:\n+                for line in filepath.open():\n+                    match = re.match(r\"\\w+_files\\s+(\\w+)\\s+\\w+\\s+(\\w+)\", line)\n+                    if match:\n+                        groups = match.group(2, 1)\n+                        names_map[groups[0]] = groups[1].lower()\n+            except UnicodeDecodeError:\n+                # assume that the file is binary and ignore it\n+                continue\n+\n+    return names_map\n+\n+\n+def slp_rename(filename, names_map):\n+    \"\"\" Returns a human-readable name if it's in the map \"\"\"\n+    try:\n+        dirname_basename = re.match(r\"^(.*/)(\\d+)\\.slp$\", filename).group(1, 2)\n+        return dirname_basename[0] + names_map[dirname_basename[1]] + \".slp\"\n+    except KeyError:\n+        return filename\n+\n+\n def convert_media(args):\n     \"\"\" Converts the media part \"\"\"\n-    ignored_suffixes = set()\n+    ignored = set()\n     if args.flag(\"no_sounds\"):\n-        ignored_suffixes.add('.wav')\n+        ignored.add((None, '.wav'))\n     if args.flag(\"no_graphics\"):\n-        ignored_suffixes.add('.slp')\n+        ignored.update([('graphics', '.slp'), ('terrain', '.slp')])\n+    if args.flag(\"no_interface\"):\n+        ignored.add(('interface', '.slp'))\n \n     files_to_convert = []\n     for dirname in ['sounds', 'graphics', 'terrain', 'interface']:\n         for filepath in args.srcdir[dirname].iterdir():\n-            if filepath.suffix in ignored_suffixes:\n+            if (((None, filepath.suffix) in ignored) or\n+                    ((filepath.parts[0].decode(), filepath.suffix) in ignored)):","path":"openage/convert/driver.py","position":64,"original_position":64,"commit_id":"2d75017c10b0208887b7bc95b79f7dd64e9cb019","original_commit_id":"2d75017c10b0208887b7bc95b79f7dd64e9cb019","user":{"login":"TheJJ","id":673543,"avatar_url":"https://avatars.githubusercontent.com/u/673543?v=3","gravatar_id":"","url":"https://api.github.com/users/TheJJ","html_url":"https://github.com/TheJJ","followers_url":"https://api.github.com/users/TheJJ/followers","following_url":"https://api.github.com/users/TheJJ/following{/other_user}","gists_url":"https://api.github.com/users/TheJJ/gists{/gist_id}","starred_url":"https://api.github.com/users/TheJJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheJJ/subscriptions","organizations_url":"https://api.github.com/users/TheJJ/orgs","repos_url":"https://api.github.com/users/TheJJ/repos","events_url":"https://api.github.com/users/TheJJ/events{/privacy}","received_events_url":"https://api.github.com/users/TheJJ/received_events","type":"User","site_admin":false},"body":"why do you decode here? isn't it a `str` already?","created_at":"2016-05-30T19:20:08Z","updated_at":"2016-05-30T19:20:08Z","html_url":"https://github.com/SFTtech/openage/pull/527#discussion_r65100820","pull_request_url":"https://api.github.com/repos/SFTtech/openage/pulls/527","_links":{"self":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/comments/65100820"},"html":{"href":"https://github.com/SFTtech/openage/pull/527#discussion_r65100820"},"pull_request":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/527"}}},"pull_request":{"url":"https://api.github.com/repos/SFTtech/openage/pulls/527","id":62675283,"html_url":"https://github.com/SFTtech/openage/pull/527","diff_url":"https://github.com/SFTtech/openage/pull/527.diff","patch_url":"https://github.com/SFTtech/openage/pull/527.patch","issue_url":"https://api.github.com/repos/SFTtech/openage/issues/527","number":527,"state":"open","locked":false,"title":"GUI middle part of the HUD","user":{"login":"ChipmunkV","id":5393579,"avatar_url":"https://avatars.githubusercontent.com/u/5393579?v=3","gravatar_id":"","url":"https://api.github.com/users/ChipmunkV","html_url":"https://github.com/ChipmunkV","followers_url":"https://api.github.com/users/ChipmunkV/followers","following_url":"https://api.github.com/users/ChipmunkV/following{/other_user}","gists_url":"https://api.github.com/users/ChipmunkV/gists{/gist_id}","starred_url":"https://api.github.com/users/ChipmunkV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChipmunkV/subscriptions","organizations_url":"https://api.github.com/users/ChipmunkV/orgs","repos_url":"https://api.github.com/users/ChipmunkV/repos","events_url":"https://api.github.com/users/ChipmunkV/events{/privacy}","received_events_url":"https://api.github.com/users/ChipmunkV/received_events","type":"User","site_admin":false},"body":"Rendering some paper.","created_at":"2016-03-13T16:24:56Z","updated_at":"2016-05-30T19:20:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0776b8d2532ec9c9d7444d9d08a87151fceb62c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SFTtech/openage/pulls/527/commits","review_comments_url":"https://api.github.com/repos/SFTtech/openage/pulls/527/comments","review_comment_url":"https://api.github.com/repos/SFTtech/openage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SFTtech/openage/issues/527/comments","statuses_url":"https://api.github.com/repos/SFTtech/openage/statuses/2d75017c10b0208887b7bc95b79f7dd64e9cb019","head":{"label":"ChipmunkV:gui-paper","ref":"gui-paper","sha":"2d75017c10b0208887b7bc95b79f7dd64e9cb019","user":{"login":"ChipmunkV","id":5393579,"avatar_url":"https://avatars.githubusercontent.com/u/5393579?v=3","gravatar_id":"","url":"https://api.github.com/users/ChipmunkV","html_url":"https://github.com/ChipmunkV","followers_url":"https://api.github.com/users/ChipmunkV/followers","following_url":"https://api.github.com/users/ChipmunkV/following{/other_user}","gists_url":"https://api.github.com/users/ChipmunkV/gists{/gist_id}","starred_url":"https://api.github.com/users/ChipmunkV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChipmunkV/subscriptions","organizations_url":"https://api.github.com/users/ChipmunkV/orgs","repos_url":"https://api.github.com/users/ChipmunkV/repos","events_url":"https://api.github.com/users/ChipmunkV/events{/privacy}","received_events_url":"https://api.github.com/users/ChipmunkV/received_events","type":"User","site_admin":false},"repo":{"id":48070612,"name":"openage","full_name":"ChipmunkV/openage","owner":{"login":"ChipmunkV","id":5393579,"avatar_url":"https://avatars.githubusercontent.com/u/5393579?v=3","gravatar_id":"","url":"https://api.github.com/users/ChipmunkV","html_url":"https://github.com/ChipmunkV","followers_url":"https://api.github.com/users/ChipmunkV/followers","following_url":"https://api.github.com/users/ChipmunkV/following{/other_user}","gists_url":"https://api.github.com/users/ChipmunkV/gists{/gist_id}","starred_url":"https://api.github.com/users/ChipmunkV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChipmunkV/subscriptions","organizations_url":"https://api.github.com/users/ChipmunkV/orgs","repos_url":"https://api.github.com/users/ChipmunkV/repos","events_url":"https://api.github.com/users/ChipmunkV/events{/privacy}","received_events_url":"https://api.github.com/users/ChipmunkV/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChipmunkV/openage","description":"Free (as in freedom) open source clone of the Age of Empires II engine.","fork":true,"url":"https://api.github.com/repos/ChipmunkV/openage","forks_url":"https://api.github.com/repos/ChipmunkV/openage/forks","keys_url":"https://api.github.com/repos/ChipmunkV/openage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChipmunkV/openage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChipmunkV/openage/teams","hooks_url":"https://api.github.com/repos/ChipmunkV/openage/hooks","issue_events_url":"https://api.github.com/repos/ChipmunkV/openage/issues/events{/number}","events_url":"https://api.github.com/repos/ChipmunkV/openage/events","assignees_url":"https://api.github.com/repos/ChipmunkV/openage/assignees{/user}","branches_url":"https://api.github.com/repos/ChipmunkV/openage/branches{/branch}","tags_url":"https://api.github.com/repos/ChipmunkV/openage/tags","blobs_url":"https://api.github.com/repos/ChipmunkV/openage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChipmunkV/openage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChipmunkV/openage/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChipmunkV/openage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChipmunkV/openage/statuses/{sha}","languages_url":"https://api.github.com/repos/ChipmunkV/openage/languages","stargazers_url":"https://api.github.com/repos/ChipmunkV/openage/stargazers","contributors_url":"https://api.github.com/repos/ChipmunkV/openage/contributors","subscribers_url":"https://api.github.com/repos/ChipmunkV/openage/subscribers","subscription_url":"https://api.github.com/repos/ChipmunkV/openage/subscription","commits_url":"https://api.github.com/repos/ChipmunkV/openage/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChipmunkV/openage/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChipmunkV/openage/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChipmunkV/openage/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChipmunkV/openage/contents/{+path}","compare_url":"https://api.github.com/repos/ChipmunkV/openage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChipmunkV/openage/merges","archive_url":"https://api.github.com/repos/ChipmunkV/openage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChipmunkV/openage/downloads","issues_url":"https://api.github.com/repos/ChipmunkV/openage/issues{/number}","pulls_url":"https://api.github.com/repos/ChipmunkV/openage/pulls{/number}","milestones_url":"https://api.github.com/repos/ChipmunkV/openage/milestones{/number}","notifications_url":"https://api.github.com/repos/ChipmunkV/openage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChipmunkV/openage/labels{/name}","releases_url":"https://api.github.com/repos/ChipmunkV/openage/releases{/id}","deployments_url":"https://api.github.com/repos/ChipmunkV/openage/deployments","created_at":"2015-12-15T21:41:10Z","updated_at":"2016-04-10T13:40:33Z","pushed_at":"2016-05-30T18:05:43Z","git_url":"git://github.com/ChipmunkV/openage.git","ssh_url":"git@github.com:ChipmunkV/openage.git","clone_url":"https://github.com/ChipmunkV/openage.git","svn_url":"https://github.com/ChipmunkV/openage","homepage":"http://openage.sft.mx","size":7058,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SFTtech:master","ref":"master","sha":"ea5831f780ef184c2cb55cc1c678e62837cd8cf8","user":{"login":"SFTtech","id":1783325,"avatar_url":"https://avatars.githubusercontent.com/u/1783325?v=3","gravatar_id":"","url":"https://api.github.com/users/SFTtech","html_url":"https://github.com/SFTtech","followers_url":"https://api.github.com/users/SFTtech/followers","following_url":"https://api.github.com/users/SFTtech/following{/other_user}","gists_url":"https://api.github.com/users/SFTtech/gists{/gist_id}","starred_url":"https://api.github.com/users/SFTtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SFTtech/subscriptions","organizations_url":"https://api.github.com/users/SFTtech/orgs","repos_url":"https://api.github.com/users/SFTtech/repos","events_url":"https://api.github.com/users/SFTtech/events{/privacy}","received_events_url":"https://api.github.com/users/SFTtech/received_events","type":"Organization","site_admin":false},"repo":{"id":14095175,"name":"openage","full_name":"SFTtech/openage","owner":{"login":"SFTtech","id":1783325,"avatar_url":"https://avatars.githubusercontent.com/u/1783325?v=3","gravatar_id":"","url":"https://api.github.com/users/SFTtech","html_url":"https://github.com/SFTtech","followers_url":"https://api.github.com/users/SFTtech/followers","following_url":"https://api.github.com/users/SFTtech/following{/other_user}","gists_url":"https://api.github.com/users/SFTtech/gists{/gist_id}","starred_url":"https://api.github.com/users/SFTtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SFTtech/subscriptions","organizations_url":"https://api.github.com/users/SFTtech/orgs","repos_url":"https://api.github.com/users/SFTtech/repos","events_url":"https://api.github.com/users/SFTtech/events{/privacy}","received_events_url":"https://api.github.com/users/SFTtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SFTtech/openage","description":"Free (as in freedom) open source clone of the Age of Empires II engine :rocket:","fork":false,"url":"https://api.github.com/repos/SFTtech/openage","forks_url":"https://api.github.com/repos/SFTtech/openage/forks","keys_url":"https://api.github.com/repos/SFTtech/openage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SFTtech/openage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SFTtech/openage/teams","hooks_url":"https://api.github.com/repos/SFTtech/openage/hooks","issue_events_url":"https://api.github.com/repos/SFTtech/openage/issues/events{/number}","events_url":"https://api.github.com/repos/SFTtech/openage/events","assignees_url":"https://api.github.com/repos/SFTtech/openage/assignees{/user}","branches_url":"https://api.github.com/repos/SFTtech/openage/branches{/branch}","tags_url":"https://api.github.com/repos/SFTtech/openage/tags","blobs_url":"https://api.github.com/repos/SFTtech/openage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SFTtech/openage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SFTtech/openage/git/refs{/sha}","trees_url":"https://api.github.com/repos/SFTtech/openage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SFTtech/openage/statuses/{sha}","languages_url":"https://api.github.com/repos/SFTtech/openage/languages","stargazers_url":"https://api.github.com/repos/SFTtech/openage/stargazers","contributors_url":"https://api.github.com/repos/SFTtech/openage/contributors","subscribers_url":"https://api.github.com/repos/SFTtech/openage/subscribers","subscription_url":"https://api.github.com/repos/SFTtech/openage/subscription","commits_url":"https://api.github.com/repos/SFTtech/openage/commits{/sha}","git_commits_url":"https://api.github.com/repos/SFTtech/openage/git/commits{/sha}","comments_url":"https://api.github.com/repos/SFTtech/openage/comments{/number}","issue_comment_url":"https://api.github.com/repos/SFTtech/openage/issues/comments{/number}","contents_url":"https://api.github.com/repos/SFTtech/openage/contents/{+path}","compare_url":"https://api.github.com/repos/SFTtech/openage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SFTtech/openage/merges","archive_url":"https://api.github.com/repos/SFTtech/openage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SFTtech/openage/downloads","issues_url":"https://api.github.com/repos/SFTtech/openage/issues{/number}","pulls_url":"https://api.github.com/repos/SFTtech/openage/pulls{/number}","milestones_url":"https://api.github.com/repos/SFTtech/openage/milestones{/number}","notifications_url":"https://api.github.com/repos/SFTtech/openage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SFTtech/openage/labels{/name}","releases_url":"https://api.github.com/repos/SFTtech/openage/releases{/id}","deployments_url":"https://api.github.com/repos/SFTtech/openage/deployments","created_at":"2013-11-03T22:35:23Z","updated_at":"2016-05-30T09:49:07Z","pushed_at":"2016-05-30T18:23:50Z","git_url":"git://github.com/SFTtech/openage.git","ssh_url":"git@github.com:SFTtech/openage.git","clone_url":"https://github.com/SFTtech/openage.git","svn_url":"https://github.com/SFTtech/openage","homepage":"http://openage.sft.mx","size":8796,"stargazers_count":5026,"watchers_count":5026,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":459,"mirror_url":null,"open_issues_count":132,"forks":459,"open_issues":132,"watchers":5026,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/527"},"html":{"href":"https://github.com/SFTtech/openage/pull/527"},"issue":{"href":"https://api.github.com/repos/SFTtech/openage/issues/527"},"comments":{"href":"https://api.github.com/repos/SFTtech/openage/issues/527/comments"},"review_comments":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/527/comments"},"review_comment":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SFTtech/openage/pulls/527/commits"},"statuses":{"href":"https://api.github.com/repos/SFTtech/openage/statuses/2d75017c10b0208887b7bc95b79f7dd64e9cb019"}}}}
{"actor":{"display_login":"TheJJ"}}