Преглед на файлове

Remove some references to the Toolserver.

pull/24/head
Ben Kurtovic преди 11 години
родител
ревизия
20259a4414
променени са 6 файла, в които са добавени 9 реда и са изтрити 44 реда
  1. +0
    -5
      build.py
  2. +2
    -2
      toolserver/background.py
  3. +1
    -1
      toolserver/cookies.py
  4. +3
    -1
      toolserver/misc.py
  5. +0
    -32
      toolserver/preconfig.py.ts
  6. +3
    -3
      toolserver/settings.py

+ 0
- 5
build.py Целия файл

@@ -14,11 +14,6 @@ import sys
os.chdir("..")
sys.path.insert(0, ".")

try:
from toolserver import preconfig
except ImportError:
pass

from mako.template import Template
from mako.lookup import TemplateLookup



+ 2
- 2
toolserver/background.py Целия файл

@@ -15,8 +15,8 @@ _descurl = None
def set_background(context, cookies, selected):
global _descurl
conn = open_sql_connection(get_bot(), "globals")
if "EarwigScreenCache" in cookies:
cache = cookies["EarwigScreenCache"].value
if "CopyviosScreenCache" in cookies:
cache = cookies["CopyviosScreenCache"].value
try:
screen = loads(cache)
int(screen["width"])


+ 1
- 1
toolserver/cookies.py Целия файл

@@ -6,7 +6,7 @@ from datetime import datetime, timedelta
from os import path

class _CookieManager(SimpleCookie):
MAGIC = "--ets1"
MAGIC = "--cpv2"

def __init__(self, environ):
self._path = path.split(environ["PATH_INFO"])[0]


+ 3
- 1
toolserver/misc.py Целия файл

@@ -47,9 +47,11 @@ def get_bot():
def open_sql_connection(bot, dbname):
if dbname in _connections:
return _connections[dbname]
conn_args = bot.config.wiki["_toolserverSQL"][dbname]
conn_args = bot.config.wiki["_copyviosSQL"][dbname]
if "read_default_file" not in conn_args and "user" not in conn_args and "passwd" not in conn_args:
conn_args["read_default_file"] = expanduser("~/.my.cnf")
elif "read_default_file" in args:
args["read_default_file"] = expanduser(args["read_default_file"])
if "autoping" not in conn_args:
conn_args["autoping"] = True
if "autoreconnect" not in conn_args:


+ 0
- 32
toolserver/preconfig.py.ts Целия файл

@@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-

"""
This module contains installation-specific import configuration for the
Toolserver. To add your own, create and put code in the file 'preconfig.py' in
this directory, or rename this file to 'preconfig.py' if you want to use this
specific configuration.
"""

import os
import site
import sys

# Add a local platform-specific site package directory:

plat = sys.platform
if plat.startswith("sunos"):
plat = "solaris"
elif plat.startswith("linux"):
plat = "linux"

site.addsitedir(os.path.expanduser("~/.local/" + plat + "/lib/python2.7/site-packages"))
sys.path.insert(0, os.path.expanduser("~/.local/" + plat + "/lib/python2.7/site-packages"))

# EarwigBot, in-between releases, tries to import the 'git' module and add the
# current git commit ID to its __version__ string. This behavior is useful, but
# the Toolserver can be slow at importing things. Insert a fake 'git' module
# into sys.modules so it skips the __version__ addition:

from types import ModuleType
git = ModuleType("git")
sys.modules["git"] = git

+ 3
- 3
toolserver/settings.py Целия файл

@@ -22,17 +22,17 @@ def main(context, environ, headers, cookies):
def _do_set(query, headers, cookies):
changes = set()
if query.lang:
key = "EarwigDefaultLang"
key = "CopyviosDefaultLang"
if key not in cookies or cookies[key].value != query.lang:
set_cookie(headers, cookies, key, query.lang, 1095)
changes.add("site")
if query.project:
key = "EarwigDefaultProject"
key = "CopyviosDefaultProject"
if key not in cookies or cookies[key].value != query.project:
set_cookie(headers, cookies, key, query.project, 1095)
changes.add("site")
if query.background:
key = "EarwigBackground"
key = "CopyviosBackground"
if key not in cookies or cookies[key].value != query.background:
set_cookie(headers, cookies, key, query.background, 1095)
delete_cookie(headers, cookies, "EarwigBackgroundCache")


Зареждане…
Отказ
Запис