some source code about twisted

This commit is contained in:
JamesonHuang
2015-06-15 22:20:58 +08:00
parent 8791e644e5
commit dff86defdb
1113 changed files with 407155 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# This makes sure that users don't have to set up their environment
# specially in order to run these programs from bin/.
# This helper is shared by many different actual scripts. It is not intended to
# be packaged or installed, it is only a developer convenience. By the time
# Twisted is actually installed somewhere, the environment should already be set
# up properly without the help of this tool.
import sys, os
path = os.path.abspath(sys.argv[0])
while os.path.dirname(path) != path:
if os.path.exists(os.path.join(path, 'twisted', '__init__.py')):
sys.path.insert(0, path)
break
path = os.path.dirname(path)

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.conch.scripts.cftp import run
run()

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.conch.scripts.ckeygen import run
run()

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.conch.scripts.conch import run
run()

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.conch.scripts.tkconch import run
run()

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.lore.scripts.lore import run
run()

View File

@ -0,0 +1,20 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This script attempts to send some email.
"""
import sys, os
extra = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, extra)
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.remove(extra)
from twisted.mail.scripts import mailmail
mailmail.run()

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This script runs GtkManhole, a client for Twisted.Manhole
"""
import sys
try:
import _preamble
except ImportError:
sys.exc_clear()
from twisted.scripts import manhole
manhole.run()

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
try:
import _preamble
except ImportError:
sys.exc_clear()
from twisted.scripts.htmlizer import run
run()

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
tap2deb
"""
import sys
try:
__import__('_preamble')
except ImportError:
sys.exc_clear()
from twisted.scripts import tap2deb
tap2deb.run()

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# based off the tap2deb code
# tap2rpm built by Sean Reifschneider, <jafo@tummy.com>
"""
tap2rpm
"""
import sys
try:
import _preamble
except ImportError:
sys.exc_clear()
from twisted.scripts import tap2rpm
tap2rpm.run()

View File

@ -0,0 +1,18 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os, sys
try:
import _preamble
except ImportError:
sys.exc_clear()
# begin chdir armor
sys.path[:] = map(os.path.abspath, sys.path)
# end chdir armor
sys.path.insert(0, os.path.abspath(os.getcwd()))
from twisted.scripts.trial import run
run()

View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os, sys
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.insert(0, os.path.abspath(os.getcwd()))
from twisted.scripts.twistd import run
run()