Remove support for system configuration file.

This commit is contained in:
Bastian Kleineidam 2011-05-20 21:10:31 +02:00
parent ce88b073d7
commit e3bb574997
21 changed files with 1680 additions and 1255 deletions

View file

@ -1,6 +1,6 @@
# Sample resource file; see the linkcheckerrc(5) man page or
# Sample configuration file; see the linkcheckerrc(5) man page or
# execute linkchecker -h for help on these options.
# Commandline options override these settings.
# Commandline or GUI options override these settings.
##################### output configuration ##########################
[output]

View file

@ -12,10 +12,13 @@ configure|reconfigure|abort-upgrade|abort-remove|abort-deconfigure)
;;
esac
# move old logfile
# move old system conffile
if [ -f /etc/linkcheckerrc ]; then
mv -f /etc/linkcheckerrc /etc/linkchecker/linkcheckerrc.old || true
fi
# remove system conffile for versions >= 7.0
dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@"
#DEBHELPER#

View file

@ -1,10 +1,8 @@
#!/bin/sh
#!/bin/sh -e
# postrm script for linkchecker
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
@ -30,5 +28,7 @@ if [ "$1" = "purge" ]; then
rm -rf /usr/lib/python2.4/site-packages/linkcheck
fi
fi
# remove system conffile for versions >= 7.0
dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@"
exit 0

34
debian/linkchecker.preinst vendored Normal file
View file

@ -0,0 +1,34 @@
#!/bin/sh -e
# preinst script for linkchecker
#
# see: dh_installdeb(1)
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
# remove system conffile for versions >= 7.0
dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@"
exit 0

View file

@ -19,9 +19,11 @@ Changes:
Closes: SF bug #3302498
- doc: Document the ability to search for URLs with --warning-regex.
Closes: SF bug #3297248
- checking: Support for a system configuration file has been removed.
There is now only one user-configurable configuration file.
Features:
- logging: Colorize result in text logger.
- logging: Colorize number of errors in text output logger.
6.9 "Cowboy Bebop" (released 6.5.2011)

1249
doc/de.po

File diff suppressed because it is too large Load diff

View file

@ -56,9 +56,8 @@ Erzeuge einen Sitemap Graphen und konvertiere ihn mit dem graphviz dot Programm:
Hilfe! Gebe Gebrauchsanweisung für dieses Programm aus.
.TP
\fB\-f\fP\fIDATEINAME\fP, \fB\-\-config=\fP\fIDATEINAME\fP
Benutze \fIDATEINAME\fP als Konfigurationsdatei. Standardmäßig sucht
LinkChecker zuerst nach \fB/etc/linkchecker/linkcheckerrc\fP und dann
\fB~/.linkchecker/linkcheckerrc\fP.
Benutze \fIDATEINAME\fP als Konfigurationsdatei. Standardmäßig benutzt
LinkChecker \fB~/.linkchecker/linkcheckerrc\fP.
.TP
\fB\-t\fP\fINUMMER\fP, \fB\-\-threads=\fP\fINUMMER\fP
Generiere nicht mehr als die angegebene Anzahl von Threads. Standard Anzahl
@ -508,8 +507,7 @@ Hauptspeichers sehr groß werden. Dies könnte das Programm oder sogar das
gesamte System verlangsamen.
.
.SH DATEIEN
\fB/etc/linkchecker/linkcheckerrc\fP, \fB~/.linkchecker/linkcheckerrc\fP \-
Standardkonfigurationsdateien
\fB~/.linkchecker/linkcheckerrc\fP \- Standardkonfigurationsdatei
.br
\fB~/.linkchecker/blacklist\fP \- Standard Dateiname der blacklist Logger
Ausgabe

View file

