From 6c9be4a67ddf3b656f91fd3b56b9a5610d30da7d Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 24 Oct 2020 22:27:47 -0700 Subject: [PATCH] remove dead script replaced by changed to relay2 flask app --- xwords4/android/scripts/and_index.py | 102 --------------------------- 1 file changed, 102 deletions(-) delete mode 100755 xwords4/android/scripts/and_index.py diff --git a/xwords4/android/scripts/and_index.py b/xwords4/android/scripts/and_index.py deleted file mode 100755 index c081f3979..000000000 --- a/xwords4/android/scripts/and_index.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/python3 - -import os - -try: - from mod_python import apache - apacheAvailable = True -except ImportError: - apacheAvailable = False - -def printHead(): - return """ - - - - CrossWords Invite redirect - - - -""" - -def printTail(): - return '' - -def printAndroid(appName, params, scheme): - return """ -
- -

You just clicked a link in a {appName} invitation, but you should not be -seeing this page!

-
-

One of three things went wrong:

-
    -
  1. You don't have {appName} installed
  2. - -
    What to do: Install via Google's App - Store or directly - from the author's site (sideloading)
    - -
  3. When you were asked to choose between a browser and {appName} - you chose the browser
  4. - -
    What to do: Click the invitation link again, and this time - choose {appName}
    - -
  5. You're on Android 11, where there appears to be a new - bug that prevents you being given a choice!
  6. - -
    What to do: Tap this link - to launch {appName}
    -
- -
-

Have fun. And as always, let -me know if you have problems or suggestions.

-
-""".format(appName=appName, params=params, scheme=scheme) - -def printNonAndroid(agent): - subject = 'Android device not identified' - body = 'My browser is running on an android device but says its' \ - + ' user agent is: \"{agent}\". Please fix your website' \ - + ' to recognize this as an Android browser'.format(agent=agent) - fmt = """ -
-

This page is meant to be viewed on an Android device.

-
-

(If you are viewing this on an Android device, - you've found a bug! Please email me. -

-
-""" - return fmt.format(subject=subject, body=body) - - -def index(req): - str = printHead() - - typ = os.path.basename(os.path.dirname(req.filename)) - if 'andd' == typ: - appName = 'CrossDbg' - scheme = 'newxwgamed' - else: - appName = 'CrossWords' - scheme = 'newxwgame' - - agent = req.headers_in.get('User-Agent', None) - if agent and 'Android' in agent: - str += printAndroid(appName, req.args, scheme) - else: - str += printNonAndroid(agent) - - str += printTail() - return str