Exemple #1
0
def _mpng(prefix,
          first=-1,
          last=-1,
          preserve=0,
          modal=0,
          format=-1,
          mode=-1,
          quiet=1,
          width=0,
          height=0,
          _self=cmd):  # INTERNAL
    format = int(format)
    # WARNING: internal routine, subject to change
    try:
        _self.lock(_self)
        fname = prefix
        if re.search("[0-9]*\.png$", fname):  # remove numbering, etc.
            fname = re.sub("[0-9]*\.png$", "", fname)
        if re.search("[0-9]*\.ppm$", fname):
            if format < 0:
                format = 1  # PPM
            fname = re.sub("[0-9]*\.ppm$", "", fname)
        if format < 0:
            format = 0  # default = PNG
        fname = cmd.exp_path(fname)
        r = _cmd.mpng_(_self._COb, str(fname), int(first), int(last),
                       int(preserve), int(modal), format, int(mode),
                       int(quiet), int(width), int(height))
    finally:
        _self.unlock(-1, _self)
    return r
Exemple #2
0
def _mpng(prefix, first=-1, last=-1, preserve=0, modal=0,
          format=-1, mode=-1, quiet=1,
          width=0, height=0,
          _self=cmd): # INTERNAL
    format = int(format)
    # WARNING: internal routine, subject to change
    try:
        _self.lock(_self)   
        fname = prefix
        if re.search("[0-9]*\.png$",fname): # remove numbering, etc.
            fname = re.sub("[0-9]*\.png$","",fname)
        if re.search("[0-9]*\.ppm$",fname):
            if format<0:
                format = 1 # PPM
            fname = re.sub("[0-9]*\.ppm$","",fname)
        if format<0:
            format = 0 # default = PNG
        fname = cmd.exp_path(fname)
        r = _cmd.mpng_(_self._COb,str(fname),int(first),
                       int(last),int(preserve),int(modal),
                       format,int(mode),int(quiet),
                       int(width), int(height))
    finally:
        _self.unlock(-1,_self)
    return r