Try to locate the Dropbox folder.

    Returns:
        (str) Full path to the current Dropbox folder
430343
def get_dropbox_folder_location():
    
    host_db_path = os.path.join(os.environ['HOME'], '.dropbox/host.db')
    try:
        with open(host_db_path, 'r') as f_hostdb:
            data = f_hostdb.read().split()
    except IOError:
        error("Unable to find your Dropbox install =(")
    dropbox_home = base64.b64decode(data[1]).decode()

    return dropbox_home
1064253
def pickFilepath( self ):
        
        mode = self.filepathMode()
        
        filepath = ''
        filepaths = []
        curr_dir = nativestring(self._filepathEdit.text())
        if ( not curr_dir ):
            curr_dir = QDir.currentPath()
        
        if mode == XFilepathEdit.Mode.SaveFile:
            filepath = QFileDialog.getSaveFileName( self,
                                                    self.windowTitle(),
                                                    curr_dir,
                                                    self.filepathTypes() )
                                                    
        elif mode == XFilepathEdit.Mode.OpenFile:
            filepath = QFileDialog.getOpenFileName( self,
                                                    self.windowTitle(),
                                                    curr_dir,
                                                    self.filepathTypes() )
        
        elif mode == XFilepathEdit.Mode.OpenFiles:
            filepaths = QFileDialog.getOpenFileNames( self,
                                                      self.windowTitle(),
                                                      curr_dir,
                                                      self.filepathTypes() )
        
        else:
            filepath = QFileDialog.getExistingDirectory( self,
                                                         self.windowTitle(),
                                                         curr_dir )
        
        if filepath:
            if type(filepath) == tuple:
                filepath = filepath[0]
            self.setFilepath(nativestring(filepath))
        elif filepaths:
            self.setFilepaths(map(str, filepaths))
603181
def _parse_path(self):
        
        if self.engine == ENGINE_DROPBOX:
            path = get_dropbox_folder_location()
        elif self.engine == ENGINE_GDRIVE:
            path = get_google_drive_folder_location()
        elif self.engine == ENGINE_COPY:
            path = get_copy_folder_location()
        elif self.engine == ENGINE_ICLOUD:
            path = get_icloud_folder_location()
        elif self.engine == ENGINE_BOX:
            path = get_box_folder_location()
        elif self.engine == ENGINE_FS:
            if self._parser.has_option('storage', 'path'):
                cfg_path = self._parser.get('storage', 'path')
                path = os.path.join(os.environ['HOME'], cfg_path)
            else:
                raise ConfigError("The required 'path' can't be found while"
                                  " the 'file_system' engine is used.")

        return str(path)
674931
def _static_folder_path(static_url, static_folder, static_asset):
    
    # first get the asset path relative to the static folder.
    # static_asset is not simply a filename because it could be
    # sub-directory then file etc.
    if not static_asset.startswith(static_folder):
        raise ValueError("%s static asset must be under %s static folder" %
                         (static_asset, static_folder))
    rel_asset = static_asset[len(static_folder):]
    # Now bolt the static url path and the relative asset location together
    return '%s/%s' % (static_url.rstrip('/'), rel_asset.lstrip('/'))
1339829
def file_path(self):
        
        return os.path.join(keyring.util.platform.data_root(), self.filename)
895261
def DropLocation():
    
    template = Template(template=PathDirs().cfg_file)
    drop_loc = template.option('main', 'files')[1]
    drop_loc = expanduser(drop_loc)
    drop_loc = abspath(drop_loc)
    return (True, drop_loc)
44244
def _GetDirectory(self):
    
    if self.entry_type != definitions.FILE_ENTRY_TYPE_DIRECTORY:
      return None
    return TSKDirectory(self._file_system, self.path_spec)
271551
def capture_file_path(self):
        

        if self._capture_file_name:
            return os.path.join(self._project.captures_directory, self._capture_file_name)
        else:
            return None
1218932
def relpath(self):
        
        here = os.path.abspath(os.path.curdir)
        relpath = os.path.relpath(self.fpath, here)
        return relpath
608779
def get_filepath(self, filename):
        
        return os.path.join(self.parent_folder, '{},{},{}'.format(self.tile_name, self.date, self.aws_index),
                            self.add_file_extension(filename)).replace(':', '.')
727739
def find_project_dir():
    
    frame = inspect.currentframe()

    while True:
        frame = frame.f_back
        fname = frame.f_globals['__file__']

        if os.path.basename(fname) == 'manage.py':
            break

    return os.path.dirname(fname)
749141
def get_full_dir_name(self):
        
        return os.path.join(self.dir_name.get_text(), self.entry_project_name.get_text())
835706
def get_fullpath(self, fullname=None, relative_to=None):
        
        # if is an empty path
        if not fullname:
            return fullname

        isabs = os.path.isabs(fullname)

        path, name = os.path.split(fullname)

        if not name:  # path to a folder
            return None
        else:  # path to a file
            if isabs:
                return fullname
            else:
                return os.path.join(self.case_path, path, name)
175779
def get(self):
        
        self.log.info('starting the ``get`` method')

        self._copy_folder_and_get_directory_listings()
        self._join_all_filenames_and_text()
        self._collect_placeholders_required()
        self._populate_dynamic_placeholders()
        self._fill_placeholders_from_settings()
        self._request_remaining_placeholders()
        self._populate_placeholders_in_files()
        self._move_template_to_destination(ignoreExisting=self.ignoreExisting)

        self.log.info('completed the ``get`` method')
        return None
679991
def _search_path(self, directory_name, filename):
        """"""
        full_path = path.join(directory_name, filename)
        if path.exists(full_path):
            return full_path

        # Could not find the requested file in any of the directories
        return None
55245
def caller_folder():
    
    import inspect
    caller_file = inspect.stack()[2][1]
    if os.path.exists(caller_file):
        return os.path.abspath(os.path.dirname(caller_file))
    else:
        return os.path.abspath(os.getcwd())
1314396
def get_working_path(self):
        
        self.set_section('Files')
        raw_path = self.option("working_path")
        if raw_path.startswith('~'):
            raw_path = os.path.expanduser('~') + raw_path[1:]

        return raw_path