Disable context menus which are not useful for remote file
175460
function _setMenuItemsVisible() {
        var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
            cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
            // Enable menu options when no file is present in active pane
            enable = !file || (file.constructor.name !== "RemoteFile");
        
            // Enable or disable commands based on whether the file is a remoteFile or not.
            cMenuItems.forEach(function (item) {
                CommandManager.get(item).setEnabled(enable);
            });
    }
1139023
def exclude_options(ignore_file_path)
      ar = File.read(ignore_file_path)
      ar = ar.split("\n")
      ar.map! do |r|
        r.gsub!(/#.*$/,""); r.gsub!(/^\s*?$/,"")
        r.gsub!(/^\//,"./"); r.gsub!(/\/$/,"/*")
        r
      end
      ar =  ar.delete_if{|r|r==""}
      ar.map! do |r|
        "--exclude '" + r + "'"
      end
      return ar.join(" ")
    end
484113
def disable(name, **kwargs):
    '''
    
    '''
    osmajor = _osrel()[0]
    if osmajor < '6':
        cmd = 'update-rc.d -f {0} remove'.format(name)
    else:
        cmd = 'update-rc.d {0} disable'.format(name)
    return not __salt__['cmd.retcode'](cmd)
1185127
def __fix_context(context):
    

    COPY_LISTS = ('script_files', 'css_files',)

    for attr in COPY_LISTS:
        if attr in context:
            context[attr] = context[attr][:]

    return context
275477
def hide_shortcuts(self, menu):
        """"""
        for element in getattr(self, menu + '_menu_actions'):
            if element and isinstance(element, QAction):
                if element._shown_shortcut is not None:
                    element.setShortcut(QKeySequence())
197065
def remove_context(self, name):
        
        self._context(name)
        del self.contexts[name]
        self._flush_tools()
892738
def stopContext(self, context):
        

        # Use pymongo directly to drop all collections of created db
        if ((self.clear_context['module'] and inspect.ismodule(context)) or
           (self.clear_context['class'] and inspect.isclass(context))):
            self.connection.drop_database(self.database_name)
286221
def _mk_context_menu(self, thumbkey, chname, info):
        
        menu = Widgets.Menu()
        item = menu.add_name("Display")
        item.add_callback('activated',
                          lambda w: self.load_file(
                              thumbkey, chname, info.name, info.path,
                              info.image_future))
        menu.add_separator()
        item = menu.add_name("Remove")
        item.add_callback('activated',
                          lambda w: self.fv.remove_image_by_name(
                              chname, info.name, impath=info.path))

        return menu
1166949
def _remote_chmod(self, paths, mode, sudoable=False):
        
        LOG.debug('_remote_chmod(%r, mode=%r, sudoable=%r)',
                  paths, mode, sudoable)
        return self.fake_shell(lambda: mitogen.select.Select.all(
            self._connection.get_chain().call_async(
                ansible_mitogen.target.set_file_mode, path, mode
            )
            for path in paths
        ))
449540
def stop(ctx, rm=False):
    ''''''
    with ctx.cd(ROOT):
        compose(ctx, 'stop')
        if rm:
            compose(ctx, 'rm --force')
342955
def disable_caching(self):
        ""
        self.caching_enabled = False
        for c in self.values():
            c.disable_cacher()
1303605
def _cleanup(self, domains):
        """"""
        for option in domains.values():
            try:
                os.remove(option['pot'])
            except (IOError, OSError):
                # It is not a problem if we can't actually remove the temporary file
                pass
79061
def disable(cls):
        
        # Skip if not on Windows.
        if not IS_WINDOWS:
            return False

        # Restore default colors.
        if hasattr(sys.stderr, '_original_stream'):
            getattr(sys, 'stderr').color = None
        if hasattr(sys.stdout, '_original_stream'):
            getattr(sys, 'stdout').color = None

        # Restore original streams.
        changed = False
        if hasattr(sys.stderr, '_original_stream'):
            changed = True
            sys.stderr = getattr(sys.stderr, '_original_stream')
        if hasattr(sys.stdout, '_original_stream'):
            changed = True
            sys.stdout = getattr(sys.stdout, '_original_stream')

        return changed
1363708
def _context_menu_make(self, pos):
        """"""
        menu = super(ShellWidget, self)._context_menu_make(pos)
        return self.ipyclient.add_actions_to_context_menu(menu)
1034936
def cli(ctx, verbose, fake, install, uninstall, config):
    """"""
    # Create a repo object and remember it as as the context object.  From
    # this point onwards other commands can refer to it by using the
    # @pass_scm decorator.
    ctx.obj = SCMRepo()
    ctx.obj.fake = fake
    ctx.obj.verbose = fake or verbose

    if install:
        do_install(ctx, verbose, fake)
        ctx.exit()
    elif uninstall:
        do_uninstall(ctx, verbose, fake)
        ctx.exit()
    elif config:
        do_edit_settings(fake)
        ctx.exit()
    else:
        if ctx.invoked_subcommand is None:
            # Display help to user if no commands were passed.
            click.echo(format_help(ctx.get_help()))
311273
def _clear_context():
    '''
    
    '''
    for var in [x for x in __context__ if x.startswith('lxc.')]:
        log.trace('Clearing __context__[\'%s\']', var)
        __context__.pop(var, None)
774940
function removeRemoteSingleFile(rootFolder, fileName) {
    // Read every local file and create a correct local.json file
    const fileNameWithoutExtension = path.join(path.parse(fileName).dir, path.parse(fileName).name);
    const extension = path.parse(fileName).ext;

    // Read remote
    const remote = path.join(rootFolder, constants.META_DIR, constants.META_REMOTE);
    const remoteData = JSON.parse(fs.readFileSync(remote, 'utf8'));

    // Check if file is in remote
    let inRemote = false;
    for (let index = 0; index < remoteData.files.length; index++) {
        if (remoteData.files[index].name === fileNameWithoutExtension) {
            inRemote = true;
            // lets remove the file
            remoteData.files.splice(index, 1);
            break;
        }
    }

    // If not in remote
    if (!inRemote) {
        throw {
            message: `Can't seem to find '${fileName}' in the remote Google Apps Script file`,
            print: true,
        };
    }

    // Write to local.json
    writeLocalJson(remoteData, rootFolder);
}