Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/file/d87129162eb4/utils/pool
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 17:33:25 2013
Кодировка:
allpy: d87129162eb4 utils/pool

allpy

view utils/pool @ 822:d87129162eb4

Implemented & tested new markup API. See #95 1) Sequences, Alignment and Blocks now have two new methods: - add_markup(name, markup_class=optional, **kwargs=optional) - remove_markup(name) name refers to the same name as in aln.markups[name] or sequence[i].name It is now explicitly denied to create markups any other way. 2) Markups now have `remove()` method that means 'release all memory that would not be released otherwised, if we just remove markup from the dictionary'. For sequences markups it removes markup attribute from each monomer. 3) Added necessary del sequence_markup[monomer] method. 4) Many base classes have attribute `kind`; for Alignments and Blocks it is 'alignment', for Sequences it is 'sequence' for AlignmentMarkups it is 'alignment_markup' for SequenceMarkups it is 'sequence_markup'. This attribute is crucial for new alignment construction API. 5) Common stuff for MarkupContainers (Alignments and Sequences) is in MarkupContainerMixin.
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Fri, 15 Jul 2011 16:43:03 +0400
parents
children
line source
1 #!/usr/bin/python
2 import subprocess
3 import os
4 import shlex
5 import optparse
7 p = optparse.OptionParser()
8 p.add_option('-n', '--size', type=int, help='Pool size')
9 p.add_option('-c', '--cmd',
10 help='Command template. Insert {} for argument.'
11 ' Put the argument in double quotes if it may contain spaces.')
12 options, args = p.parse_args()
14 spawned = 0
15 for arg in args:
16 if spawned > options.size:
17 os.wait()
18 spawned -= 1
19 cmd = shlex.split(options.cmd.replace('{}', arg))
20 subprocess.Popen(cmd)
21 spawned += 1
23 try:
24 while True:
25 os.wait()
26 except Exception:
27 pass
29 # vim: set ts=4 sts=4 et sw=4: