Example #1
0
File: gimp.py Project: myprg/pybase
    def set_args(self, value):
        """Exception raising is possible
        """
        if not value: return

        if sys.platform=="win32":
            value = [utils.quote_win32(v) for v in value]
        self._args = value
Example #2
0
File: gimp.py Project: myprg/pybase
 def _prebatch(batches, vars={}):
     """Prepare batch for command line: quotes on win32, adds -b
     """
     if sys.platform ==  "win32":
         bs = [u"-b "+utils.quote_win32(b%vars) for b in batches]
     else:
         bs = [u"-b "+b%vars for b in batches]
     return u" ".join(bs)
Example #3
0
File: gimp.py Project: myprg/pybase
 def set_opt(self, opt, value=None):
     """option opt (-x|--x), value may be used or not. In _opts will be
     '-x'|'-x xxx'|'--x'|'--x=xxx'
     """
     if value and sys.platform=="win32":
         value = utils.quote_win32(value)
     if opt.startswith("--"):
         # long option
         f = u"%s=%s"%(opt,value) if value else opt
     else:
         f = u"%s %s"%(opt,value) if value else opt
     self._opts.append(f)