From 18b8e44dbbd2d644e377ea34e1c004cf19e378cc Mon Sep 17 00:00:00 2001 From: calvin Date: Sun, 29 Oct 2000 18:00:50 +0000 Subject: [PATCH] configuration git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@183 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/HttpsUrlData.py | 4 ++-- locale/de/LC_MESSAGES/linkcheck.po | 4 ++-- locale/fr/LC_MESSAGES/linkcheck.po | 4 ++-- setup.py | 22 ++++++++++++++-------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/linkcheck/HttpsUrlData.py b/linkcheck/HttpsUrlData.py index 0daab4dd..0baa1bc0 100644 --- a/linkcheck/HttpsUrlData.py +++ b/linkcheck/HttpsUrlData.py @@ -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): diff --git a/locale/de/LC_MESSAGES/linkcheck.po b/locale/de/LC_MESSAGES/linkcheck.po index 27b2b713..dbca0833 100644 --- a/locale/de/LC_MESSAGES/linkcheck.po +++ b/locale/de/LC_MESSAGES/linkcheck.po @@ -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" diff --git a/locale/fr/LC_MESSAGES/linkcheck.po b/locale/fr/LC_MESSAGES/linkcheck.po index 6872a601..ba2e7faa 100644 --- a/locale/fr/LC_MESSAGES/linkcheck.po +++ b/locale/fr/LC_MESSAGES/linkcheck.po @@ -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" diff --git a/setup.py b/setup.py index ce9ffabc..f3f4f141 100755 --- a/setup.py +++ b/setup.py @@ -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 # /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)