{"action":"created","comment":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/comments/33679668","id":33679668,"diff_hunk":"@@ -472,47 +472,57 @@ def dump(self, fp):\n         \"\"\"\n         eb_file = file(fp, \"w\")\n \n-        def to_str(x):\n-            \"\"\"Return quoted version of x\"\"\"\n-            if isinstance(x, basestring):\n-                if '\\n' in x or ('\"' in x and \"'\" in x):\n-                    return '\"\"\"%s\"\"\"' % x\n-                elif \"'\" in x:\n-                    return '\"%s\"' % x\n-                else:\n-                    return \"'%s'\" % x\n-            else:\n-                return \"%s\" % x\n-\n         # ordered groups of keys to obtain a nice looking easyconfig file\n         grouped_keys = [\n+            ['easyblock'],\n             ['name', 'version', 'versionprefix', 'versionsuffix'],\n             ['homepage', 'description'],\n             ['toolchain', 'toolchainopts'],\n-            ['source_urls', 'sources'],\n+            ['sources', 'source_urls'],\n             ['patches'],\n             ['builddependencies', 'dependencies', 'hiddendependencies'],\n+            ['osdependencies'],\n+            ['preconfigopts', 'configopts'],\n+            ['prebuildopts', 'buildopts'],\n+            ['preinstallopts', 'installopts'],\n             ['parallel', 'maxparallel'],\n-            ['osdependencies']\n         ]\n \n+        last_keys = [\n+            ['sanity_check_paths'],\n+            ['moduleclass'],\n+        ]\n+\n+        def check_and_print(keyset):\n+            \"\"\"\n+            Internal function checking for default values\n+            \"\"\"\n+            for group in keyset:\n+                printed = False\n+                for key1 in group:\n+                    val = self._config[key1][0]\n+                    for key2, [def_val, _, _] in DEFAULT_CONFIG.items():\n+                        # only print parameters that are different from the default value\n+                        if key1 == key2 and val != def_val:\n+                            ebtxt.append(\"%s = %s\" % (key1, quote_str(val, escape_newline=True)))\n+                            printed_keys.append(key1)\n+                            printed = True\n+                if printed:\n+                    ebtxt.append(\"\")\n+\n+\n         # print easyconfig parameters ordered and in groups specified above\n         ebtxt = []\n         printed_keys = []\n-        for group in grouped_keys:\n-            for key1 in group:\n-                val = self._config[key1][0]\n-                for key2, [def_val, _, _] in DEFAULT_CONFIG.items():\n-                    # only print parameters that are different from the default value\n-                    if key1 == key2 and val != def_val:\n-                        ebtxt.append(\"%s = %s\" % (key1, to_str(val)))\n-                        printed_keys.append(key1)\n-            ebtxt.append(\"\")\n+        check_and_print(grouped_keys)\n \n         # print other easyconfig parameters at the end\n         for key, [val, _, _] in DEFAULT_CONFIG.items():","path":"easybuild/framework/easyconfig/easyconfig.py","position":81,"original_position":81,"commit_id":"3bb531e30faf2ee630cecd1e4c5516f91599d5d0","original_commit_id":"3bb531e30faf2ee630cecd1e4c5516f91599d5d0","user":{"login":"boegel","id":620876,"avatar_url":"https://avatars.githubusercontent.com/u/620876?v=3","gravatar_id":"","url":"https://api.github.com/users/boegel","html_url":"https://github.com/boegel","followers_url":"https://api.github.com/users/boegel/followers","following_url":"https://api.github.com/users/boegel/following{/other_user}","gists_url":"https://api.github.com/users/boegel/gists{/gist_id}","starred_url":"https://api.github.com/users/boegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boegel/subscriptions","organizations_url":"https://api.github.com/users/boegel/orgs","repos_url":"https://api.github.com/users/boegel/repos","events_url":"https://api.github.com/users/boegel/events{/privacy}","received_events_url":"https://api.github.com/users/boegel/received_events","type":"User","site_admin":false},"body":"fix the order in which the keys are being considered here (the order of the elements in `.items()` on a dict-like object may differ, you can't make assumptions on it's order here); maybe used `sorted`?","created_at":"2015-07-01T13:52:06Z","updated_at":"2015-07-01T13:52:06Z","html_url":"https://github.com/hpcugent/easybuild-framework/pull/1308#discussion_r33679668","pull_request_url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308","_links":{"self":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/comments/33679668"},"html":{"href":"https://github.com/hpcugent/easybuild-framework/pull/1308#discussion_r33679668"},"pull_request":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308"}}},"pull_request":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308","id":38778919,"html_url":"https://github.com/hpcugent/easybuild-framework/pull/1308","diff_url":"https://github.com/hpcugent/easybuild-framework/pull/1308.diff","patch_url":"https://github.com/hpcugent/easybuild-framework/pull/1308.patch","issue_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1308","number":1308,"state":"open","locked":false,"title":"Fix for to_str in dump method of easyconfig.py","user":{"login":"Caylo","id":3251843,"avatar_url":"https://avatars.githubusercontent.com/u/3251843?v=3","gravatar_id":"","url":"https://api.github.com/users/Caylo","html_url":"https://github.com/Caylo","followers_url":"https://api.github.com/users/Caylo/followers","following_url":"https://api.github.com/users/Caylo/following{/other_user}","gists_url":"https://api.github.com/users/Caylo/gists{/gist_id}","starred_url":"https://api.github.com/users/Caylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caylo/subscriptions","organizations_url":"https://api.github.com/users/Caylo/orgs","repos_url":"https://api.github.com/users/Caylo/repos","events_url":"https://api.github.com/users/Caylo/events{/privacy}","received_events_url":"https://api.github.com/users/Caylo/received_events","type":"User","site_admin":false},"body":"Resolves issue #1305.","created_at":"2015-06-29T14:26:40Z","updated_at":"2015-07-01T13:52:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6166ea5fe84b600d7ac44241b6193f22f412e1bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308/commits","review_comments_url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308/comments","review_comment_url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1308/comments","statuses_url":"https://api.github.com/repos/hpcugent/easybuild-framework/statuses/3bb531e30faf2ee630cecd1e4c5516f91599d5d0","head":{"label":"Caylo:fix-easyconfig-dump-issue1305","ref":"fix-easyconfig-dump-issue1305","sha":"3bb531e30faf2ee630cecd1e4c5516f91599d5d0","user":{"login":"Caylo","id":3251843,"avatar_url":"https://avatars.githubusercontent.com/u/3251843?v=3","gravatar_id":"","url":"https://api.github.com/users/Caylo","html_url":"https://github.com/Caylo","followers_url":"https://api.github.com/users/Caylo/followers","following_url":"https://api.github.com/users/Caylo/following{/other_user}","gists_url":"https://api.github.com/users/Caylo/gists{/gist_id}","starred_url":"https://api.github.com/users/Caylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caylo/subscriptions","organizations_url":"https://api.github.com/users/Caylo/orgs","repos_url":"https://api.github.com/users/Caylo/repos","events_url":"https://api.github.com/users/Caylo/events{/privacy}","received_events_url":"https://api.github.com/users/Caylo/received_events","type":"User","site_admin":false},"repo":{"id":38231913,"name":"easybuild-framework","full_name":"Caylo/easybuild-framework","owner":{"login":"Caylo","id":3251843,"avatar_url":"https://avatars.githubusercontent.com/u/3251843?v=3","gravatar_id":"","url":"https://api.github.com/users/Caylo","html_url":"https://github.com/Caylo","followers_url":"https://api.github.com/users/Caylo/followers","following_url":"https://api.github.com/users/Caylo/following{/other_user}","gists_url":"https://api.github.com/users/Caylo/gists{/gist_id}","starred_url":"https://api.github.com/users/Caylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caylo/subscriptions","organizations_url":"https://api.github.com/users/Caylo/orgs","repos_url":"https://api.github.com/users/Caylo/repos","events_url":"https://api.github.com/users/Caylo/events{/privacy}","received_events_url":"https://api.github.com/users/Caylo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Caylo/easybuild-framework","description":"EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way. ","fork":true,"url":"https://api.github.com/repos/Caylo/easybuild-framework","forks_url":"https://api.github.com/repos/Caylo/easybuild-framework/forks","keys_url":"https://api.github.com/repos/Caylo/easybuild-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Caylo/easybuild-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Caylo/easybuild-framework/teams","hooks_url":"https://api.github.com/repos/Caylo/easybuild-framework/hooks","issue_events_url":"https://api.github.com/repos/Caylo/easybuild-framework/issues/events{/number}","events_url":"https://api.github.com/repos/Caylo/easybuild-framework/events","assignees_url":"https://api.github.com/repos/Caylo/easybuild-framework/assignees{/user}","branches_url":"https://api.github.com/repos/Caylo/easybuild-framework/branches{/branch}","tags_url":"https://api.github.com/repos/Caylo/easybuild-framework/tags","blobs_url":"https://api.github.com/repos/Caylo/easybuild-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Caylo/easybuild-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Caylo/easybuild-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/Caylo/easybuild-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Caylo/easybuild-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/Caylo/easybuild-framework/languages","stargazers_url":"https://api.github.com/repos/Caylo/easybuild-framework/stargazers","contributors_url":"https://api.github.com/repos/Caylo/easybuild-framework/contributors","subscribers_url":"https://api.github.com/repos/Caylo/easybuild-framework/subscribers","subscription_url":"https://api.github.com/repos/Caylo/easybuild-framework/subscription","commits_url":"https://api.github.com/repos/Caylo/easybuild-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/Caylo/easybuild-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/Caylo/easybuild-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/Caylo/easybuild-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/Caylo/easybuild-framework/contents/{+path}","compare_url":"https://api.github.com/repos/Caylo/easybuild-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Caylo/easybuild-framework/merges","archive_url":"https://api.github.com/repos/Caylo/easybuild-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Caylo/easybuild-framework/downloads","issues_url":"https://api.github.com/repos/Caylo/easybuild-framework/issues{/number}","pulls_url":"https://api.github.com/repos/Caylo/easybuild-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/Caylo/easybuild-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/Caylo/easybuild-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Caylo/easybuild-framework/labels{/name}","releases_url":"https://api.github.com/repos/Caylo/easybuild-framework/releases{/id}","created_at":"2015-06-29T06:43:22Z","updated_at":"2015-06-29T06:43:23Z","pushed_at":"2015-07-01T13:38:31Z","git_url":"git://github.com/Caylo/easybuild-framework.git","ssh_url":"git@github.com:Caylo/easybuild-framework.git","clone_url":"https://github.com/Caylo/easybuild-framework.git","svn_url":"https://github.com/Caylo/easybuild-framework","homepage":"http://hpcugent.github.com/easybuild/","size":16372,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hpcugent:develop","ref":"develop","sha":"944dc3ee9e36daecb0063b2698d52a976cad8253","user":{"login":"hpcugent","id":1515263,"avatar_url":"https://avatars.githubusercontent.com/u/1515263?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcugent","html_url":"https://github.com/hpcugent","followers_url":"https://api.github.com/users/hpcugent/followers","following_url":"https://api.github.com/users/hpcugent/following{/other_user}","gists_url":"https://api.github.com/users/hpcugent/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcugent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcugent/subscriptions","organizations_url":"https://api.github.com/users/hpcugent/orgs","repos_url":"https://api.github.com/users/hpcugent/repos","events_url":"https://api.github.com/users/hpcugent/events{/privacy}","received_events_url":"https://api.github.com/users/hpcugent/received_events","type":"Organization","site_admin":false},"repo":{"id":3662176,"name":"easybuild-framework","full_name":"hpcugent/easybuild-framework","owner":{"login":"hpcugent","id":1515263,"avatar_url":"https://avatars.githubusercontent.com/u/1515263?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcugent","html_url":"https://github.com/hpcugent","followers_url":"https://api.github.com/users/hpcugent/followers","following_url":"https://api.github.com/users/hpcugent/following{/other_user}","gists_url":"https://api.github.com/users/hpcugent/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcugent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcugent/subscriptions","organizations_url":"https://api.github.com/users/hpcugent/orgs","repos_url":"https://api.github.com/users/hpcugent/repos","events_url":"https://api.github.com/users/hpcugent/events{/privacy}","received_events_url":"https://api.github.com/users/hpcugent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcugent/easybuild-framework","description":"EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way. ","fork":false,"url":"https://api.github.com/repos/hpcugent/easybuild-framework","forks_url":"https://api.github.com/repos/hpcugent/easybuild-framework/forks","keys_url":"https://api.github.com/repos/hpcugent/easybuild-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcugent/easybuild-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcugent/easybuild-framework/teams","hooks_url":"https://api.github.com/repos/hpcugent/easybuild-framework/hooks","issue_events_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/events{/number}","events_url":"https://api.github.com/repos/hpcugent/easybuild-framework/events","assignees_url":"https://api.github.com/repos/hpcugent/easybuild-framework/assignees{/user}","branches_url":"https://api.github.com/repos/hpcugent/easybuild-framework/branches{/branch}","tags_url":"https://api.github.com/repos/hpcugent/easybuild-framework/tags","blobs_url":"https://api.github.com/repos/hpcugent/easybuild-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcugent/easybuild-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcugent/easybuild-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcugent/easybuild-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcugent/easybuild-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcugent/easybuild-framework/languages","stargazers_url":"https://api.github.com/repos/hpcugent/easybuild-framework/stargazers","contributors_url":"https://api.github.com/repos/hpcugent/easybuild-framework/contributors","subscribers_url":"https://api.github.com/repos/hpcugent/easybuild-framework/subscribers","subscription_url":"https://api.github.com/repos/hpcugent/easybuild-framework/subscription","commits_url":"https://api.github.com/repos/hpcugent/easybuild-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcugent/easybuild-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcugent/easybuild-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcugent/easybuild-framework/contents/{+path}","compare_url":"https://api.github.com/repos/hpcugent/easybuild-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcugent/easybuild-framework/merges","archive_url":"https://api.github.com/repos/hpcugent/easybuild-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcugent/easybuild-framework/downloads","issues_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues{/number}","pulls_url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcugent/easybuild-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcugent/easybuild-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcugent/easybuild-framework/labels{/name}","releases_url":"https://api.github.com/repos/hpcugent/easybuild-framework/releases{/id}","created_at":"2012-03-08T17:07:43Z","updated_at":"2015-06-26T08:49:22Z","pushed_at":"2015-07-01T13:38:31Z","git_url":"git://github.com/hpcugent/easybuild-framework.git","ssh_url":"git@github.com:hpcugent/easybuild-framework.git","clone_url":"https://github.com/hpcugent/easybuild-framework.git","svn_url":"https://github.com/hpcugent/easybuild-framework","homepage":"http://hpcugent.github.com/easybuild/","size":16372,"stargazers_count":46,"watchers_count":46,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":237,"forks":61,"open_issues":237,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308"},"html":{"href":"https://github.com/hpcugent/easybuild-framework/pull/1308"},"issue":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1308"},"comments":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1308/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1308/commits"},"statuses":{"href":"https://api.github.com/repos/hpcugent/easybuild-framework/statuses/3bb531e30faf2ee630cecd1e4c5516f91599d5d0"}}}}