@ -56,9 +56,8 @@ Generate a sitemap graph and convert it with the graphviz dot utility:
Help me! Print usage information for this program.
.TP
\fB\-f\fP\fIFILENAME\fP, \fB\-\-config=\fP\fIFILENAME\fP
Use \fIFILENAME\fP as configuration file. As default LinkChecker first
searches \fB/etc/linkchecker/linkcheckerrc\fP and then
\fB~/.linkchecker/linkcheckerrc\fP.
Use \fIFILENAME\fP as configuration file. As default LinkChecker
uses \fB~/.linkchecker/linkcheckerrc\fP.
.TP
\fB\-t\fP\fINUMBER\fP, \fB\-\-threads=\fP\fINUMBER\fP
Generate no more than the given number of threads. Default number
@ -515,8 +514,7 @@ of queued URLs the amount of consumed memory can become quite large. This
might slow down the program or even the whole system.
.
.SH FILES
\fB/etc/linkchecker/linkcheckerrc\fP, \fB~/.linkchecker/linkcheckerrc\fP - default
configuration files
\fB~/.linkchecker/linkcheckerrc\fP - default configuration file
.br
\fB~/.linkchecker/blacklist\fP - default blacklist logger output filename
.br

View file

@ -166,26 +166,21 @@ followed recursively. This is checked by searching for a
<p>Note that the local and FTP directory recursion reads all files in that
directory, not just a subset like <code>index.htm*</code>.</p>
<h2>Configuration files</h2>
<h2>Configuration file</h2>
<p>There are two locations where LinkChecker looks for configuration files.
The first is the system configuration file which is valid for all users.
The second is the user configuration file which can be adjusted
by the current user.</p>
<p>Each user can edit a configuration with advanced options for
checking or filtering.</p>
<p>On Unix systems the locations are</p>
<p>On Unix systems the user configuration file is at</p>
<ul>
<li><code>/etc/linkchecker/linkcheckerrc</code> (system configuration)</li>
<li><code>~/.linkchecker/linkcheckerrc</code> (user configuration)</li>
<li><code>~/.linkchecker/linkcheckerrc</code></li>
</ul>
<p>On Windows the locations are</p>
<p>On Windows the user configuration file is at</p>
<ul>
<li><code>%ProgramFiles%\linkchecker\share\linkchecker\linkcheckerrc</code> (system
configuration)</li>
<li><code>%HOMEPATH%\.linkchecker\linkcheckerrc</code> (user configuration)</li>
<li><code>%HOMEPATH%\.linkchecker\linkcheckerrc</code></li>
</ul>
<hr/>
<div class="footer">

View file

@ -140,21 +140,15 @@ Note that the local and FTP directory recursion reads all files in that
directory, not just a subset like ``index.htm*``.
## Configuration files
## Configuration file
There are two locations where LinkChecker looks for configuration files.
The first is the system configuration file which is valid for all users.
The second is the user configuration file which can be adjusted
by the current user.
Each user can edit a configuration with advanced options for
checking or filtering.
On Unix systems the locations are
On Unix systems the user configuration file is at
- ``/etc/linkchecker/linkcheckerrc`` (system configuration)
- ``~/.linkchecker/linkcheckerrc`` (user configuration)
- ``~/.linkchecker/linkcheckerrc``
On Windows the locations are
- ``%ProgramFiles%\linkchecker\share\linkchecker\linkcheckerrc`` (system
configuration)
- ``%HOMEPATH%\.linkchecker\linkcheckerrc`` (user configuration)
On Windows the user configuration file is at
- ``%HOMEPATH%\.linkchecker\linkcheckerrc``

View file

@ -43,9 +43,11 @@ A negative depth will enable infinite recursion.</p>
<p>Log debugging output for each check.
It can be displayed with Help->Show Debug</p>
<h2>Configuration files</h2>
<h2>Configuration file</h2>
<p>The configuration files can be edited with an integrated text editor.</p>
<p>The configuration file can be edited with an integrated text editor.
It holds advanced options for checking and filtering that cannot
be set directly in the GUI.</p>
<hr/>
<div class="footer">
&copy; Copyright 2011, Bastian Kleineidam.

View file

@ -15,5 +15,7 @@ Log all checked URLs once. Default is to log only errors and warnings.
Log debugging output for each check.
It can be displayed with Help->Show Debug
## Configuration files
The configuration files can be edited with an integrated text editor.
## Configuration file
The configuration file can be edited with an integrated text editor.
It holds advanced options for checking and filtering that cannot
be set directly in the GUI.

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,13 @@
Upgrading
=========
Migrating from 6.x to 7.0
-------------------------
The system configuration file support has been removed.
There is now only one user-configurable configuration file.
On Unix systems it is at $HOME/.linkchecker/linkcheckerrc
and on Windows systems at %HOMEPATH%\.linkchecker/linkcheckerrc
Migrating from 6.6 to 6.7
-------------------------
The machine readable output formats xml, csv and sql now report

