Skip to content

Commit

Permalink
Control display of devnote from environ variables.
Browse files Browse the repository at this point in the history
Fixes issue schemaorg#2219
  • Loading branch information
Dataliberate committed Apr 18, 2019
1 parent 6979764 commit e66d32b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env_variables:
#CONFIGFILE: 'https://raw.githubusercontent.com/RichardWallis/datacommons/appupdate/schema/datacomconfig.json'
CONFIGFILE: 'sdoconfig.json'
FORCEINDEXPAGES: 'False'
DEVELOPVERSION: 'True'
MOREBLOCK: 'True'
WARMUPSTATE: 'Auto' # 'Off', 'On', 'Auto' - Off for localhost, On elsewhere
STAYINEXTENTION: 'False'
Expand Down
1 change: 1 addition & 0 deletions schemaorg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env_variables:
PRODSITEDEBUG: 'False'
CONFIGFILE: 'sdoconfig.json'
FORCEINDEXPAGES: 'True'
DEVELOPVERSION: 'False'
MOREBLOCK: 'True'
WARMUPSTATE: 'Auto' # 'Off', 'On', 'Auto' - Off for localhost, On elsewhere
STAYINEXTENTION: 'False'
Expand Down
26 changes: 24 additions & 2 deletions sdoapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@
# e.g. "mainsite testsite" when off expected domains
# "extensionsite" when in an extension (e.g. blue?)

releaselog = { "2.0": "2015-05-13", "2.1": "2015-08-06", "2.2": "2015-11-05", "3.0": "2016-05-04", "3.1": "2016-08-09", "3.2": "2017-03-23", "3.3": "2017-08-14", "3.4": "2018-06-15", "3.5": "2019-04-02", "3.6": "2019-05-01" }
releaselog = { "2.0": "2015-05-13",
"2.1": "2015-08-06",
"2.2": "2015-11-05",
"3.0": "2016-05-04",
"3.1": "2016-08-09",
"3.2": "2017-03-23",
"3.3": "2017-08-14",
"3.4": "2018-06-15",
"3.5": "2019-04-01",
"3.6": "2019-05-01" }

silent_skip_list = [ "favicon.ico" ] # Do nothing for now

Expand Down Expand Up @@ -166,6 +175,16 @@ def urlTemplateLoader(name):
log.info("SUBDOMAINS set to invalid value %s - defaulting to %s" %(subs,SUBDOMAINS))
log.info("SUBDOMAINS set to %s" % SUBDOMAINS)

DEVELOPVERSION = True
devs = os.environ.get("DEVELOPVERSION",None)
if devs:
if devs.lower() == "true":
DEVELOPVERSION = True
elif devs.lower() == "false":
DEVELOPVERSION = False
else:
log.info("DEVELOPVERSION set to invalid value %s - defaulting to %s" %(devs,DEVELOPVERSION))
log.info("DEVELOPVERSION set to %s" % DEVELOPVERSION)

############# Warmup Control ########
WarmedUp = False
Expand Down Expand Up @@ -2112,7 +2131,8 @@ def handleFullReleasePage(self, node, layerlist='core'):
'releasedate': releasedate,
'az_props': az_props, 'az_types': az_types,
'az_prop_meta': az_prop_meta, 'az_type_meta': az_type_meta,
'menu_sel': "Documentation"})
'menu_sel': "Documentation",
'suppressDevnote': True})

self.response.out.write( page )
log.debug("Serving fresh FullReleasePage.")
Expand Down Expand Up @@ -2866,6 +2886,8 @@ def templateRender(templateName, node, values=None):
'ENABLE_HOSTED_EXTENSIONS': ENABLE_HOSTED_EXTENSIONS,
'SCHEMA_VERSION': SCHEMA_VERSION,
'appengineVersion': getAppEngineVersion(),
'developVersion': DEVELOPVERSION,
'suppressDevnote': False,
'debugging': getAppVar('debugging'),
'docsdir': docsdir,
'extlinktext': extlinktext,
Expand Down
2 changes: 1 addition & 1 deletion templates/topnotes.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Header start from topnotes.tpl -->

{% if mybasehost in [ "localhost"] %}
{% if developVersion and not suppressDevnote %}
<div class="devnote"><b>Note</b>: you are viewing the
<!-- <a href="http://webschemas.org/">webschemas.org</a>--> development
version of <a href="{{ sitename }}">{{ sitename }}</a>.
Expand Down
1 change: 1 addition & 0 deletions webschemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env_variables:
PRODSITEDEBUG: 'False'
CONFIGFILE: 'sdoconfig.json'
FORCEINDEXPAGES: 'False'
DEVELOPVERSION: 'True'
MOREBLOCK: 'True'
WARMUPSTATE: 'Auto' # 'Off', 'On', 'Auto' - Off for localhost, On elsewhere
STAYINEXTENTION: 'False'
Expand Down

0 comments on commit e66d32b

Please sign in to comment.