@@ -19,7 +19,7 @@ ___________________/ /__/ /__/ /__/ /________________________________
1919
2020'''
2121
22- __version__ = '5.3.2 '
22+ __version__ = '5.4.0 '
2323
2424import re
2525import sys
@@ -28,6 +28,7 @@ import getopt
2828import warnings
2929import subprocess
3030import codecs
31+ import calendar
3132from datetime import date
3233
3334try :
@@ -94,7 +95,25 @@ OPTS_HELP = {
9495 'p' : 'append environment variables values to sys.path'
9596 }
9697
97- AUTO_REGEXPS_RES = {'clock' : re .compile ('[012]\d:[0-5]\d' )}
98+ def fillAutoRegexpsRes ():
99+ are = {}
100+ are ['clock' ] = re .compile ('[012]\d:[0-5]\d' )
101+ d = "("
102+ for i in range (7 ):
103+ d += calendar .day_abbr [i ]
104+ if i != 6 :
105+ d += '|'
106+ d += '), ('
107+ for i in range (1 , 13 ):
108+ d += calendar .month_name [i ]
109+ if i != 12 :
110+ d += '|'
111+ d += ') [0123]\d'
112+ are ['date' ] = re .compile (d , re .IGNORECASE )
113+ are ['battery' ] = re .compile ('Charging, \d\d%' )
114+ return are
115+
116+ AUTO_REGEXPS_RES = fillAutoRegexpsRes ()
98117SB_NO_JAR = 'no-jar'
99118SB_JAR = 'jar'
100119SB_JAR_LINUX = 'jar-linux'
@@ -144,6 +163,8 @@ def help():
144163
145164def autoRegexpsHelp ():
146165 print >> sys .stderr , "Available %s options:" % AUTO_REGEXPS
166+ print >> sys .stderr , "\t help: prints this help"
167+ print >> sys .stderr , "\t all: includes all the available regexps"
147168 for r in AUTO_REGEXPS_RES :
148169 print >> sys .stderr , "\t %s: %s" % (r , AUTO_REGEXPS_RES [r ].pattern )
149170 print >> sys .stderr
@@ -379,11 +400,14 @@ for o, a in optlist:
379400 for r in options [AUTO_REGEXPS ]:
380401 if r == 'help' :
381402 autoRegexpsHelp ()
403+ if r == 'all' :
404+ options [AUTO_REGEXPS ] = AUTO_REGEXPS_RES .keys ()
405+ break
382406 if r not in AUTO_REGEXPS_RES :
383407 error ("invalid auto regexp: %s\n " % (r ))
384408 usage ()
385- # AUTO_REGEPXS implies USE_REGEXPS
386- options [USE_REGEXPS ] = True
409+ # AUTO_REGEPXS implies USE_REGEXPS
410+ options [USE_REGEXPS ] = True
387411 elif o in ['a' , START_ACTIVITY ]:
388412 options [START_ACTIVITY ] = a
389413 elif o in ['o' , OUTPUT ]:
0 commit comments