View file

@ -48,10 +48,8 @@ def get_install_data ():
def get_config_dir ():
"""Return absolute path of LinkChecker configuration directory."""
if main_is_frozen():
return os.path.join(module_path(), "share", "linkchecker")
return configdata.config_dir
"""Return absolute path of LinkChecker example configuration."""
return os.path.join(get_install_data(), "share", "linkchecker")
# application log areas

View file

@ -274,7 +274,7 @@ class Configuration (dict):
else:
cfiles = files[:]
if not cfiles:
cfiles.extend(get_standard_config_files())
cfiles.append(get_user_config())
# weed out invalid files
cfiles = [f for f in cfiles if os.path.isfile(f)]
log.debug(LOG_CHECK, "reading configuration from %s", cfiles)
@ -417,25 +417,26 @@ class Configuration (dict):
self["proxy"]["ftp"] = ftp_proxy
def get_standard_config_files ():
"""Try to generate user configuration file from the system wide
configuration.
Returns tuple (system config file, user config file)."""
# system wide config settings
syspath = normpath(os.path.join(get_config_dir(), "linkcheckerrc"))
def get_user_config():
"""Find user configuration file.
Generate user configuration file from the example configuration
if it does not yet exist.
Returns path to user config file"""
# example config
exampleconf = normpath(os.path.join(get_config_dir(), "linkcheckerrc"))
# per user config settings
userpath = normpath("~/.linkchecker/linkcheckerrc")
if os.path.isfile(syspath) and not os.path.exists(userpath):
userconf = normpath("~/.linkchecker/linkcheckerrc")
if os.path.isfile(exampleconf) and not os.path.exists(userconf):
# copy the system configuration to the user configuration
try:
userdir = os.path.dirname(userpath)
userdir = os.path.dirname(userconf)
if not os.path.exists(userdir):
os.makedirs(userdir)
shutil.copy(syspath, userpath)
shutil.copy(exampleconf, userconf)
except StandardError:
log.warn(LOG_CHECK, "could not copy system config from %r to %r",
syspath, userpath, traceback=True)
return (syspath, userpath)
log.warn(LOG_CHECK, "could not copy example config from %r to %r",
exampleconf, userconf, traceback=True)
return userconf
def get_gconf_http_proxy ():

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/options.ui'
#
# Created: Thu May 19 20:11:50 2011
# Created: Fri May 20 20:24:08 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
@ -18,7 +18,7 @@ class Ui_Options(object):
def setupUi(self, Options):
Options.setObjectName(_fromUtf8("Options"))
Options.setWindowModality(QtCore.Qt.ApplicationModal)
Options.resize(264, 229)
Options.resize(275, 229)
self.verticalLayout = QtGui.QVBoxLayout(Options)
self.verticalLayout.setSpacing(2)
self.verticalLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
@ -130,35 +130,28 @@ class Ui_Options(object):
self.verticalLayout_4 = QtGui.QVBoxLayout(self.frame_2)
self.verticalLayout_4.setSpacing(4)
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.label_6 = QtGui.QLabel(self.frame_2)
self.label_6.setToolTip(_fromUtf8(""))
self.label_6.setObjectName(_fromUtf8("label_6"))
self.verticalLayout_4.addWidget(self.label_6)
self.sys_config_button = QtGui.QPushButton(self.frame_2)
self.sys_config_button.setEnabled(False)
self.sys_config_button.setToolTip(_fromUtf8(""))
self.sys_config_button.setObjectName(_fromUtf8("sys_config_button"))
self.verticalLayout_4.addWidget(self.sys_config_button)
self.label_7 = QtGui.QLabel(self.frame_2)
self.user_config_label = QtGui.QLabel(self.frame_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth())
self.label_7.setSizePolicy(sizePolicy)
self.label_7.setFrameShape(QtGui.QFrame.NoFrame)
self.label_7.setLineWidth(0)
self.label_7.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft)
self.label_7.setWordWrap(True)
self.label_7.setMargin(0)
self.label_7.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
self.label_7.setObjectName(_fromUtf8("label_7"))
self.verticalLayout_4.addWidget(self.label_7)
sizePolicy.setHeightForWidth(self.user_config_label.sizePolicy().hasHeightForWidth())
self.user_config_label.setSizePolicy(sizePolicy)
self.user_config_label.setFrameShape(QtGui.QFrame.NoFrame)
self.user_config_label.setLineWidth(0)
self.user_config_label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.user_config_label.setWordWrap(True)
self.user_config_label.setMargin(0)
self.user_config_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
self.user_config_label.setObjectName(_fromUtf8("user_config_label"))
self.verticalLayout_4.addWidget(self.user_config_label)
self.user_config_button = QtGui.QPushButton(self.frame_2)
self.user_config_button.setEnabled(False)
self.user_config_button.setToolTip(_fromUtf8(""))
self.user_config_button.setObjectName(_fromUtf8("user_config_button"))
self.verticalLayout_4.addWidget(self.user_config_button)
self.verticalLayout_5.addWidget(self.frame_2)
spacerItem = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
self.verticalLayout_5.addItem(spacerItem)
self.tabWidget.addTab(self.config_options, _fromUtf8(""))
self.verticalLayout.addWidget(self.tabWidget)
@ -178,12 +171,9 @@ class Ui_Options(object):
self.label_4.setText(_("Debug"))
self.closeButton.setText(_("Close"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.gui_options), _("GUI options"))
self.label_9.setText(_("The configuration files can be edited with an integrated text editor."))
self.label_6.setText(_("System configuration file"))
self.sys_config_button.setText(_("Edit"))
self.label_7.setToolTip(_("Overrides system wide configuration file settings."))
self.label_7.setText(QtGui.QApplication.translate("Options", "User configuration file\n"
"(overrides system configuration)", None, QtGui.QApplication.UnicodeUTF8))
self.label_9.setText(_("The user configuration file holds advanced options and can be edited with an integrated text editor."))
self.user_config_label.setToolTip(_("Overrides system wide configuration file settings."))
self.user_config_label.setText(_("/home/user/.linkchecker/linkcheckerrc"))
self.user_config_button.setText(_("Edit"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.config_options), _("Configuration files"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.config_options), _("Configuration file"))

