Browse Source

Support running 'dulwich.server' and 'dulwich.web' using 'python -m'.

Jelmer Vernooij 11 years ago
parent
commit
49446c498a
3 changed files with 11 additions and 0 deletions
  1. 3 0
      NEWS
  2. 4 0
      dulwich/server.py
  3. 4 0
      dulwich/web.py

+ 3 - 0
NEWS

@@ -29,6 +29,9 @@
 
   * Add paramiko-based SSH vendor. (Aaron O'Mullan)
 
+  * Support running 'dulwich.server' and 'dulwich.web' using 'python -m'.
+    (Jelmer Vernooij)
+
  API CHANGES
 
   * SSHVendor.connect_ssh has been renamed to SSHVendor.run_command.

+ 4 - 0
dulwich/server.py

@@ -851,3 +851,7 @@ def update_server_info(repo):
 
     repo._put_named_file(os.path.join('objects', 'info', 'packs'),
         "".join(generate_objects_info_packs(repo)))
+
+
+if __name__ == '__main__':
+    main()

+ 4 - 0
dulwich/web.py

@@ -480,3 +480,7 @@ except ImportError:
         sys.stderr.write(
             'Sorry, the wsgiref module is required for dul-web.\n')
         sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()