parameters: (self)
return_statement: return path
docstring: Return the directory where a client developper can store data files.
         If the directory doesn't exist, try to create it.
         After that, try to create a file inside it.
         If something goes wrong, generate an explicit exception.
docstring_summary: Return the directory where a client developper can store data files.
         If the directory doesn't exist, try to create it.
         After that, try to create a file inside it.
         If something goes wrong, generate an explicit exception.
docstring_tokens: Return the directory where a client developper can store data files . If the directory doesn t exist try to create it . After that try to create a file inside it . If something goes wrong generate an explicit exception .
function: def get_data_files_directory(self):
         """
         Return the directory where a client developper can store data files.
         If the directory doesn't exist, try to create it.
         After that, try to create a file inside it.
         If something goes wrong, generate an explicit exception.
         """
         path = "{0}/{1}/{2}_{3}/data/".format(self.libraries_directory, PACKAGES_DIR, self._type, self._name)
         if os.path.exists(path):
             if not os.access(path, os.W_OK & os.X_OK):
                 raise OSError("Can't write in directory {0}".format(path))
         else:
             try:
                 os.mkdir(path, 0770)
                 self.log.info(u"Create directory {0}.".format(path))
             except:
                 raise OSError("Can't create directory {0}. Reason is : {1}.".format(path, traceback.format_exc()))
         # Commented because :
         # a write test is done for each call of this function. For a client with a html server (geoloc for example), it
         # can be an issue as this makes a lot of write for 'nothing' on the disk.
         # We keep the code for now (0.4) for maybe a later use (and improved)
         #try:
         #    tmp_prefix = "write_test";
         #    count = 0
         #    filename = os.path.join(path, tmp_prefix)
         #    while(os.path.exists(filename)):
         #        filename = "{}.{}".format(os.path.join(path, tmp_prefix),count)
         #        count = count + 1
         #    f = open(filename,"w")
         #    f.close()
         #    os.remove(filename)
         #except :
         #    raise IOError("Can't create a file in directory {0}.".format(path))
         return path
function_tokens: def get_data_files_directory ( self ) : path = "{0}/{1}/{2}_{3}/data/" . format ( self . libraries_directory , PACKAGES_DIR , self . _type , self . _name ) if os . path . exists ( path ) : if not os . access ( path , os . W_OK & os . X_OK ) : raise OSError ( "Can't write in directory {0}" . format ( path ) ) else : try : os . mkdir ( path , 0770 ) self . log . info ( u"Create directory {0}." . format ( path ) ) except : raise OSError ( "Can't create directory {0}. Reason is : {1}." . format ( path , traceback . format_exc ( ) ) ) # Commented because : # a write test is done for each call of this function. For a client with a html server (geoloc for example), it # can be an issue as this makes a lot of write for 'nothing' on the disk. # We keep the code for now (0.4) for maybe a later use (and improved) #try: #    tmp_prefix = "write_test"; #    count = 0 #    filename = os.path.join(path, tmp_prefix) #    while(os.path.exists(filename)): #        filename = "{}.{}".format(os.path.join(path, tmp_prefix),count) #        count = count + 1 #    f = open(filename,"w") #    f.close() #    os.remove(filename) #except : #    raise IOError("Can't create a file in directory {0}.".format(path)) return path