Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 3rd, 2011  |  syntax: Diff  |  size: 0.69 KB  |  views: 57  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- Mimeo.py.bak        2011-02-03 10:45:02.710108473 +0100
  2. +++ Mimeo.py    2011-02-03 10:48:19.855915330 +0100
  3. @@ -69,14 +69,7 @@
  4.      if line[:2] == '  ':
  5.        if cmd:
  6.          regex = line[2:]
  7. -
  8. -        def fun(arg):
  9. -          if re.search(regex, arg):
  10. -            return cmd
  11. -          else:
  12. -            return None
  13. -
  14. -        launchers.append(fun)
  15. +        launchers.append((cmd, regex))
  16.      else:
  17.        cmd = line
  18.  
  19. @@ -87,11 +80,9 @@
  20.  
  21.  
  22.  def get_custom_launcher(launchers,arg):
  23. -  for l in launchers:
  24. -    cmd = l(arg)
  25. -    if cmd:
  26. +  for cmd, regex in launchers:
  27. +    if re.search(regex, arg):
  28.        return cmd
  29. -  return None
  30.  
  31.  
  32.  def display_association_help(*args):