Skip to content

Commit

Permalink
Minor changes in some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Apr 7, 2016
1 parent f20e16b commit 3997b7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions scripts/borme_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


import bormeparser
import bormeparser.borme
import bormeparser.backends.pypdf2.functions
import logging
import sys
Expand All @@ -29,7 +28,7 @@

if __name__ == '__main__':

# set logger DEBUG
# set logger DEBUG (Not working)
if len(sys.argv) == 3 and sys.argv[2] == '--debug':
bormeparser.borme.logger.setLevel(logging.DEBUG)
bormeparser.backends.pypdf2.functions.logger.setLevel(logging.DEBUG) # FIXME: DEFAULT_PARSER
Expand Down
3 changes: 1 addition & 2 deletions scripts/borme_info_num.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


import bormeparser
import bormeparser.borme
import bormeparser.backends.pypdf2.functions
from bormeparser.exceptions import BormeAnuncioNotFound
import logging
Expand Down Expand Up @@ -50,5 +49,5 @@
print(' Datos registrales')
print(' %s' % anuncio.datos_registrales)
except BormeAnuncioNotFound:
print('No existe el anuncio %s' % id)
print('No existe el anuncio {}. Elije uno entre {} y {}.'.format(id, borme.anuncios_rango[0], borme.anuncios_rango[1]))
print()
7 changes: 4 additions & 3 deletions scripts/borme_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


import bormeparser
import bormeparser.borme
import bormeparser.backends.pypdf2.functions
import logging
import os
import sys
Expand All @@ -28,12 +28,13 @@
if __name__ == '__main__':

if len(sys.argv) == 1:
print('Usage: %s <filename.pdf> [--debug]')
print('Usage: {} <filename.pdf> [--debug]'.format(sys.argv[0]))
sys.exit(1)

# set logger DEBUG
# set logger DEBUG (Not working)
if len(sys.argv) == 3 and sys.argv[2] == '--debug':
bormeparser.borme.logger.setLevel(logging.DEBUG)
bormeparser.backends.pypdf2.functions.logger.setLevel(logging.DEBUG) # FIXME: DEFAULT_PARSER

# filename
filename = os.path.basename(sys.argv[1]).replace('.pdf', '.json')
Expand Down

0 comments on commit 3997b7a

Please sign in to comment.