[TIMOB-5717] MobileWeb: remove __VARIABLE__ like syntax from project
| GitHub Issue | n/a |
|---|---|
| Type | Story |
| Priority | Medium |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2011-06-07T05:57:20.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Ingo Muschenetz |
| Assignee | Ingo Muschenetz |
| Created | 2011-05-26T05:54:45.000+0000 |
| Updated | 2017-03-10T18:55:23.000+0000 |
Description
They are done by compiler.py using simple substitution - it doesn't care about context, quotes, escaping and so on.
Instead start using variables passed into titanium.js
file_contents = file_contents.replace('__PROJECT_NAME__',self.project_name)
file_contents = file_contents.replace('__PROJECT_ID__',self.appid)
file_contents = file_contents.replace('__DEPLOYTYPE__',deploytype)
file_contents = file_contents.replace('__APP_ID__',self.appid)
file_contents = file_contents.replace('__APP_ANALYTICS__',ti.properties['analytics'])
file_contents = file_contents.replace('__APP_PUBLISHER__',ti.properties['publisher'])
file_contents = file_contents.replace('__APP_URL__',ti.properties['url'])
file_contents = file_contents.replace('__APP_NAME__',ti.properties['name'])
file_contents = file_contents.replace('__APP_VERSION__',ti.properties['version'])
file_contents = file_contents.replace('__APP_DESCRIPTION__',ti.properties['description'])
file_contents = file_contents.replace('__APP_COPYRIGHT__',ti.properties['copyright'])
file_contents = file_contents.replace('__APP_GUID__',ti.properties['guid'])
They are useful for substituting into HTML pages, for example
Closing ticket as the issue will not fix.