View file

@ -31,14 +31,12 @@ class LinkCheckerOptions (QtGui.QDialog, Ui_Options):
self.setupUi(self)
self.editor = EditorWindow(self)
self.closeButton.clicked.connect(self.close)
self.sys_config_button.clicked.connect(self.edit_sys_config)
self.user_config_button.clicked.connect(self.edit_user_config)
self.reset()
def reset (self):
"""Reset GUI and config options."""
files = configuration.get_standard_config_files()
self.sys_config, self.user_config = files
self.user_config = configuration.get_user_config()
self.reset_gui_options()
self.reset_config_options()
@ -50,18 +48,10 @@ class LinkCheckerOptions (QtGui.QDialog, Ui_Options):
def reset_config_options (self):
"""Reset configuration file edit buttons."""
self.sys_config_writable = os.access(self.sys_config, os.W_OK)
self.user_config_writable = os.access(self.user_config, os.W_OK)
set_edit_button(self.sys_config, self.sys_config_button,
self.sys_config_writable)
set_edit_button(self.user_config, self.user_config_button,
self.user_config_writable)
def edit_sys_config (self):
"""Show editor for system wide configuration file."""
return start_editor(self.sys_config, self.sys_config_writable,
self.editor)
def edit_user_config (self):
"""Show editor for user specific configuration file."""
return start_editor(self.user_config, self.user_config_writable,

View file

@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<width>275</width>
<height>229</height>
</rect>
</property>
@ -210,7 +210,7 @@
<string/>
</property>
<attribute name="title">
<string>Configuration files</string>
<string>Configuration file</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
@ -219,7 +219,7 @@
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>The configuration files can be edited with an integrated text editor.</string>
<string>The user configuration file holds advanced options and can be edited with an integrated text editor.</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
@ -245,30 +245,7 @@
<number>4</number>
</property>
<item>
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string extracomment="Test"/>
</property>
<property name="text">
<string>System configuration file</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="sys_config_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<widget class="QLabel" name="user_config_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -285,11 +262,10 @@
<number>0</number>
</property>
<property name="text">
<string>User configuration file
(overrides system configuration)</string>
<string>/home/user/.linkchecker/linkcheckerrc</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -318,6 +294,22 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>60</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>

531
po/de.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff