about summary refs log tree commit diff stats
path: root/html/subx/012elf.cc.html
Commit message (Expand)AuthorAgeFilesLines
* .Kartik Agaram2019-07-141-17/+17
* 5211Kartik Agaram2019-05-201-140/+154
* 5033Kartik Agaram2019-03-291-35/+36
* 4989Kartik Agaram2019-02-251-170/+175
* 4982Kartik Agaram2019-02-181-6/+6
* 4898Kartik Agaram2018-12-301-1/+1
* 4891Kartik Agaram2018-12-301-0/+1
* 4890 - new html renderingsKartik Agaram2018-12-291-16/+11
* 4878Kartik Agaram2018-12-271-1/+1
* 4869Kartik Agaram2018-12-161-23/+23
* 4814Kartik Agaram2018-12-011-11/+14
* 4782Kartik Agaram2018-11-261-35/+36
* 4734Kartik Agaram2018-10-281-75/+75
* 4724Kartik Agaram2018-10-241-93/+102
* 4709Kartik Agaram2018-10-171-90/+88
* 4649Kartik Agaram2018-10-021-153/+161
* 4520Kartik Agaram2018-09-261-19/+19
* 4588Kartik Agaram2018-09-221-165/+166
* 4539Kartik Agaram2018-09-071-111/+110
* 4536Kartik Agaram2018-09-071-99/+122
* 4521Kartik Agaram2018-08-131-28/+28
* 4478Kartik Agaram2018-08-041-0/+206
"n">division, print_function) # You can import any python module as needed. import os # You always need to import ranger.api.commands here to get the Command class: from ranger.api.commands import Command # Any class that is a subclass of "Command" will be integrated into ranger as a # command. Try typing ":my_edit<ENTER>" 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 <filename> 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<ENTER>". 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 <TAB> and -1 for <S-TAB> 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()