From 12f73d0c439a6852fe06423737e07cda034340f1 Mon Sep 17 00:00:00 2001 From: Max Bucknell Date: Wed, 22 Nov 2023 00:40:43 +1100 Subject: [PATCH] More tidy up now that I have said new computer! --- README.md | 1 - bin/imgcat | 153 -- boop/entity-id.js | 0 boop/timeslice.js | 23 - gtkrc-2.0/gtkrc-2.0.symlink | 19 - liquidprompt/liquidpromptrc.symlink | 2 +- phpstorm/settings.jar | Bin 12843 -> 0 bytes ranger/ranger.symlink/commands.py | 62 - ranger/ranger.symlink/commands_full.py | 1836 ------------------------ ranger/ranger.symlink/rc.conf | 725 ---------- ranger/ranger.symlink/rifle.conf | 256 ---- ranger/ranger.symlink/scope.sh | 216 --- zsh/zshrc.symlink | 6 +- 13 files changed, 4 insertions(+), 3295 deletions(-) delete mode 100755 bin/imgcat delete mode 100644 boop/entity-id.js delete mode 100644 boop/timeslice.js delete mode 100644 gtkrc-2.0/gtkrc-2.0.symlink delete mode 100644 phpstorm/settings.jar delete mode 100644 ranger/ranger.symlink/commands.py delete mode 100755 ranger/ranger.symlink/commands_full.py delete mode 100644 ranger/ranger.symlink/rc.conf delete mode 100644 ranger/ranger.symlink/rifle.conf delete mode 100755 ranger/ranger.symlink/scope.sh diff --git a/README.md b/README.md index 9f17406..ae32ac1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ maintaining: + zsh + git -+ bin In addition to this, you can find a few little scripts I use in the `bin` directory. diff --git a/bin/imgcat b/bin/imgcat deleted file mode 100755 index 0347122..0000000 --- a/bin/imgcat +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/bash - -# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux; -# ST, and for all ESCs in to be replaced with ESC ESC. It -# only accepts ESC backslash for ST. We use TERM instead of TMUX because TERM -# gets passed through ssh. -function print_osc() { - if [[ $TERM == screen* ]] ; then - printf "\033Ptmux;\033\033]" - else - printf "\033]" - fi -} - -# More of the tmux workaround described above. -function print_st() { - if [[ $TERM == screen* ]] ; then - printf "\a\033\\" - else - printf "\a" - fi -} - -function load_version() { - if [ -z ${IMGCAT_BASE64_VERSION+x} ]; then - export IMGCAT_BASE64_VERSION=$(base64 --version 2>&1) - fi -} - -function b64_encode() { - load_version - if [[ "$IMGCAT_BASE64_VERSION" =~ GNU ]]; then - # Disable line wrap - base64 -w0 - else - base64 - fi -} - -function b64_decode() { - load_version - if [[ "$IMGCAT_BASE64_VERSION" =~ fourmilab ]]; then - BASE64ARG=-d - elif [[ "$IMGCAT_BASE64_VERSION" =~ GNU ]]; then - BASE64ARG=-di - else - BASE64ARG=-D - fi - base64 $BASE64ARG -} - -# print_image filename inline base64contents print_filename -# filename: Filename to convey to client -# inline: 0 or 1 -# base64contents: Base64-encoded contents -# print_filename: If non-empty, print the filename -# before outputting the image -function print_image() { - print_osc - printf '1337;File=' - if [[ -n "$1" ]]; then - printf 'name='`printf "%s" "$1" | b64_encode`";" - fi - - printf "%s" "$3" | b64_decode | wc -c | awk '{printf "size=%d",$1}' - printf ";inline=$2" - printf ":" - printf "%s" "$3" - print_st - printf '\n' - if [[ -n "$4" ]]; then - echo $1 - fi -} - -function error() { - echo "ERROR: $*" 1>&2 -} - -function show_help() { - echo "Usage: imgcat [-p] filename ..." 1>& 2 - echo " or: cat filename | imgcat" 1>& 2 -} - -function check_dependency() { - if ! (builtin command -V "$1" > /dev/null 2>& 1); then - echo "imgcat: missing dependency: can't find $1" 1>& 2 - exit 1 - fi -} - -## Main - -if [ -t 0 ]; then - has_stdin=f -else - has_stdin=t -fi - -# Show help if no arguments and no stdin. -if [ $has_stdin = f -a $# -eq 0 ]; then - show_help - exit -fi - -check_dependency awk -check_dependency base64 -check_dependency wc - -# Look for command line flags. -while [ $# -gt 0 ]; do - case "$1" in - -h|--h|--help) - show_help - exit - ;; - -p|--p|--print) - print_filename=1 - ;; - -u|--u|--url) - check_dependency curl - encoded_image=$(curl -s "$2" | b64_encode) || (error "No such file or url $2"; exit 2) - has_stdin=f - print_image "$2" 1 "$encoded_image" "$print_filename" - set -- ${@:1:1} "-u" ${@:3} - if [ "$#" -eq 2 ]; then - exit - fi - ;; - -*) - error "Unknown option flag: $1" - show_help - exit 1 - ;; - *) - if [ -r "$1" ] ; then - has_stdin=f - print_image "$1" 1 "$(b64_encode < "$1")" "$print_filename" - else - error "imgcat: $1: No such file or directory" - exit 2 - fi - ;; - esac - shift -done - -# Read and print stdin -if [ $has_stdin = t ]; then - print_image "" 1 "$(cat | b64_encode)" "" -fi - -exit 0 \ No newline at end of file diff --git a/boop/entity-id.js b/boop/entity-id.js deleted file mode 100644 index e69de29..0000000 diff --git a/boop/timeslice.js b/boop/timeslice.js deleted file mode 100644 index fdc9c4d..0000000 --- a/boop/timeslice.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - { - "api":1, - "name":"Generate Time Slice", - "description":"Convert a date into a timeslice of that day.", - "author":"Max Bucknell", - "icon":"quote", - "tags":"baseup,timeslice" - } -**/ - -function main(state) { - const timestamp = Date.parse(state.selection) / 1000 - const timeslice = { - startTimestamp: timestamp, - endTimestamp: timestamp + 86340, - dailyStartTime: 0, - dailyEndTime: 86340, - restrictToDays: 'MTWTFSS' - } - - state.insert(JSON.stringify(timeslice, null, 4)) -} diff --git a/gtkrc-2.0/gtkrc-2.0.symlink b/gtkrc-2.0/gtkrc-2.0.symlink deleted file mode 100644 index 5a940ab..0000000 --- a/gtkrc-2.0/gtkrc-2.0.symlink +++ /dev/null @@ -1,19 +0,0 @@ -# DO NOT EDIT! This file will be overwritten by LXAppearance. -# Any customization should be done in ~/.gtkrc-2.0.mine instead. - -include "/home/max/.gtkrc-2.0.mine" -gtk-theme-name="Clearlooks" -gtk-icon-theme-name="hicolor" -gtk-font-name="System San Francisco Text 16" -gtk-cursor-theme-name="DMZ-White" -gtk-cursor-theme-size=0 -gtk-toolbar-style=GTK_TOOLBAR_BOTH -gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR -gtk-button-images=1 -gtk-menu-images=1 -gtk-enable-event-sounds=1 -gtk-enable-input-feedback-sounds=1 -gtk-xft-antialias=1 -gtk-xft-hinting=1 -gtk-xft-hintstyle="hintslight" -gtk-xft-rgba="rgb" diff --git a/liquidprompt/liquidpromptrc.symlink b/liquidprompt/liquidpromptrc.symlink index 5a9e8c5..952f231 100644 --- a/liquidprompt/liquidpromptrc.symlink +++ b/liquidprompt/liquidpromptrc.symlink @@ -59,7 +59,7 @@ LP_USER_ALWAYS=1 # Display the percentages of load/batteries along with their # corresponding marks. Set to 0 to only print the colored marks. # Defaults to 1 (display percentages) -LP_PERCENTS_ALWAYS=0 +LP_ALWAYS_DISPLAY_VALUES=0 # Use the permissions feature and display a red ':' before the prompt to show # when you don't have write permission to the current directory. diff --git a/phpstorm/settings.jar b/phpstorm/settings.jar deleted file mode 100644 index c69a6cdb4338da1d5a8d036b3eb9d237cdb257a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12843 zcma)?WmKF?m$n-xxI+l;P9V6u2X_r_jk~+M1}9kKK^pf24Q>H~2X}7>K8rK&yvaG= z%zU$dKeeB`cGX>L?W#*z9tIW%fCxYY$bp%q0e{4604%`4(bd|)-i6iF0qEfD!s23T zWo~EA;%Ntb8U_H~$MK_uyv2a?Q8d1V?g|tSQ7s;NJy~DXGwjb~N)?|^AQ^c#mK~M& zjy5z);eNa|lIBNh10P&LM8J5t?(5iUpo6k@SqBx^;SAkqfo2_ZNyxq>dGeXgQGwq- zHKP-`lwbd%E9R%+6ST5C0wNL~zncvJ0Ehqp0LuTPXeA#K2vuZ+rgVET+55y5KS$TLA z+gKsWHAur5#&VGhqKM~3QjAKA@{&Wk`v3#^NwetmV~2mk>1{!QLj zo4?l-{SSFSU}o;(>IF1+Vf|fi zhPJ;?i16Rz2@p!D@EPWb69?#Sn>XbcFNEZUN>?Ot06GgJq! zjw8h@6w2(V=T$U}uplu=h5XX4pwVg5wb^aPl+8sBGdryk{*TT>OC@Vw)||?@#wBYW zMW0*M(e&GEj#*6FN!|Jr5lU2Qs?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pRB+L}X)j<!>4t(eJ z%?Xy3MJJg|7gZj*L(ue9AgR7y@LmQW+Mj+~dJTipmk}NqsDWe4%nENd0~1Jtf6#Bj z7Si>8;DJ3^g09osuR4SCXay(~ax^zG&^G(C=jH(FT8p0aMp+q)j@Dhcs1vzgHa|<& z|Ln6j-KJ)}iO&QU)D&!nKGBzJ;a2U+Mw5B(F?GLTl`bqGVpvzwS-3LZ2WcbbY?rpWN3Kgh!0H9l;25%)341O`!($?All9CM{u z^jsb`c=}E#n(n#C?yo>qmS^$1pW@tI!0!!g2BFDtvKz+d;E{&S8jJ4$22pu@61m~5 zh-KHYG>1FBO+Po5NHZM7S+z-xl(kosM6%s9_*|ah z4W-+NM@Lecsz^`BuOqESBr8cg23;WnPlVcdL$6T*l*Soh&UrYrbrn4&B0PCZUV)Uj zGzZ*0q6Eh?X0EMzV)J%f-+FB43P5(yLm_r(v@ITDwHx88W#z9zSk z%cmB-Y~JVhoB4_{f;2hiS*O-srZ(?V+s&Q3%#mzS!jeMTEXyK3kn&shBUD=8~K!U7s(pPYV_^~hBA)&ha4MBB# zdrE~DujpsRs%>es^GF$kjt|#-@Iwb23G`Kzo+zqo1)26d@n1yL%&1{irQ-0=T*MEW z9}Y%b>pWZYAGNn?0v_BU+no3B0!E*I3BUABhmm6V7bpOLc*UQ6Q_?>eU{nAAU~TW> zY77LLo3Xfhy2_7Fd>=@-A$T=|p0FbqJ zH3tH%<;Y|uBt^-jfet3dKr%IRS66F$OBZE%C}Nk`AFX;PaFcRQ@X0Lz81JplA?B4}=c@6!O z?0sRee+M=6-v<7J%>JkPKVjP!r1p25!~9nN-&4VV=6dO=|Ab!uo(lx~JJ){?>;7+r zdBJ3VhYj4ndDwpn`1A4j?@O8Rd(a;c?Vsaciu&hu!OIi#?" in ranger! -class my_edit(Command): - # The so-called doc-string of the class will be visible in the built-in - # help that is accessible by typing "?c" inside ranger. - """:my_edit - - A sample command for demonstration purposes that opens a file in an editor. - """ - - # The execute method is called when you run this command in ranger. - def execute(self): - # self.arg(1) is the first (space-separated) argument to the function. - # This way you can write ":my_edit somefilename". - if self.arg(1): - # self.rest(1) contains self.arg(1) and everything that follows - target_filename = self.rest(1) - else: - # self.fm is a ranger.core.filemanager.FileManager object and gives - # you access to internals of ranger. - # self.fm.thisfile is a ranger.container.file.File object and is a - # reference to the currently selected file. - target_filename = self.fm.thisfile.path - - # This is a generic function to print text in ranger. - self.fm.notify("Let's edit the file " + target_filename + "!") - - # Using bad=True in fm.notify allows you to print error messages: - if not os.path.exists(target_filename): - self.fm.notify("The given file does not exist!", bad=True) - return - - # This executes a function from ranger.core.acitons, a module with a - # variety of subroutines that can help you construct commands. - # Check out the source, or run "pydoc ranger.core.actions" for a list. - self.fm.edit_file(target_filename) - - # The tab method is called when you press tab, and should return a list of - # suggestions that the user will tab through. - # tabnum is 1 for and -1 for by default - def tab(self, tabnum): - # This is a generic tab-completion function that iterates through the - # content of the current directory. - return self._tab_directory_content() diff --git a/ranger/ranger.symlink/commands_full.py b/ranger/ranger.symlink/commands_full.py deleted file mode 100755 index d177203..0000000 --- a/ranger/ranger.symlink/commands_full.py +++ /dev/null @@ -1,1836 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of ranger, the console file manager. -# This configuration file is licensed under the same terms as ranger. -# =================================================================== -# -# NOTE: If you copied this file to /etc/ranger/commands_full.py or -# ~/.config/ranger/commands_full.py, then it will NOT be loaded by ranger, -# and only serve as a reference. -# -# =================================================================== -# This file contains ranger's commands. -# It's all in python; lines beginning with # are comments. -# -# Note that additional commands are automatically generated from the methods -# of the class ranger.core.actions.Actions. -# -# You can customize commands in the files /etc/ranger/commands.py (system-wide) -# and ~/.config/ranger/commands.py (per user). -# They have the same syntax as this file. In fact, you can just copy this -# file to ~/.config/ranger/commands_full.py with -# `ranger --copy-config=commands_full' and make your modifications, don't -# forget to rename it to commands.py. You can also use -# `ranger --copy-config=commands' to copy a short sample commands.py that -# has everything you need to get started. -# But make sure you update your configs when you update ranger. -# -# =================================================================== -# Every class defined here which is a subclass of `Command' will be used as a -# command in ranger. Several methods are defined to interface with ranger: -# execute(): called when the command is executed. -# cancel(): called when closing the console. -# tab(tabnum): called when is pressed. -# quick(): called after each keypress. -# -# tab() argument tabnum is 1 for and -1 for by default -# -# The return values for tab() can be either: -# None: There is no tab completion -# A string: Change the console to this string -# A list/tuple/generator: cycle through every item in it -# -# The return value for quick() can be: -# False: Nothing happens -# True: Execute the command afterwards -# -# The return value for execute() and cancel() doesn't matter. -# -# =================================================================== -# Commands have certain attributes and methods that facilitate parsing of -# the arguments: -# -# self.line: The whole line that was written in the console. -# self.args: A list of all (space-separated) arguments to the command. -# self.quantifier: If this command was mapped to the key "X" and -# the user pressed 6X, self.quantifier will be 6. -# self.arg(n): The n-th argument, or an empty string if it doesn't exist. -# self.rest(n): The n-th argument plus everything that followed. For example, -# if the command was "search foo bar a b c", rest(2) will be "bar a b c" -# self.start(n): Anything before the n-th argument. For example, if the -# command was "search foo bar a b c", start(2) will be "search foo" -# -# =================================================================== -# And this is a little reference for common ranger functions and objects: -# -# self.fm: A reference to the "fm" object which contains most information -# about ranger. -# self.fm.notify(string): Print the given string on the screen. -# self.fm.notify(string, bad=True): Print the given string in RED. -# self.fm.reload_cwd(): Reload the current working directory. -# self.fm.thisdir: The current working directory. (A File object.) -# self.fm.thisfile: The current file. (A File object too.) -# self.fm.thistab.get_selection(): A list of all selected files. -# self.fm.execute_console(string): Execute the string as a ranger command. -# self.fm.open_console(string): Open the console with the given string -# already typed in for you. -# self.fm.move(direction): Moves the cursor in the given direction, which -# can be something like down=3, up=5, right=1, left=1, to=6, ... -# -# File objects (for example self.fm.thisfile) have these useful attributes and -# methods: -# -# tfile.path: The path to the file. -# tfile.basename: The base name only. -# tfile.load_content(): Force a loading of the directories content (which -# obviously works with directories only) -# tfile.is_directory: True/False depending on whether it's a directory. -# -# For advanced commands it is unavoidable to dive a bit into the source code -# of ranger. -# =================================================================== - -from __future__ import (absolute_import, division, print_function) - -from collections import deque -import os -import re - -from ranger.api.commands import Command - - -class alias(Command): - """:alias - - Copies the oldcommand as newcommand. - """ - - context = 'browser' - resolve_macros = False - - def execute(self): - if not self.arg(1) or not self.arg(2): - self.fm.notify('Syntax: alias ', bad=True) - return - - self.fm.commands.alias(self.arg(1), self.rest(2)) - - -class echo(Command): - """:echo - - Display the text in the statusbar. - """ - - def execute(self): - self.fm.notify(self.rest(1)) - - -class cd(Command): - """:cd [-r] - - The cd command changes the directory. - If the path is a file, selects that file. - The command 'cd -' is equivalent to typing ``. - Using the option "-r" will get you to the real path. - """ - - def execute(self): - if self.arg(1) == '-r': - self.shift() - destination = os.path.realpath(self.rest(1)) - if os.path.isfile(destination): - self.fm.select_file(destination) - return - else: - destination = self.rest(1) - - if not destination: - destination = '~' - - if destination == '-': - self.fm.enter_bookmark('`') - else: - self.fm.cd(destination) - - def _tab_args(self): - # dest must be rest because path could contain spaces - if self.arg(1) == '-r': - start = self.start(2) - dest = self.rest(2) - else: - start = self.start(1) - dest = self.rest(1) - - if dest: - head, tail = os.path.split(os.path.expanduser(dest)) - if head: - dest_exp = os.path.join(os.path.normpath(head), tail) - else: - dest_exp = tail - else: - dest_exp = '' - return (start, dest_exp, os.path.join(self.fm.thisdir.path, dest_exp), - dest.endswith(os.path.sep)) - - @staticmethod - def _tab_paths(dest, dest_abs, ends_with_sep): - if not dest: - try: - return next(os.walk(dest_abs))[1], dest_abs - except (OSError, StopIteration): - return [], '' - - if ends_with_sep: - try: - return [os.path.join(dest, path) for path in next(os.walk(dest_abs))[1]], '' - except (OSError, StopIteration): - return [], '' - - return None, None - - def _tab_match(self, path_user, path_file): - if self.fm.settings.cd_tab_case == 'insensitive': - path_user = path_user.lower() - path_file = path_file.lower() - elif self.fm.settings.cd_tab_case == 'smart' and path_user.islower(): - path_file = path_file.lower() - return path_file.startswith(path_user) - - def _tab_normal(self, dest, dest_abs): - dest_dir = os.path.dirname(dest) - dest_base = os.path.basename(dest) - - try: - dirnames = next(os.walk(os.path.dirname(dest_abs)))[1] - except (OSError, StopIteration): - return [], '' - - return [os.path.join(dest_dir, d) for d in dirnames if self._tab_match(dest_base, d)], '' - - def _tab_fuzzy_match(self, basepath, tokens): - """ Find directories matching tokens recursively """ - if not tokens: - tokens = [''] - paths = [basepath] - while True: - token = tokens.pop() - matches = [] - for path in paths: - try: - directories = next(os.walk(path))[1] - except (OSError, StopIteration): - continue - matches += [os.path.join(path, d) for d in directories - if self._tab_match(token, d)] - if not tokens or not matches: - return matches - paths = matches - - return None - - def _tab_fuzzy(self, dest, dest_abs): - tokens = [] - basepath = dest_abs - while True: - basepath_old = basepath - basepath, token = os.path.split(basepath) - if basepath == basepath_old: - break - if os.path.isdir(basepath_old) and not token.startswith('.'): - basepath = basepath_old - break - tokens.append(token) - - paths = self._tab_fuzzy_match(basepath, tokens) - if not os.path.isabs(dest): - paths_rel = basepath - paths = [os.path.relpath(path, paths_rel) for path in paths] - else: - paths_rel = '' - return paths, paths_rel - - def tab(self, tabnum): - from os.path import sep - - start, dest, dest_abs, ends_with_sep = self._tab_args() - - paths, paths_rel = self._tab_paths(dest, dest_abs, ends_with_sep) - if paths is None: - if self.fm.settings.cd_tab_fuzzy: - paths, paths_rel = self._tab_fuzzy(dest, dest_abs) - else: - paths, paths_rel = self._tab_normal(dest, dest_abs) - - paths.sort() - - if self.fm.settings.cd_bookmarks: - paths[0:0] = [ - os.path.relpath(v.path, paths_rel) if paths_rel else v.path - for v in self.fm.bookmarks.dct.values() for path in paths - if v.path.startswith(os.path.join(paths_rel, path) + sep) - ] - - if not paths: - return None - if len(paths) == 1: - return start + paths[0] + sep - return [start + dirname for dirname in paths] - - -class chain(Command): - """:chain ; ; ... - - Calls multiple commands at once, separated by semicolons. - """ - - def execute(self): - if not self.rest(1).strip(): - self.fm.notify('Syntax: chain ; ; ...', bad=True) - return - for command in [s.strip() for s in self.rest(1).split(";")]: - self.fm.execute_console(command) - - -class shell(Command): - escape_macros_for_shell = True - - def execute(self): - if self.arg(1) and self.arg(1)[0] == '-': - flags = self.arg(1)[1:] - command = self.rest(2) - else: - flags = '' - command = self.rest(1) - - if command: - self.fm.execute_command(command, flags=flags) - - def tab(self, tabnum): - from ranger.ext.get_executables import get_executables - if self.arg(1) and self.arg(1)[0] == '-': - command = self.rest(2) - else: - command = self.rest(1) - start = self.line[0:len(self.line) - len(command)] - - try: - position_of_last_space = command.rindex(" ") - except ValueError: - return (start + program + ' ' for program - in get_executables() if program.startswith(command)) - if position_of_last_space == len(command) - 1: - selection = self.fm.thistab.get_selection() - if len(selection) == 1: - return self.line + selection[0].shell_escaped_basename + ' ' - return self.line + '%s ' - - before_word, start_of_word = self.line.rsplit(' ', 1) - return (before_word + ' ' + file.shell_escaped_basename - for file in self.fm.thisdir.files or [] - if file.shell_escaped_basename.startswith(start_of_word)) - - -class open_with(Command): - - def execute(self): - app, flags, mode = self._get_app_flags_mode(self.rest(1)) - self.fm.execute_file( - files=[f for f in self.fm.thistab.get_selection()], - app=app, - flags=flags, - mode=mode) - - def tab(self, tabnum): - return self._tab_through_executables() - - def _get_app_flags_mode(self, string): # pylint: disable=too-many-branches,too-many-statements - """Extracts the application, flags and mode from a string. - - examples: - "mplayer f 1" => ("mplayer", "f", 1) - "atool 4" => ("atool", "", 4) - "p" => ("", "p", 0) - "" => None - """ - - app = '' - flags = '' - mode = 0 - split = string.split() - - if len(split) == 1: - part = split[0] - if self._is_app(part): - app = part - elif self._is_flags(part): - flags = part - elif self._is_mode(part): - mode = part - - elif len(split) == 2: - part0 = split[0] - part1 = split[1] - - if self._is_app(part0): - app = part0 - if self._is_flags(part1): - flags = part1 - elif self._is_mode(part1): - mode = part1 - elif self._is_flags(part0): - flags = part0 - if self._is_mode(part1): - mode = part1 - elif self._is_mode(part0): - mode = part0 - if self._is_flags(part1): - flags = part1 - - elif len(split) >= 3: - part0 = split[0] - part1 = split[1] - part2 = split[2] - - if self._is_app(part0): - app = part0 - if self._is_flags(part1): - flags = part1 - if self._is_mode(part2): - mode = part2 - elif self._is_mode(part1): - mode = part1 - if self._is_flags(part2): - flags = part2 - elif self._is_flags(part0): - flags = part0 - if self._is_mode(part1): - mode = part1 - elif self._is_mode(part0): - mode = part0 - if self._is_flags(part1): - flags = part1 - - return app, flags, int(mode) - - def _is_app(self, arg): - return not self._is_flags(arg) and not arg.isdigit() - - @staticmethod - def _is_flags(arg): - from ranger.core.runner import ALLOWED_FLAGS - return all(x in ALLOWED_FLAGS for x in arg) - - @staticmethod - def _is_mode(arg): - return all(x in '0123456789' for x in arg) - - -class set_(Command): - """:set