Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 211 → Rev 212

/relevation/branches/1.2/CHANGELOG
3,11 → 3,13
1.2 (2013-10):
- Bugfix: Make case-insensitive search work on uppercase search
strings
- Print "notes" field
- Print "notes"
- Allow searches with "AND" operator:
- OR is used by default, as in previous versions
- New command-line flags: --and / -A and --or / -O
- New config file option: mode (possibles values 'and' and 'or')
- Use getpass when asking for a password to suspend echoing it (suggested
by Jorge Gallegos)
 
1.1 (2011-07-13):
- Support cryptopy if PyCrypto is not available. Enhances
/relevation/branches/1.2/relevation.py
12,10 → 12,11
http://oss.wired-networks.net/bugzilla/show_bug.cgi?id=111
-> http://web.archive.org/http://oss.wired-networks.net/bugzilla/show_bug.cgi?id=111
(ref3) http://docs.python.org/library/zlib.html
(ref4) http://pymotw.com/2/getpass/
"""
# Relevation Password Printer
#
# Copyright (c) 2011,2012 Toni Corvera
# Copyright (c) 2011,2012,2013 Toni Corvera
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
41,6 → 42,7
 
import ConfigParser
import getopt
import getpass
from lxml import etree
import os
import stat
70,7 → 72,7
__revision__ = '$Rev$'
__version_info__ = ( 1, 2 ) #, 0 )
__version__ = '.'.join(map(str, __version_info__))
RELEASE=True
RELEASE=not True
 
# These are pseudo-standardized exit codes, in Linux (*NIX?) they are defined
#+in the header </usr/include/sysexits.h> and available as properties of 'os'
380,10 → 382,16
elif opt in ( '-p', '--password' ):
password = arg
elif opt in ( '-a', '--ask', '-0', '--stdin' ):
prompt = ''
if opt in ( '-a', '--ask' ):
printen('File password: ')
password = sys.stdin.readline()
password = password[:-1]
prompt = 'File password: '
# see [ref4]
if sys.stdin.isatty():
password = getpass.getpass(prompt=prompt, stream=sys.stderr)
else:
# Not a terminal, getpass won't work
password = sys.stdin.readline();
password = password[:-1] # XXX: would .rstrip() be safe enough?
elif opt in ( '-s', '--search' ):
needles.append(arg)
elif opt in ( '-i', '--case-insensitive' ):