[bridgedb/master] Rename bridgedb.Main.startup â bridgedb.Main.run.
isis at torproject.org
isis at torproject.org
Sat Mar 21 02:02:57 UTC 2015
commit ddbe8c8b0d59930694c8c057581c6e5b0bdc9264
Author: Isis Lovecruft <isis at torproject.org>
Date: Fri Aug 29 00:09:32 2014 +0000
Rename bridgedb.Main.startup â bridgedb.Main.run.
* REMOVE old `bridgedb.Main.run` function, which did nothing but call
`bridgedb.Main.startup` and act as the entry point into BridgeDB's main run
loop in `scripts/bridgedb`.
* RENAME `bridgedb.Main.startup` to `bridgedb.Main.run` so that it is now the
default entry point.
* UPDATE docstring for `bridgedb.Main.run`.
* UPDATE docstring for `bridgedb.configure.loadConfig`, which referenced the
now removed `bridgedb.Main.startup`.
---
lib/bridgedb/Main.py | 21 ++++++---------------
lib/bridgedb/configure.py | 17 +++++++++--------
2 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index a3c88d9..ce3edc5 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -275,8 +275,12 @@ def createBridgeRings(cfg, proxyList, key):
return splitter, emailDistributor, ipDistributor
-def startup(options):
- """Parse bridges,
+def run(options):
+ """This is BridgeDB's main entry point and main runtime loop.
+
+ Given the parsed commandline options, this function handles locating the
+ configuration file, loading and parsing it, and then either (re)parsing
+ plus (re)starting the servers, or dumping bridge assignments to files.
:type options: :class:`bridgedb.parse.options.MainOptions`
:param options: A pre-parsed options class containing any arguments and
@@ -544,16 +548,3 @@ def runSubcommand(options, config):
logging.info("Subcommand '%s' finished with status %s."
% (options.subCommand, statuscode))
sys.exit(statuscode)
-
-def run(options):
- """This is the main entry point into BridgeDB.
-
- Given the parsed commandline options, this function handles locating the
- configuration file, loading and parsing it, and then either
- starting/reloading the servers or dumping bridge assignments to files.
-
- :type options: :class:`bridgedb.parse.options.MainOptions`
- :param options: A pre-parsed options class containing any arguments and
- options given in the commandline we were called with.
- """
- startup(options)
diff --git a/lib/bridgedb/configure.py b/lib/bridgedb/configure.py
index 731b599..e67a252 100644
--- a/lib/bridgedb/configure.py
+++ b/lib/bridgedb/configure.py
@@ -40,14 +40,15 @@ def loadConfig(configFile=None, configCls=None):
.. _default: http://stackoverflow.com/q/17470193
.. _faster: http://lucumr.pocoo.org/2011/2/1/exec-in-python/
- :ivar boolean itsSafeToUseLogging: This is called in :func:`startup`
- before :func:`safelog.configureLogging`. When called from ``startup``,
- the ``configCls`` parameter is not given, because that is the first
- time that a :class:`Conf` is created. If a :class:`logging.Logger` is
- created in this function, then logging will not be correctly
- configured, therefore, if the ``configCls`` parameter is not given,
- then it's the first time this function has been called and it is
- therefore not safe to make calls to the logging module.
+ :ivar boolean itsSafeToUseLogging: This is called in
+ :func:`~bridgedb.Main.run` before
+ :func:`bridgedb.safelog.configureLogging`. When called from
+ :func:`~bridgedb.Main.run`, the **configCls** parameter is not given,
+ because that is the first time that a :class:`Conf` is created. If a
+ :class:`logging.Logger` is created in this function, then logging will
+ not be correctly configured, therefore, if the **configCls** parameter
+ is not given, then it's the first time this function has been called
+ and it is therefore not safe to make calls to the logging module.
:type: configFile: string or None
:param configFile: If given, the filename of the config file to load.
:type configCls: :class:`Conf` or None
More information about the tor-commits
mailing list