1 #!/usr/bin/env python2.5
13 no_template = 'nada nuevo'
14 yes_template = '%(total)s mensaje%(pl)s nuevo%(pl)s (de %(jids)s)'
18 # Probably you don't want to touch this
19 psi_profile_dir = os.path.join(os.getenv('HOME'), '.psi', 'profiles', psi_profile)
20 events_files_glob = 'events-*.xml'
21 event_regex = re.compile(r'.*<jid>(.*)<\/jid>.*')
23 os.chdir(psi_profile_dir)
28 secs = int(sys.argv[1])
33 for f in glob.glob(events_files_glob):
34 l = event_regex.findall(file(f).read())
38 print yes_template % dict(
40 pl = 's' if len(events) > 1 else '',
41 jids = join_str.join(frozenset(events))