Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of github.com:wonlay/sin

  • Loading branch information...
commit d5536ebdcb9b7f6720101a697c7af3ec54463194 2 parents 2cd1ea0 + 10f2066
rbelkin authored
6 client/python/setup.py
@@ -7,9 +7,9 @@
7 7 version='0.1-SNAPSHOT',
8 8 description='This library implements a Sin client',
9 9 url='https://github.com/wonlay/sin',
10   - packages=['sinClient'],
11   - package_dir={'sinClient': 'src/sinClient'},
12   - package_data={'sinClient': ['data/test.json']},
  10 + packages=['sin'],
  11 + package_dir={'sin': 'src/sin'},
  12 + package_data={'sin': ['data/test.json']},
13 13 classifiers=[
14 14 "Development Status :: 3 - Alpha",
15 15 "Topic :: Service",
0  client/python/src/sinClient/__init__.py → client/python/src/sin/__init__.py
File renamed without changes
0  client/python/src/sinClient/data/test.json → client/python/src/sin/data/test.json
File renamed without changes
0  client/python/src/sinClient/kafka.py → client/python/src/sin/kafka.py
File renamed without changes
0  client/python/src/sinClient/senseiClient.py → client/python/src/sin/senseiClient.py
File renamed without changes
0  client/python/src/sinClient/sinClient.py → client/python/src/sin/sinClient.py
File renamed without changes
72 shell/sin_shell.py
... ... @@ -0,0 +1,72 @@
  1 +#!/usr/bin/env python
  2 +# Licensed under the Apache License, Version 2.0 (the "License"); you may
  3 +# not use this file except in compliance with the License. You may obtain
  4 +# a copy of the License at
  5 +#
  6 +# http://www.apache.org/licenses/LICENSE-2.0
  7 +#
  8 +# Unless required by applicable law or agreed to in writing, software
  9 +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  10 +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  11 +# License for the specific language governing permissions and limitations
  12 +# under the License.
  13 +
  14 +"""Sin Shell
  15 +"""
  16 +import sys
  17 +import datetime
  18 +import logging
  19 +
  20 +from sin.sinClient import SinClient
  21 +
  22 +logger = logging.getLogger("sin_client")
  23 +
  24 +
  25 +def main(argv):
  26 + print "Welcome to Sin Shell"
  27 + from optparse import OptionParser
  28 + usage = "usage: %prog [options]"
  29 + parser = OptionParser(usage=usage)
  30 + parser.add_option("-w", "--column-width", dest="max_col_width",default=100, help="Set the max column width")
  31 + parser.add_option("-v", "--verbose", action="store_true", dest="verbose",default=False, help="Turn on verbose mode")
  32 + (options, args) = parser.parse_args()
  33 +
  34 + if options.verbose:
  35 + logger.setLevel(logging.DEBUG)
  36 + else:
  37 + logger.setLevel(logging.INFO)
  38 +
  39 + formatter = logging.Formatter("%(asctime)s %(filename)s:%(lineno)d - %(message)s")
  40 + stream_handler = logging.StreamHandler()
  41 + stream_handler.setFormatter(formatter)
  42 + logger.addHandler(stream_handler)
  43 +
  44 + host = 'localhost'
  45 + port = 8666
  46 + if len(args) > 1:
  47 + host = args[0]
  48 + port = int(args[1])
  49 + logger.debug("Url specified, host: %s, port: %d" % (host,port))
  50 + print "Url specified, host: %s, port: %d" % (host,port)
  51 + #client = SenseiClient(host, port, 'sensei')
  52 +
  53 +
  54 + print "using host=%s, port=%d" %(host,port)
  55 + import readline
  56 + readline.parse_and_bind("tab: complete")
  57 +
  58 + sinClient = SinClient(host,port)
  59 +
  60 + while 1:
  61 + try:
  62 + stmt = raw_input('> ')
  63 + if stmt == "exit":
  64 + break
  65 + else:
  66 + pass
  67 + except EOFError:
  68 + break
  69 +
  70 +
  71 +if __name__ == "__main__":
  72 + main(sys.argv)
1  start_script/mac/kafka-clean-log.sh
... ... @@ -0,0 +1 @@
  1 +rm -rf /tmp/kafka-log/*
2  start_script/mac/kafka-start.sh
... ... @@ -0,0 +1,2 @@
  1 +$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties
  2 +
1  start_script/mac/kafka-stop.sh
... ... @@ -0,0 +1 @@
  1 +$KAFKA_HOME/bin/kafka-server-stop.sh
2  start_script/mac/sin_agent.sh
... ... @@ -0,0 +1,2 @@
  1 +cd $SIN_HOME/app
  2 +python -i agent/sin_agent.py
2  start_script/mac/sin_server.sh
... ... @@ -0,0 +1,2 @@
  1 +cd $SIN_HOME/app
  2 +python manage.py runserver 0.0.0.0:8000
1  start_script/mac/zk-start.sh
... ... @@ -0,0 +1 @@
  1 +$ZK_HOME/bin/zkServer.sh start
1  start_script/mac/zk-stop.sh
... ... @@ -0,0 +1 @@
  1 +$ZK_HOME/bin/zkServer.sh stop

0 comments on commit d5536eb

Please sign in to comment.
Something went wrong with that request. Please try again.