Conjunto de mudanças 4426 no repositório publico


Ignorar:
Timestamp:
08/03/2010 17:54:25 (10 anos atrás)
Autor:
camilocarlos
Mensagem:

Corrigindo script de inicialização do server

Localização:
webscan/libs/imagescanner
Arquivos:
3 editados

Legenda:

Não Modificado
Adicionado
Removido
  • webscan/libs/imagescanner/imagescanner/core/server.py

    r4419 r4426  
    2424        return Binary(image_data.read())
    2525   
    26 def runserver(port):
     26def run(port):
    2727    from twisted.internet import reactor
    2828   
  • webscan/libs/imagescanner/scripts/imagescanner-server.py

    r4419 r4426  
    1 from twisted.application import internet, service
    2 from twisted.web import server
    3 from imagescanner.core.server import ScannerDevices
    4 from imagescanner import settings
     1#!/usr/bin/env python
    52
    6 PORT = getattr(settings, 'SERVER_PORT', 8000)
     3import sys
     4import logging
     5from imagescanner.core import server
     6from optparse import OptionParser
    77
    8 factory = ScannerDevices()
     8parser = OptionParser()
     9parser.add_option("-p", "--port", dest="port", default=8000,
     10                  help="server port (default: 8000)")
    911
    10 # this is the important bit
    11 application = service.Application('scanner-device')
    12 scanningService = internet.TCPServer(PORT, server.Site(factory))
    13 # add the service to the application
    14 scanningService.setServiceParent(application)
     12(options, args) = parser.parse_args()
     13
     14port = int(options.port)
     15
     16logging.info('starting imagescanner server on port %s' % port)
     17logging.info('waiting for connections...')
     18server.run(port)
     19
  • webscan/libs/imagescanner/setup.py

    r4419 r4426  
    44
    55setup(name='imagescanner',
    6       version='0.8',
     6      version='0.8.1',
    77      description='Multi-platform Python library to access scanner devices.',
    88      author='Sergio Campos',
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.