Skip to content

Commit

Permalink
Move version number & add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
sorz committed Jan 11, 2017
1 parent 1c368a3 commit 918b8e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#!/usr/bin/env python2
from setuptools import setup, Extension

from sstpd import __version__ as version


with open('README.rst') as readme:
long_description = readme.read()

fcsmodule = Extension('sstpd.codec', sources=['sstpd/codecmodule.c'])

setup(
name='sstp-server',
version='0.3.6',
version=version,
description='Secure Socket Tunneling Protocol (SSTP) VPN server.',
author='Sorz',
author_email='orz@sorz.org',
author='Shell Chen',
author_email='me@sorz.org',
url='https://github.com/sorz/sstp-server',
packages=['sstpd'],
ext_modules = [fcsmodule],
entry_points="""
[console_scripts]
sstpd = sstpd:main
sstpd = sstpd:run
""",
install_requires=[
'twisted', 'service_identity', 'argparse', 'py2-ipaddress'
Expand Down
10 changes: 9 additions & 1 deletion sstpd/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
from __main__ import main
"""A Secure Socket Tunneling Protocol (SSTP) server.
https://github.com/sorz/sstp-server
"""
__version__ = '0.3.7'


def run():
from __main__ import main
main()
13 changes: 7 additions & 6 deletions sstpd/__main__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python2
from __future__ import absolute_import, print_function
import sys
import logging
import argparse
from ConfigParser import SafeConfigParser, NoSectionError
from twisted.internet.endpoints import SSL4ServerEndpoint
from twisted.internet import reactor, ssl

from sstp import SSTPProtocolFactory
from address import IPPool
from . import __doc__
from .sstp import SSTPProtocolFactory
from .address import IPPool


def _getArgs():
conf_parser = argparse.ArgumentParser(
description='A Secure Socket Tunneling Protocol (SSTP) server.',
epilog='Author: Sorz <orz@sorz.org>.',
add_help=False)
conf_parser.add_argument("-f", "--conf-file",
help="Specify config file.", metavar="FILE")
Expand All @@ -30,11 +30,12 @@ def _getArgs():
defaults = dict(config.items(args.conf_section))
except NoSectionError as e:
print('Error: section [%s] not found in config file.' % \
args.conf_section)
args.conf_section, file=sys.stderr)
sys.exit(1)
return

parser = argparse.ArgumentParser(parents=[conf_parser])
parser = argparse.ArgumentParser(parents=[conf_parser],
description=__doc__)
parser.set_defaults(**defaults)
parser.add_argument('-l', '--listen',
default='',
Expand Down

0 comments on commit 918b8e8

Please sign in to comment.