Skip to main content
Quick & dirty doc
=================

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

In \*sh shell:

.. code:: bash

python redflyingbaron.py [list of python files]

In (I)Python shell:

.. code:: python

# assuming that you have run: python redflyingbaron.py redflyingbaron.py ./test_redflyingbaron.py

# 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["./test_redflyingbaron.py"] # access by path (look at how this file is given in the cli; yes, it's a lame example)
red["test_redflyingbaron.py"] # access by filename
red["test_redflyingbaron"] # access by filename without extension
red[1:] # accept slices

red["f:./test_redflyingbaron.py"] # custom slicing query, returns files that match this request
red["f:redflyingbaron.py"] # 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
red.save() # 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", "again.py") # add more files

Todo
====

Next
----

- .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]

Futur
-----

- .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 http://docs.pyfilesystem.org/en/latest/)
- 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



Changelog
=========

0.1.1 (2015-02-14)
----------------

- Convert README to rst for pypi
- add some classifiers

0.1 (2015-02-14)
----------------

- First release

Metadata

Release files for redflyingbaron 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redflyingbaron 0.1.1
File Size Uploaded
redflyingbaron-0.1.1.tar.gz 4.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for redflyingbaron 0.1.1
File Interpreter ABI Platform
redflyingbaron-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details
redflyingbaron-0.1.1-py2.7.egg Legacy Egg format - - Details

Total release size: 14.7 kB

Release files / redflyingbaron-0.1.1.tar.gz

Download URL redflyingbaron-0.1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4816156ebeeffe0b427d58c1a3af8c3dbccfeb76de9c7868f31c8080a1d004e0
BLAKE2b-256 checksum
How to use checksums
0f7d3a9386613e6d26d2f4ab93dd931f896ddc3f090a6e16fe60bac62f386519
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / redflyingbaron-0.1.1-py2.py3-none-any.whl

Download URL redflyingbaron-0.1.1-py2.py3-none-any.whl
Size 6.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
32204277d9f6a6d2b240bcd76d9ee1fc58774f48c3931e5878b89a07dd90d6b2
BLAKE2b-256 checksum
How to use checksums
aa82e85ac28a1426bf94fce8f5d8d9afb73f3d3b6a446bf30adc32fdbbd6b138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / redflyingbaron-0.1.1-py2.7.egg

Download URL redflyingbaron-0.1.1-py2.7.egg
Size 4.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
4a07fefd9d1bdc5b09422b01efd73314159743fd7a8f2e47803d16be81d78c5e
BLAKE2b-256 checksum
How to use checksums
43494eb2fbad43e19195db34d4e9aef37a6f870eb22cc2d658378f1599d2bb35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

3 release files

0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page