Code Monkey home page Code Monkey logo

pydirman's Introduction

PYDIRMAN

Watch the tutorial here:

What happened here :/

A Python script to manage your directories.
(Only for DEBIAN systems)

Getting Started

git clone https://github.com/sadbro/pydirman.git
cd ./pydirman/main
sudo python3 setup.py
sudo pydirman

Contact Us

Facebook
Google
Github Wiki

WIKI


Walking through directories

Syntax

g {index}

Example

=================================================================
[0] directory_1
[1] directory_2
[2] directory_3
[3] directory_4
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path"
...
=================================================================
pydirman> 

To go into 'directory_1' : enter g 0

=================================================================
[0] file_1
[1] file_2
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path/directory_1"
...
=================================================================
pydirman> 

To return to previous directory: enter p

=================================================================
[0] directory_1
[1] directory_2
[2] directory_3
[3] directory_4
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path"
...
=================================================================
pydirman> 

MANAGEMENT


CREATION

Files

...
=================================================================
[0] file_1------------------------------------------size_1
=================================================================
...
pydirman>

To create a file : Enter n

pydirman> n
Enter file name [create]: 

Enter your newly created file name.

Enter file name [create]: file_2 

Entering extensions will use custom templates for newly created files like C, C++, Java etc.

...
=================================================================
[0] file_1------------------------------------------size_1
[1] file_2------------------------------------------size_2
=================================================================
...
pydirman>

Directories

To create a new directory : Enter m {directory_name}

Enter a directory name with no spaces

Correct Incorrect
hello_world hello world
...
=================================================================
[0] file_1------------------------------------------size_1
[1] file_2------------------------------------------size_2
[2] directory_name/
=================================================================
...
pydirman>

DELETION

Files

To delete a file : Enter d

pydirman> d
=================================================================
[0] file_1
[1] file_2
=================================================================
Enter file index [delete]: 

Enter your file index which you want to delete.

Directories

To delete a directory : Enter r

pydirman> r
=================================================================
[2] directory_name
=================================================================
Enter directory name: 

Enter your directory name which you want to delete.

For security purposes, system directories like lib, bin etc. cannot be deleted . Also directories with items inside them cannot be deleted .


FILE


Reading Contents

Syntax

g {index}

Example

=================================================================
[0] file_1-----------------------------------------size_1
[1] file_2-----------------------------------------size_2
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path/"
...
=================================================================
pydirman> 

To go to 'file_1' : enter g 0

=================================================================
[0] file_1-----------------------------------------size_1
[1] file_2-----------------------------------------size_2
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path/"
...
=================================================================
pydirman> g 0
FILE=[file_1]
[p]rint/[c]ancel/[e]xit: 
To print :     `p`
To cancel:     `c`
To exit:       `e`

PRINT

[p]rint/[c]ancel/[e]xit: p
===============================START=============================
*CONTENTS OF YOUR FILE*
================================END==============================

CANCEL

[p]rint/[c]ancel/[e]xit: c
...
=================================================================
[0] file_1-----------------------------------------size_1
[1] file_2-----------------------------------------size_2
=================================================================
...
YOUR CURRENT LOCATION: "your_current_path/"
...
=================================================================
pydirman> 

EXIT

It exits from pydirman.


Start File Handle

P.S. Only Handles One file at a time.

Syntax


test {index}

Custom Profile :

Pydirman supports custom profiling for use of special profiles, i.e. compile arguments that C, C++ uses during custom build. if the file is of such a extension then you will be asked to use a default profile (No custom build) or a previous profile or a whole new profile.

a Profile is of the following type: [profile_context] profile_args

profile_args cannot be written in next line. It must complete in the same line.

A profile context is like it's name. It is used to identify and load the profile_args in the file handler.

Example


Get Profile? [New/Load/{press Enter to skip}] 

Usage of Profiles

Enter l

l will load all the profiles and ask you for which profile you want to use

-----------------------------------------------------------------
CONTEXT[profile_1]: `...`
CONTEXT[profile_2]: `...`
-----------------------------------------------------------------
Enter profile context: 

enter which profile you want to use and press Enter.

Creation of Profiles

Enter n

n will prompt you to enter a new profile context and it's args.

Enter profile context: your_new_profile_context
Enter profile: your_new_profile_args

The new profile will be created and instantly used for this handle.


After Starting File Handling

FILE -> file_name
Enter command [exit|test|nano|clear|hex]

Only the first letter for each command is used.

Utility Commands

  • CLEAR : As it suggests, It clears and refreshes the screen.
  • EXIT : It exits from the handle and goes to the main screen.
  • HEX : It displays hexadecimal format of the contents of the handled file.
  • NANO : It opens the nano editor and enables you the edit the file.

Testing Commands

  • TEST : It will run the the file with appropriate compiler or interpreter. If any arguments is to be passed, It should be passed as it is after this command.
  • GC : It will get the current profile and display it.
  • CC : It will open the context file and it enables you to edit or add profiles.

Adding profiles should be done with proper syntax given in the profiling wiki.


SPECIAL COMMANDS

[that will make your life easier...] ;)

ED

This stands for "edit-source". It opens your current source code in a buffer of NANO.
The path is at /etc/pydirman.py

EDN

This stands for "edit-source-nano". It opens your current nano configuration in a buffer of NANO.
The path is at /etc/nanorc

U

This stands for "usb-open". It opens the path to folder where all your external devices, e.g. USB drives are located.
The path is at /media/your_name

T

This stands for "terminal-execute". It executes the command which you pass after this command.
>t ...args => $...args

OTHER COMMANDS:

Let's see the below example:

[9] file_9.ext_9---------------99 bytes
=======================================
...
=======================================

&9 will return "file_9.ext_9"
$file_9.ext_9 will return "9"

USING PYTHON COMMANDS:

You can now manipulate the output of a string using the EOC '^'

Lets say:

-> your file file_69.ext_69 is at index 69

you can extract only the file by using &69^.split(".")[0] which will return file_69


pydirman's People

Contributors

experimentalbro avatar sadbro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pydirman's Issues

Add support for Arch Linux

Is your feature request related to a problem? Please describe.
Currently, the setup.py file will only work for Debian based distros which use apt as their package manager. Other Linux users will have to manually setup Pydirman. :(

Describe the solution you'd like
Improve the setup.py file to add support for Arch Linux along with Debian Linux.

Describe alternatives you've considered
Writing separate setup files for different distros, but it won't be necessary unless we are adding support for a lot of distros.

Additional context

Setup for all GNU-Linux distributions

The current version of pydirman could be made to work on all distros by adding a few more conditions in the setup.py file.
Instead of installing the node and jdk packages in the setup, we can prompt the user to install them when they try to run js or java files without having node or jdk installed. Then the user can install the node/jdk packages from their respective package manager.

Feature request

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Create a new window to handle the output of the 'test' command

Is your feature request related to a problem? Please describe.
The current version of pydirman lets you test one file at a time and the output is printed in the same window. This is a problem when we are working with multiple files at the same time.

Describe the solution you'd like
Create a new terminal window which runs the 'test' command interface for the chosen file.

Adding config option for GUI file manager

Is your feature request related to a problem? Please describe.
The current code has the "nautilus" file manager hard-coded for the "o" command.

Describe the solution you'd like
I have implemented it as a config option [file_manager] just like the [text_editor] option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.