{"action":"closed","issue":{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/48","labels_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/48/comments","events_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/issues/48/events","html_url":"https://github.com/camptocamp/c2cgeoportal/issues/48","id":2966990,"number":48,"title":"settings['project'] should go away","user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/labels/TODO","name":"TODO","color":"207de5"},{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/labels/Waiting%20merge","name":"Waiting merge","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"sbrunner","id":353872,"avatar_url":"https://avatars.githubusercontent.com/u/353872?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/camptocamp/c2cgeoportal/milestones/24","html_url":"https://github.com/camptocamp/c2cgeoportal/milestones/1.6","labels_url":"https://api.github.com/repos/camptocamp/c2cgeoportal/milestones/24/labels","id":692448,"number":24,"title":"1.6","description":null,"creator":{"login":"sbrunner","id":353872,"avatar_url":"https://avatars.githubusercontent.com/u/353872?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrunner","html_url":"https://github.com/sbrunner","followers_url":"https://api.github.com/users/sbrunner/followers","following_url":"https://api.github.com/users/sbrunner/following{/other_user}","gists_url":"https://api.github.com/users/sbrunner/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrunner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrunner/subscriptions","organizations_url":"https://api.github.com/users/sbrunner/orgs","repos_url":"https://api.github.com/users/sbrunner/repos","events_url":"https://api.github.com/users/sbrunner/events{/privacy}","received_events_url":"https://api.github.com/users/sbrunner/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":130,"state":"open","created_at":"2014-06-16T15:50:09Z","updated_at":"2015-03-04T10:26:58Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2012-01-25T16:07:58Z","updated_at":"2015-03-04T10:26:58Z","closed_at":"2015-03-04T10:26:58Z","body":"The ```entry``` view defines this function:\r\n\r\n```\r\n    def _getIconPath(self, icon):\r\n        if not icon:\r\n            return None\r\n        icon = str(icon)\r\n        # test full URL\r\n        if not icon[0:4] == 'http':\r\n            try:\r\n                # test full resource ref\r\n                if icon.find(':') < 0:\r\n                    if icon[0] is not '/':\r\n                        icon = '/' + icon\r\n                    icon = self.request.static_url(self.settings['project'] + ':static' + icon)\r\n                else:\r\n                    icon = self.request.static_url(icon)\r\n            except ValueError:\r\n                log.exception('can\\'t generate url for icon: %s' % icon)\r\n                return None\r\n        return icon\r\n```\r\n\r\nSo It uses ```static_url(self.settings['project'] + ':static' + icon)``` to get URLs for static resources served by the project's static view.\r\n\r\nFor this to work the project's ```.ini``` file defines a ```project``` variable in the ```app``` section:\r\n\r\n```\r\n[app:${package}]\r\nuse = egg:${package}\r\nproject = ${package}\r\n```\r\n\r\nWe should change that, and rely on a Pyramid's [assets overrides](http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/assets.html#overriding-assets). So the project's ```__init__.py``` file would define an asset override with something like this:\r\n\r\n```\r\nconfig.override_asset(to_override='c2cgeoportal:static/',\r\n                                        override_with='${package}:static/')\r\n```\r\n\r\nand the c2cgeoportal would use calls like ```static_url('c2cgeoportal:static/icon.png')```.\r\n\r\n\r\nSee this [discussion](https://groups.google.com/group/pylons-discuss/msg/4c8e525f488a2230) for example.\r\n"}}