~ubuntu-branches/ubuntu/precise/checkbox/precise

« back to all changes in this revision

Viewing changes to checkbox/variables.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Tardif, Daniel Manrique, Jochen Kemnade, Jeff Lane, Michael Terry
  • Date: 2011-03-17 11:15:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110317111512-4n52l4z7vxy57yhe
Tags: 0.11.2
New upstream release (LP: #736919):
* Added version to dpkg dependency
* Added multiarch support to install script (LP: #727411)
* Fixed submitting data twice (LP: #531010)
* Fixed job descriptions for checkbox-cli (LP: #221400)

[Daniel Manrique]
* Fixed strings in audio tests and updated pot file (LP: #691241)

[Jochen Kemnade]
* Fixed grammar in user-apps tests (LP: #642001)

[Jeff Lane]
* Added reboot instructions to suspend/hibernate tests (LP: #420493)
* Made the firewire instructions make more sense (LP: #693068)

[Michael Terry]
* Fixed several strings appear in English although translated (LP: #514401)
  - jobs/fingerprint.txt.in
  - jobs/media.txt.in
  - jobs/monitor.txt.in
  - jobs/sleep.txt.in
  - jobs/firewire.txt.in
  - po/checkbox.pot
* Fixed grammar (LP: #525454)
  + jobs/fingerprint.txt.in

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import re
20
20
import posixpath
21
21
 
 
22
from StringIO import StringIO
 
23
 
22
24
from checkbox.lib.text import split
23
25
 
24
26
 
270
272
        return value
271
273
 
272
274
 
 
275
class FileVariable(Variable):
 
276
    __slots__ = ()
 
277
 
 
278
    def coerce(self, value):
 
279
        if isinstance(value, basestring):
 
280
            value = StringIO(value)
 
281
        elif not hasattr(value, "read"):
 
282
            raise ValueError("%r is not a file" % (value,))
 
283
 
 
284
        return value
 
285
 
 
286
 
273
287
def get_variable(obj, attribute):
274
288
    return get_variables(obj)[attribute]
275
289