Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

        def get_out_paths(prog_name, out_name, out_dir, tmp_dir, tmp_required_space):
    # name
    if not out_name:
        out_time = datetime.now().strftime('%Y.%m.%d-%H%M%S')
        out_name = '{}_{}'.format(prog_name, out_time)
    
    # out dirs
    if not out_dir:
        out_dir = os.path.join(os.getcwd(), out_name)
    
    # tmp_dir
    if not tmp_dir:
        tmp = tempfile.gettempdir()
        tmp_free = get_space_available(tmp)
        if tmp_free > tmp_required_space:
            tmp_dir = os.path.join(tmp, prog_name, out_name)
        else:
            tmp_dir = os.path.join(out_dir, 'tmp')
    
    # make dirs if they don't exist
    for i in [out_dir, tmp_dir]:
        if not os.path.exists(i):
            os.makedirs(i)
    
    return out_name, out_dir, tmp_dir
        


src/i/z/izdvd-0.1.2/izdvd/menu.py   izdvd(Download)
    def get_out_paths(self):
        paths = utils.get_out_paths(PROG_NAME, self.out_name, self.out_dir,
                                    self.tmp_dir, 50*1024*1024)
        self.out_name, self.out_dir, self.tmp_dir = paths
        self.out_files_dir = os.path.join(self.out_dir, 'files')
    def get_out_paths(self):
        paths = utils.get_out_paths(PROG_NAME, self.out_name, self.out_dir,
                                    self.tmp_dir, 150*1024*1024)
        self.out_name, self.out_dir, self.tmp_dir = paths
        self.out_files_dir = os.path.join(self.out_dir, 'files')
    def get_out_paths(self):
        paths = utils.get_out_paths(PROG_NAME, self.out_name, self.out_dir,
                                    self.tmp_dir, self.dvd_size_bytes * 1.2)
        self.out_name, self.out_dir, self.tmp_dir = paths