Пример #1
0
 def test_applesingle_resonly(self):
     try:
         os.unlink(TESTFN2)
     except:
         pass
     applesingle.decode(test_support.TESTFN, TESTFN2, resonly=True)
     self.compareData(False, resourceforkdata)
 def test_applesingle_resonly(self):
     try:
         os.unlink(TESTFN2)
     except:
         pass
     applesingle.decode(test_support.TESTFN, TESTFN2, resonly=True)
     self.compareData(False, resourceforkdata)
Пример #3
0
def _decode(pathname, verbose = 0):
    newpathname = pathname + '.df.rsrc'
    if os.path.exists(newpathname) and os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime:
        return newpathname
    if hasattr(os, 'access') and not os.access(os.path.dirname(pathname), os.W_OK | os.X_OK):
        import tempfile
        fd, newpathname = tempfile.mkstemp('.rsrc')
    if verbose:
        print 'Decoding', pathname, 'to', newpathname
    import applesingle
    applesingle.decode(pathname, newpathname, resonly=1)
    return newpathname
Пример #4
0
def _decode(pathname, verbose = 0):
    newpathname = pathname + '.df.rsrc'
    if os.path.exists(newpathname) and os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime:
        return newpathname
    if hasattr(os, 'access') and not os.access(os.path.dirname(pathname), os.W_OK | os.X_OK):
        import tempfile
        fd, newpathname = tempfile.mkstemp('.rsrc')
    if verbose:
        print 'Decoding', pathname, 'to', newpathname
    import applesingle
    applesingle.decode(pathname, newpathname, resonly=1)
    return newpathname
Пример #5
0
def _decode(pathname, verbose=0):
    newpathname = pathname + ".df.rsrc"
    if os.path.exists(newpathname) and os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime:
        return newpathname
    if hasattr(os, "access") and not os.access(os.path.dirname(pathname), os.W_OK | os.X_OK):
        import tempfile

        fd, newpathname = tempfile.mkstemp(".rsrc")
    if verbose:
        print "Decoding", pathname, "to", newpathname
    import applesingle

    applesingle.decode(pathname, newpathname, resonly=1)
    return newpathname
Пример #6
0
def _decode(pathname, verbose=0):
    # Decode an AppleSingle resource file, return the new pathname.
    newpathname = pathname + '.df.rsrc'
    if os.path.exists(newpathname) and \
        os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime:
        return newpathname
    if hasattr(os, 'access') and not \
        os.access(os.path.dirname(pathname), os.W_OK|os.X_OK):
        # The destination directory isn't writeable. Create the file in
        # a temporary directory
        import tempfile
        fd, newpathname = tempfile.mkstemp(".rsrc")
    if verbose:
        print 'Decoding', pathname, 'to', newpathname
    import applesingle
    applesingle.decode(pathname, newpathname, resonly=1)
    return newpathname
Пример #7
0
def _decode(pathname, verbose=0):
    # Decode an AppleSingle resource file, return the new pathname.
    newpathname = pathname + '.df.rsrc'
    if os.path.exists(newpathname) and \
        os.stat(newpathname).st_mtime >= os.stat(pathname).st_mtime:
        return newpathname
    if hasattr(os, 'access') and not \
        os.access(os.path.dirname(pathname), os.W_OK|os.X_OK):
        # The destination directory isn't writeable. Create the file in
        # a temporary directory
        import tempfile
        fd, newpathname = tempfile.mkstemp(".rsrc")
    if verbose:
        print 'Decoding', pathname, 'to', newpathname
    import applesingle
    applesingle.decode(pathname, newpathname, resonly=1)
    return newpathname