~libravatar/libravatar/master

« back to all changes in this revision

Viewing changes to libravatar/deletephoto.py

  • Committer: Francois Marier
  • Date: 2016-01-18 09:05:34 UTC
  • mto: This revision was merged to the branch mainline in revision 939.
  • Revision ID: git-v1:965cf04dbe4cdadbf7eeb027506180156599c7fb
Fix a few pylint errors and disable the rest as locally as possible

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
 
# Copyright (C) 2011, 2013  Francois Marier <francois@libravatar.org>
 
2
# Copyright (C) 2011, 2013, 2016  Francois Marier <francois@libravatar.org>
3
3
#
4
4
# This file is part of Libravatar
5
5
#
20
20
import os
21
21
import sys
22
22
 
23
 
# pylint: disable=W0403
 
23
# pylint: disable=relative-import
24
24
import settings
25
25
from utils import create_logger, delete_if_exists, is_hex
26
26
 
27
27
os.umask(022)
28
 
logger = create_logger('deletephoto')
 
28
LOGGER = create_logger('deletephoto')
29
29
 
30
30
 
31
31
def main(argv=None):
40
40
 
41
41
    # Validate inputs
42
42
    if not is_hex(file_hash):
43
 
        logger.error('file_hash is not a hexadecimal value')
 
43
        LOGGER.error('file_hash is not a hexadecimal value')
44
44
        return 1
45
45
    if file_format != 'jpg' and file_format != 'png' and file_format != 'gif':
46
 
        logger.error('file_format is not recognized')
 
46
        LOGGER.error('file_format is not recognized')
47
47
        return 1
48
48
 
49
49
    filename = "%s.%s" % (file_hash, file_format)