'Create context menu actions'

def create_context_menu_actions(self):

    actions = []
    fnames = self.get_selected_filenames()
    new_actions = self.create_file_new_actions(fnames)
    if (len(new_actions) > 1):
        new_act_menu = QMenu(_('New'), self)
        add_actions(new_act_menu, new_actions)
        actions.append(new_act_menu)
    else:
        actions += new_actions
    import_actions = self.create_file_import_actions(fnames)
    if (len(import_actions) > 1):
        import_act_menu = QMenu(_('Import'), self)
        add_actions(import_act_menu, import_actions)
        actions.append(import_act_menu)
    else:
        actions += import_actions
    if actions:
        actions.append(None)
    if fnames:
        actions += self.create_file_manage_actions(fnames)
    if actions:
        actions.append(None)
    if (fnames and all([osp.isdir(_fn) for _fn in fnames])):
        actions += self.create_folder_manage_actions(fnames)
    if actions:
        actions.append(None)
    actions += self.common_actions
    return actions
