configuration

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@183 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2000-10-29 18:00:50 +00:00
parent 2b605bf92b
commit 18b8e44dbb
4 changed files with 20 additions and 14 deletions

View file

@ -19,7 +19,7 @@ from UrlData import UrlData
from HttpUrlData import HttpUrlData
from linkcheck import _
import httplib,socket
_supportHttps=hasattr(socket.socket, 'ssl')
_supportHttps=hasattr(socket, 'ssl')
class HttpsUrlData(HttpUrlData):
"""Url link with https scheme"""
@ -40,7 +40,7 @@ class HttpsUrlData(HttpUrlData):
if _supportHttps:
HttpUrlData.check(self, config)
else:
self.setWarning(_("HTTPS url ignored"))
self.setWarning(_("HTTPS not supported"))
self.logMe(config)
def __str__(self):

View file

@ -141,8 +141,8 @@ msgid "HTTP 301 (moved permanent) encountered: you should update this link"
msgstr ""
"HTTP 301 (moved permanent) gefunden: Sie sollten diesen Link aktualisieren"
msgid "HTTPS url ignored"
msgstr "HTTPS url ignoriert"
msgid "HTTPS not supported"
msgstr "HTTPS nicht unterstützt"
msgid "Illegal NNTP link syntax"
msgstr "Illegale NNTP link Syntax"

View file

@ -129,8 +129,8 @@ msgstr "Le groupe %s a %s articles, de %s
msgid "HTTP 301 (moved permanent) encountered: you should update this link"
msgstr "HTTP 301 (déplacé) rencontré: vous devez mettre à jour ce lien"
msgid "HTTPS url ignored"
msgstr "Url HTTPS ignorées"
msgid "HTTPS not supported"
msgstr "HTTPS not supported"
msgid "Illegal NNTP link syntax"
msgstr "Syntaxe illégale du lien NNTP"

View file

@ -24,7 +24,7 @@ from distutils.command.install import install
from distutils.command.config import config
from distutils import util
from distutils.file_util import write_file
import os
import os,string
class LCInstall(install):
@ -33,12 +33,17 @@ class LCInstall(install):
# we have to write a configuration file because we need the
# <install_data>/share/locale directory (and other stuff
# like author, url, ...)
if self.root:
install_data = self.install_data[len(self.root):]
else:
install_data = self.install_data
data = ['install_data = %s' % \
`os.path.join(install_data, 'share')`]
# install data
data = []
for d in ['purelib', 'platlib', 'lib', 'headers', 'scripts', 'data']:
attr = 'install_'+d
if self.root:
val = getattr(self, attr)[len(self.root):]
else:
val = getattr(self, attr)
data.append("%s = %s" % (attr, `val`))
from pprint import pformat
data.append('outputs = %s' % pformat(self.get_outputs()))
self.distribution.create_conf_file(self.install_lib, data)
@ -57,13 +62,14 @@ class LCDistribution(Distribution):
def create_conf_file(self, directory, data=[]):
data.insert(0, "# this file is automatically created by setup.py")
filename = os.path.join(directory, self.config_file)
# add metadata
# metadata
metanames = dir(self.metadata) + \
['fullname', 'contact', 'contact_email']
for name in metanames:
method = "get_" + name
cmd = "%s = %s" % (name, `getattr(self.metadata, method)()`)
data.append(cmd)
# write the config file
util.execute(write_file, (filename, data),
"creating %s" % filename, self.verbose>=1, self.dry_run)