@synchronized(DIR_LOCK)
def get_filepath(path, nzo, filename):
 dirname = nzo.work_name
 created = nzo.created
 dName = dirname
 if (not created):
  for n in xrange(200):
   dName = dirname
   if n:
    dName += ('.' + str(n))
   try:
    os.mkdir(os.path.join(path, dName))
    break
   except:
    pass
  nzo.work_name = dName
  nzo.created = True
 fPath = os.path.join(os.path.join(path, dName), filename)
 (fPath, ext) = os.path.splitext(fPath)
 n = 0
 while True:
  if n:
   fullPath = ('%s.%d%s' % (fPath, n, ext))
  else:
   fullPath = (fPath + ext)
  if os.path.exists(fullPath):
   n = (n + 1)
  else:
   break
 return fullPath

@ synchronized ( DIR_LOCK ) def get_filepath ( path , nzo , filename ) : dirname = nzo . work_name created = nzo . created dName = dirname if ( not created ) : for n in xrange ( 200 ) : dName = dirname if n : dName += ( '.' + str ( n ) ) try : os . mkdir ( os . path . join ( path , dName ) ) break except : pass nzo . work_name = dName nzo . created = True fPath = os . path . join ( os . path . join ( path , dName ) , filename ) ( fPath , ext ) = os . path . splitext ( fPath ) n = 0 while True : if n : fullPath = ( '%s.%d%s' % ( fPath , n , ext ) ) else : fullPath = ( fPath + ext ) if os . path . exists ( fullPath ) : n = ( n + 1 ) else : break return fullPath
resolve the actual file path of fileorpath .