Changeset 165:6811f8d6cb25

Show
Ignore:
Timestamp:
08/23/07 15:23:15 (14 months ago)
Author:
mercurial@…
Message:

merge

Files:
9 modified

Legend:

Unmodified
Added
Removed
  • cachers/cached_image.py

    r142 r165  
    55from StringIO import StringIO 
    66 
    7 logging.basicConfig(level=logging.DEBUG, 
    8                     format='%(asctime)s %(levelname)s %(message)s', 
    9                     filename='cached.log', 
    10                     filemode='w') 
     7#logging.basicConfig(level=logging.DEBUG, 
     8#                    format='%(asctime)s %(levelname)s %(message)s', 
     9#                    filename='cached.log', 
     10#                    filemode='w') 
    1111 
    1212console = logging.StreamHandler() 
  • cachers/thumbnail.py

    r139 r165  
    2727def _new_size(image, width, height, scale): 
    2828    """calculate new size""" 
     29    if width == -1: 
     30        width = None 
     31    if height == -1: 
     32        height = None   
    2933    img_width, img_height = image.size 
    3034    if width is None and height is None and scale is None: 
    3135        return image.size 
     36 
     37    if width is not None and height is not None: 
     38        return width, height 
    3239 
    3340    if width is not None or height is not None: 
     
    4956    width, height = _new_size(image, width, height, scale) 
    5057 
    51     image.thumbnail((width, height), Image.ANTIALIAS) 
     58    #image.thumbnail((width, height), Image.ANTIALIAS) 
     59    #image.resize((width, height), Image.ANTIALIAS) 
     60    image.load() 
     61    image = image._new(image.im.stretch((width, height), Image.NEAREST)) 
    5262 
    5363    data = StringIO() 
  • mailer/run.py

    r140 r165  
    1111 
    1212 
    13 logging.basicConfig(level=logging.DEBUG, 
    14                     format='%(asctime)s %(levelname)s %(message)s', 
    15                     filename=os.path.join(curdir, 'mailer.log'), 
    16                     filemode='w') 
     13#logging.basicConfig(level=logging.DEBUG, 
     14#                   format='%(asctime)s %(levelname)s %(message)s', 
     15#                    filename=os.path.join(curdir, 'mailer.log'), 
     16#                    filemode='w') 
    1717 
    1818console = logging.StreamHandler() 
  • mailer/settings.py

    r147 r165  
    11 
    22DATABASE = 'postgres://chainon:chainon@localhost/chainon' 
    3 SMTP_SERVER = 'smtp.neuf.fr' 
     3SMTP_SERVER = 'localhost' 
    44 
  • neighbors/config.py

    r133 r165  
    11 
    2 db = 'postgres://chainon:chainon@localhost/chainon' 
     2db = 'postgres://chainon:chainon@localhost/chainon_fr' 
    33 
    44tag_retriever = 'select label from items_tag' 
  • neighbors/neighbours.py

    r130 r165  
    1313 
    1414def compute(): 
    15  
    1615    # tags 
    1716    tags = [res[0] for res in query(tag_retriever)] 
  • xap/run.py

    r140 r165  
    1212logging.basicConfig(level=logging.DEBUG, 
    1313                    format='%(asctime)s %(levelname)s %(message)s', 
    14                     filename=os.path.join(curdir, 'xap.log'), 
    15                     filemode='w') 
     14                    filename=os.path.join(curdir, '/home/tarek/data/xap.log'), 
     15                    filemode='a') 
    1616 
    1717console = logging.StreamHandler() 
     
    2626    if len(sys.argv) > 1: 
    2727        settings.SQLURI = sys.argv[1] 
    28  
    2928    from xapindexer import start_server 
    3029    from xapindexer import stop_server 
    3130 
    3231    logging.debug('running xapian server') 
    33     start_server() 
    34  
     32    try: 
     33        start_server() 
     34    except Exception, e: 
     35        logging.debug('failed to start %s' % str(e)) 
     36        raise e 
     37                         
    3538    while True: 
    3639        try: 
  • xap/searcher.py

    r148 r165  
    55from tokenizer import tokenize 
    66from settings import DB_FILE 
     7 
     8curdir = os.path.dirname(__file__) 
     9if curdir == '': 
     10    curdir = '.' 
     11 
     12curdir = os.path.realpath(curdir) 
     13 
     14logging.basicConfig(level=logging.DEBUG, 
     15                    format='%(asctime)s %(levelname)s %(message)s', 
     16                    filename=os.path.join(curdir, '/home/tarek/data/xap.log'), 
     17                    filemode='a') 
    718 
    819def read_only(): 
     
    4051    """search""" 
    4152    logging.debug('searching for "%s"' % query) 
    42  
     53    logging.debug('opening db file in read mode') 
    4354    db = read_only() 
     55    logging.debug('db file in read mode opened') 
    4456    query = tokenize([query]) 
    4557    enquire = xapian.Enquire(db) 
  • xap/settings.py

    r148 r165  
    66curdir = os.path.realpath(curdir) 
    77 
    8 DB_FILE = os.path.join(curdir, 'data', 'chainon.xap') 
     8#DB_FILE = os.path.join(curdir, 'data', 'chainon.xap') 
     9 
     10DB_FILE = '/home/tarek/data' 
    911 
    1012SQLURI = 'postgres://chainon:chainon@localhost/chainon'