Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Project wrapper arround RedBaron

Project description

Quick & dirty doc

There isn't that much here yet, I'm mostly playing arround.

In \*sh shell:

.. code:: bash

python [list of python files]

In (I)Python shell:

.. code:: python

# assuming that you have run: python ./

# for now, red is an overloaded OrderedDict that contains file paths as keys
# and the corresponding RedBaron instances as values.

red # display the current files
red[0] # access by index
red["./"] # access by path (look at how this file is given in the cli; yes, it's a lame example)
red[""] # access by filename
red["test_redflyingbaron"] # access by filename without extension
red[1:] # accept slices

red["f:./"] # custom slicing query, returns files that match this request
red[""] # think of using it on a django project and asking
red["f:redflyingbaron"] # all "models" files

red[re.compile(r'[^_]+')] # can use a regex (^ and $ are put arround the regex)
red["re:[^_]+"] # regex for the lazy

red[lambda key, value: "red" in key] # can use a callable

red.find("stuff") # return the first matched stuff
red.find_all("stuff") # return all the matched stuff of all the files
red("stuff") # same

red.display() # display the content of the files, useful with a slice

red[0].save() # save modifications to disk # same but for all files of red (can be combined with slices)

red[0].reload() # reread the content of the file
red.reload() # same but for all files of red (can be combined with slices)

red.add("/path/to/file", "/path/to/another/file", "") # add more files



- .undo() .redo() (needs modifications of RedBaron to display hooks)
- .set\_automatic\_save() (or some better/other api) -> save at every
modification (needs modifications of RedBaron to display hooks)
- overload **del** so it behaves like **getitem**
- allow to use globs in red[query]


- .edit(editor=None) (find editor in $EDITOR of env) launch a text
editor on a tmp file containing the currently selected stuff, when
editing is done, parse the result and replace the node on which
.edit() was done with the result (should be in RedBaron instead?)
- session management: automatically save redflyingbaron instance +
undo/redo + files content (not sure on this one) somewhere in .json,
allow to list those and go back into a session
- RedBaron wrapper to abstract the filesystem (use this to allow python
files to be anywhere
- Add more filesystem abstraction, allow some kind of syntaxe like
"sftp://" "fuse://" on the Cli api
- history should be a tree like in vim/emacs


0.1.1 (2015-02-14)

- Convert README to rst for pypi
- add some classifiers

0.1 (2015-02-14)

- First release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for redflyingbaron, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size redflyingbaron-0.1.1-py2.7.egg (4.1 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size redflyingbaron-0.1.1-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size redflyingbaron-0.1.1.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page