Example #1
0
def main():
    parser = OptionParser(
        usage='mtop.py [options]\nSee also: https://github.com/beaufour/mtop')
    parser.add_option('-s',
                      '--server',
                      dest='server',
                      default='localhost',
                      help='connect to mongo on SERVER',
                      metavar='SERVER')
    parser.add_option('-d',
                      '--delay',
                      dest='delay',
                      type=int,
                      default=1000,
                      help='update every MS',
                      metavar='MS')

    (options, _) = parser.parse_args()

    connection = get_connection(options.server)
    if not connection:
        print('Connection to %s failed' % (options.server))
        return -1
    runner = Runner(connection, options.delay)

    rc = runner.run()

    if rc == -3:
        print('Screen size too small')

    return rc
Example #2
0
def main():
    parser = OptionParser(usage="mtop.py [options]\nSee also: https://github.com/beaufour/mtop")
    parser.add_option(
        "-s", "--server", dest="server", default="localhost", help="connect to mongo on SERVER", metavar="SERVER"
    )
    parser.add_option("-d", "--delay", dest="delay", type=int, default=1000, help="update every MS", metavar="MS")

    (options, _) = parser.parse_args()

    connection = get_connection(options.server)
    if not connection:
        print("Connection to %s failed" % (options.server))
        return -1
    runner = Runner(connection, options.delay)

    rc = runner.run()

    if rc == -3:
        print("Screen size too small")

    return rc
Example #3
0
 def setUp(self):
     connection = get_connection('localhost')
     self._mongo_ops = MongoOps(connection)
Example #4
0
File: ops.py Project: beaufour/mtop
 def setUp(self):
     connection = get_connection("localhost")
     self._mongo_ops = MongoOps(connection)