2 Holds information about what the user asked for (which program, version constraints, etc).
5 # Copyright (C) 2011, Thomas Leonard
6 # See the README file for details, or visit http://0install.net.
8 from zeroinstall
import _
10 class Requirements(object):
12 Holds information about what the user asked for (which program, version constraints, etc).
18 'before', 'not_before',
23 def __init__(self
, interface_uri
):
24 self
.interface_uri
= interface_uri
27 self
.before
= self
.not_before
= None
28 self
.os
= self
.cpu
= None
31 def get_as_options(self
):
34 gui_args
.insert(0, self
.not_before
)
35 gui_args
.insert(0, '--not-before')
37 gui_args
.insert(0, self
.before
)
38 gui_args
.insert(0, '--before')
40 gui_args
.insert(0, '--source')
42 gui_args
.insert(0, self
.message
)
43 gui_args
.insert(0, '--message')
45 gui_args
.insert(0, self
.cpu
)
46 gui_args
.insert(0, '--cpu')
48 gui_args
.insert(0, self
.os
)
49 gui_args
.insert(0, '--os')
50 if self
.command
is not None:
51 gui_args
.append('--command')
52 gui_args
.append(self
.command
)