[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] Change/Move file lib/TorBridgeDB.py to scripts/bridgedb.



commit 8a79e30ffaa53ccaa82787c2b6f5392612f16dac
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Tue Aug 20 00:09:30 2013 +0000

    Change/Move file lib/TorBridgeDB.py to scripts/bridgedb.
    
    It isn't actually a module, it's a two-line script. Installing it as a script
    is better, because:
    
      1) We don't need to do `python -m TorBridgeDB [â?¦]`. Instead, we just do
         `bridgedb [â?¦]` and we also get all the benefits of shell autocompletion.
    
      2) Setuptools will automatically replace the #! in the installed script to
         point to the location of the Python interpreter which was used to install
         it, making it work with alternate interpreters as well as within
         virtualenvs.
    
     * MOVE lib/TorBridgeDB.py â?? scripts/bridgedb.
     * ADD 'scripts' arguments to setuptools.setup() call.
     * UPDATE the README with instructions on how to run bridgedb now.
---
 README             |    2 +-
 lib/TorBridgeDB.py |    4 ----
 scripts/bridgedb   |    4 ++++
 setup.py           |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 6d390e4..5e5c296 100644
--- a/README
+++ b/README
@@ -224,7 +224,7 @@ Enter the following commands at the ```sqlite>``` prompt:
 ## Running BridgeDB
 To run BridgeDB, simply make any necessary changes to bridgedb.conf, and do:
 
-    python -m TorBridgeDB -c bridgedb.conf
+    bridgedb -c bridgedb.conf
 
 When you have new lists of bridges, replace the old files and send the process
 a SIGHUP.
diff --git a/lib/TorBridgeDB.py b/lib/TorBridgeDB.py
deleted file mode 100644
index 3739254..0000000
--- a/lib/TorBridgeDB.py
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/python
-
-import bridgedb.Main
-bridgedb.Main.run()
diff --git a/scripts/bridgedb b/scripts/bridgedb
new file mode 100644
index 0000000..3739254
--- /dev/null
+++ b/scripts/bridgedb
@@ -0,0 +1,4 @@
+#!/usr/bin/python
+
+import bridgedb.Main
+bridgedb.Main.run()
diff --git a/setup.py b/setup.py
index 2f72b9d..d93bd05 100644
--- a/setup.py
+++ b/setup.py
@@ -105,8 +105,8 @@ setuptools.setup(
     maintainer_email='isis@xxxxxxxxxxxxxx 0xA3ADB67A2CDB8B35',
     url='https://www.torproject.org',
     package_dir= {'' : 'lib'},
-    packages=setuptools.find_packages('lib'),
-    py_modules=['TorBridgeDB'],
+    packages=['bridgedb'],
+    scripts=['scripts/bridgedb',],
     cmdclass=get_cmdclass(),
     include_package_data=True,
     install_requires=get_requirements(),



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits