Example #1
0
 def test_unicode_normalisation(self):
     """Ensure args are normalised in line with filesystem names"""
     self.assert_(os.path.exists(self._test_filename))
     filenames = [f for f in os.listdir(u'.') if f.endswith('.l11n')]
     self.assert_(len(filenames) == 1)
     print(u'{!r}'.format(filenames))
     fs_filename = filenames[0]
     self.assert_(fs_filename != self._test_filename)  # path has been NFD normalised by filesystem
     alfred_filename = alfred.decode(self._test_filename)
     self.assert_(alfred_filename == fs_filename)
Example #2
0
 def test_unicode_normalisation(self):
     """Ensure args are normalised in line with filesystem names"""
     self.assert_(os.path.exists(self._test_filename))
     filenames = [f for f in os.listdir(u'.') if f.endswith('.l11n')]
     self.assert_(len(filenames) == 1)
     print(u'{!r}'.format(filenames))
     fs_filename = filenames[0]
     self.assert_(fs_filename != self._test_filename)  # path has been NFD normalised by filesystem
     alfred_filename = alfred.decode(self._test_filename)
     self.assert_(alfred_filename == fs_filename)
Example #3
0
if len(parameter) >= 1:
    param = parameter[0]
else:
    param = 0

progList = []    

try:
    param = int(param)
    progList.append([iCalBuddyProg + "eventsToday+%d" % int(param), 'ical.png'])
    progList.append([iCalBuddyProg + "tasksDueBefore:today+%d" % (int(param)+1), 'reminder.png'])
except ValueError:
    progList.append([iCalBuddyProg + "undatedUncompletedTasks", 'reminder.png'])

results = []
count = 0
for prog in progList:
    iCalBuddyOutput = subprocess.check_output(prog[0], shell=True)
    entries = entrySpliterRe.split(iCalBuddyOutput)[1:]

    for entry in entries:
        e = lineSpliterRe.split(entry)

        results.append(alfred.Item(attributes={},
                        title = alfred.decode(e[0]),
                        subtitle = alfred.decode(','.join(e[1:])),
                        icon = prog[1]))
        count += 1

alfred.write(alfred.xml(results))
Example #4
0
try:
    param = int(param)
    progList.append(
        [iCalBuddyProg + "eventsToday+%d" % int(param), 'ical.png'])
    progList.append([
        iCalBuddyProg + "tasksDueBefore:today+%d" % (int(param) + 1),
        'reminder.png'
    ])
except ValueError:
    progList.append(
        [iCalBuddyProg + "undatedUncompletedTasks", 'reminder.png'])

results = []
count = 0
for prog in progList:
    iCalBuddyOutput = subprocess.check_output(prog[0], shell=True)
    entries = entrySpliterRe.split(iCalBuddyOutput)[1:]

    for entry in entries:
        e = lineSpliterRe.split(entry)

        results.append(
            alfred.Item(attributes={},
                        title=alfred.decode(e[0]),
                        subtitle=alfred.decode(','.join(e[1:])),
                        icon=prog[1]))
        count += 1

alfred.write(alfred.xml(results))