-2

I run command: run('sleep 1000'). How to limit time ( for example 100) for this command ?

Bdfy
  • 23,141
  • 55
  • 131
  • 179
  • 1
    Please elaborate on what you what to achieve! – endre Mar 21 '11 at 11:56
  • 1
    Please do what? Your question is of poor quality. –  Mar 21 '11 at 12:20
  • I think Bdfy means the run command in fabric, as per this other question of his: http://stackoverflow.com/questions/5266851/high-cpu-usage-in-fabric-1-0- – Thomas Mar 27 '11 at 20:24
  • I think sleep is just an example, he wants to know if with fabric you can fail/kill/abort a run() if it exceeds a preselected amount of time. – Daniel Rucci Aug 29 '12 at 14:02

2 Answers2

0

Several points to be precised in your question

  • your question is not really a python one, but is more focused on the sleep command, right ? I did not find any run command for any standard python package... Or you may want to use python's time.sleep instead ??
  • I guess you want to set a max value for the sleep command, to be used if the value passed is greater... Is this ok ?

If so, in case you use time.sleep, there is no way to do what I suppose you want to, as this previous post shows; I did not find any other way to limit the sleep command either via online documentation.

Community
  • 1
  • 1
Emmanuel
  • 13,935
  • 12
  • 50
  • 72
0

The closest functionality Fabric provides for that would be fabric.operations.prompt. It can validate the input and set default inputs as optional add-ons.

Rawkcy
  • 139
  • 1
  • 3