Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4999628
  • 博文数量: 921
  • 博客积分: 16037
  • 博客等级: 上将
  • 技术积分: 8469
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-05 02:08
文章分类

全部博文(921)

文章存档

2020年(1)

2019年(3)

2018年(3)

2017年(6)

2016年(47)

2015年(72)

2014年(25)

2013年(72)

2012年(125)

2011年(182)

2010年(42)

2009年(14)

2008年(85)

2007年(89)

2006年(155)

分类: Python/Ruby

2012-04-03 19:25:59


  1. import os
  2. from twisted.internet import reactor, utils

  3. myjob = dict()

  4. def doRepeatMasker(key, args):
  5.     d=utils.getProcessOutput('RepeatMasker',
  6.             args,
  7.             {'PATH':os.environ['PATH']+':'+'/home/estin/bin'})
  8.     def gotOutput(output):
  9.         print 'in call back...'
  10.         print output
  11.         myjob.pop(key)
  12.         print ' after poped', myjob
  13.         print 'end callback..'
  14.         print ' myjob status :', myjob
  15.     def gotError(failure):
  16.         print 'in errback...'
  17.         print failure
  18.         print 'end errback...'
  19.     d.addCallbacks(gotOutput, gotError)
  20.     return d

  21. job1 = 'rp1', ['-cow', 'testseq']
  22. job2 = 'rp2', ['-cow', 'testseq3']

  23. print '--------------df1'
  24. print ' myjob status :', myjob
  25. df1 = doRepeatMasker(*job1)
  26. myjob['rp1'] = df1
  27. print ' myjob status :', myjob

  28. print '--------------df2'
  29. print ' myjob status :', myjob
  30. df2 = doRepeatMasker(*job2)
  31. myjob['rp2'] = df2
  32. print ' myjob status :', myjob

  33. reactor.run()

阅读(1328) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~