@ -0,0 +1,48 @@
|
||||
diff -Naur a/__init__.py b/__init__.py
|
||||
--- a/__init__.py 2018-08-22 17:54:00.369070610 +0200
|
||||
+++ b/__init__.py 2018-08-22 20:11:39.861463512 +0200
|
||||
@@ -11,6 +11,10 @@
|
||||
from pyramid.response import Response
|
||||
from pyramid.events import NewRequest, subscriber
|
||||
|
||||
+from pyramid.static import static_view
|
||||
+from pyramid.view import view_config
|
||||
+from pyramid.renderers import render, render_to_response
|
||||
+
|
||||
try:
|
||||
import requests.packages.urllib3.contrib.pyopenssl
|
||||
HAS_PYOPENSSL = True
|
||||
@@ -135,13 +139,27 @@
|
||||
config.scan("syncserver", ignore=["syncserver.wsgi_app"])
|
||||
config.include("syncstorage", route_prefix="/storage")
|
||||
config.include("tokenserver", route_prefix="/token")
|
||||
+ config.include('pyramid_chameleon')
|
||||
|
||||
- # Add a top-level "it works!" view.
|
||||
- def itworks(request):
|
||||
- return Response("it works!")
|
||||
-
|
||||
- config.add_route('itworks', '/')
|
||||
- config.add_view(itworks, route_name='itworks')
|
||||
+ # Add a top-level explaination view.
|
||||
+ # First view, available at http://localhost:6543/
|
||||
+ def page(request):
|
||||
+ result = render('page/index.pt',
|
||||
+ {'public_url':public_url},
|
||||
+ request=request)
|
||||
+ response = Response(result)
|
||||
+ return response
|
||||
+ config.add_route('page', '/')
|
||||
+ config.add_view(page, route_name='page')
|
||||
+
|
||||
+ www = static_view(
|
||||
+ os.path.realpath(os.path.dirname(__file__)+"/page/"),
|
||||
+ use_subpath=True
|
||||
+ )
|
||||
+ # Documentation for Hybrid routing can be found here
|
||||
+ # http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/hybrid.html#using-subpath-in-a-route-pattern
|
||||
+ config.add_route('index', '/*subpath', 'www') # subpath is a reserved word
|
||||
+ config.add_view(www, route_name='index')
|
||||
|
||||
|
||||
def import_settings_from_environment_variables(settings, environ=None):
|
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 780 B |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1 @@
|
||||
(function(){var e=document.getElementsByTagName("html")[0].getAttribute("data-gtm-container-id");typeof window._dntEnabled=="function"&&!window._dntEnabled()&&e&&function(e,t,n,r,i,s,o,u,a,f){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),o=t.getElementsByTagName(n)[0],a=i.length,f="//www.googletagmanager.com/gtm.js?id=@&l="+(r||"dataLayer");while(a--)s=t.createElement(n),s.async=!0,s.src=f.replace("@",i[a]),o.parentNode.insertBefore(s,o)}(window,document,"script","dataLayer",[e])})();
|
@ -0,0 +1 @@
|
||||
function _dntEnabled(e,t){"use strict";var n=e||navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack,r=t||navigator.userAgent,i=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3"],s=r.match(/Firefox\/(\d+)/),o=/MSIE|Trident/i,u=o.test(r),a=r.match(/Windows.+?(?=;)/g);return u&&typeof Array.prototype.indexOf!="function"?!1:(s&&parseInt(s[1],10)<32?n="Unspecified":u&&a&&i.indexOf(a.toString())!==-1?n="Unspecified":n={0:"Disabled",1:"Enabled"}[n]||"Unspecified",n==="Enabled"?!0:!1)}(function(){"use strict";window.site={getPlatform:function(e,t){return t=t===""?"":t||navigator.platform,e=e||navigator.userAgent,/Win(16|9[x58]|NT( [1234]| 5\.0| [^0-9]|[^ -]|$))/.test(e)||/Windows ([MC]E|9[x58]|3\.1|4\.10|NT( [1234]\D| 5\.0| [^0-9]|[^ ]|$))/.test(e)||/Windows_95/.test(e)?"oldwin":t.indexOf("Win32")!==-1||t.indexOf("Win64")!==-1?"windows":/android/i.test(e)?"android":/linux/i.test(t)||/linux/i.test(e)?"linux":t.indexOf("MacPPC")!==-1?"oldmac":/Mac OS X 10.[0-5]\D/.test(e)?"oldmac":t.indexOf("iPhone")!==-1||t.indexOf("iPad")!==-1||t.indexOf("iPod")!==-1?"ios":e.indexOf("Mac OS X")!==-1?"osx":e.indexOf("MSIE 5.2")!==-1?"oldmac":t.indexOf("Mac")!==-1?"oldmac":t===""&&/Firefox/.test(e)?"fxos":"other"},getPlatformVersion:function(e){e=e||navigator.userAgent;var t=e.match(/Windows\ NT\ (\d+\.\d+)/)||e.match(/Mac\ OS\ X\ (\d+[\._]\d+)/)||e.match(/Android\ (\d+\.\d+)/);return t?t[1].replace("_","."):undefined},getArchType:function(e,t){t=t===""?"":t||navigator.platform,e=e||navigator.userAgent;var n;return/Windows/.test(e)&&/ARM/.test(e)?"armv7":navigator.cpuClass?navigator.cpuClass.toLowerCase():(n=/armv\d+/i,n.test(t)||n.test(e)?RegExp.lastMatch.toLowerCase():/aarch64/.test(t)?"armv8":(n=/PowerPC|PPC/i,n.test(t)||n.test(e)?"ppc":"x86"))},getArchSize:function(e,t){t=t===""?"":t||navigator.platform,e=e||navigator.userAgent;var n=/x64|x86_64|Win64|WOW64|aarch64/i;return n.test(t)||n.test(e)?64:32},needsSha1:function(e){e=e||navigator.userAgent;var t=/Windows (?:NT 5.1|XP|NT 5.2|NT 6.0)/,n=/\sFirefox/;return t.test(e)&&!n.test(e)},platform:"other",platformVersion:undefined,archType:"x64",archSize:32},function(){var e=document.documentElement,t=window.site.platform=window.site.getPlatform(),n=window.site.platformVersion=window.site.getPlatformVersion();t==="windows"?n&&parseFloat(n)>=6.1?e.className+=" win7up":window.site.needsSha1()&&(e.className+=" sha-1"):(e.className=e.className.replace("windows",t),t==="osx"&&n&&n.match(/^10\.[678]$/)&&(e.className+=" pre-mavericks"),t==="android"&&n&&parseFloat(n)===2.3&&(e.className+=" gingerbread"));var r=window.site.archType=window.site.getArchType(),i=window.site.archSize=window.site.getArchSize(),s=r.match(/armv(\d+)/);r!=="x86"&&(e.className=e.className.replace("x86",r),s&&(e.className+=" arm",parseFloat(s[1])>=7&&(e.className+=" armv7up"))),i===64&&(e.className+=" x64"),e.className=e.className.replace(/\bno-js\b/,"js")}()})();if(typeof Mozilla=="undefined")var Mozilla={};(function(){var e=window.dataLayer=window.dataLayer||[],t={};t.getPageId=function(e){var t=document.getElementsByTagName("html")[0].getAttribute("data-gtm-page-id"),n=e?e:document.location.pathname;return t?t:n.replace(/^(\/\w{2}\-\w{2}\/|\/\w{2,3}\/)/,"/")},e.push({event:"page-id-loaded",pageId:t.getPageId()}),Mozilla.Analytics=t})();
|