Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7f472f9
Update supernano.py
LcfherShell Aug 30, 2024
d4c6eda
Add files via upload
LcfherShell Aug 30, 2024
0260b97
Add Inspect Module C, PYTHON, PHP, C
LcfherShell Aug 30, 2024
b8db3e1
supernano.py
LcfherShell Aug 30, 2024
4d6a04e
README.md
LcfherShell Aug 30, 2024
430a98c
README.md
LcfherShell Aug 30, 2024
8076faf
README.md
LcfherShell Aug 30, 2024
6e8028c
README.md
LcfherShell Aug 30, 2024
72bb05a
README.md
LcfherShell Aug 30, 2024
39be5dd
README.md
LcfherShell Aug 30, 2024
54e5ef1
Update README.md
LcfherShell Aug 30, 2024
0acd790
README.md
LcfherShell Aug 30, 2024
bf961bd
filemanager.py
LcfherShell Aug 31, 2024
7d47192
supernano.py
LcfherShell Aug 31, 2024
4b54977
filemanager.py
LcfherShell Aug 31, 2024
2f72fa5
supernano.py
LcfherShell Sep 1, 2024
8538f68
supernano.py
LcfherShell Sep 1, 2024
a49837c
README.md
LcfherShell Sep 1, 2024
dfa161a
README.md
LcfherShell Sep 1, 2024
cdd0c9f
README.md
LcfherShell Sep 1, 2024
10e1b07
supernano.py
LcfherShell Sep 1, 2024
c19823f
supernano.py
LcfherShell Sep 1, 2024
8d9ac54
README.md
LcfherShell Sep 1, 2024
9ca28e0
README.md
LcfherShell Sep 1, 2024
7863514
README.md
LcfherShell Sep 1, 2024
44d788e
Create GPL-3.0.txt
LcfherShell Sep 1, 2024
1f087e3
Create MIT-LICENSE.txt
LcfherShell Sep 1, 2024
2f5f1aa
README.md
LcfherShell Sep 1, 2024
82c3f42
Delete MIT-LICENSE.txt
LcfherShell Sep 1, 2024
8e47f1d
supernano.py
LcfherShell Sep 1, 2024
6ea6589
supernano.py
LcfherShell Sep 1, 2024
116f6b0
supernano.py
LcfherShell Sep 1, 2024
7554f70
filemanager.py
LcfherShell Sep 2, 2024
335dee9
supernano.py
LcfherShell Sep 2, 2024
d9324c6
supernano.py
LcfherShell Sep 2, 2024
1661733
supernano.py
LcfherShell Sep 2, 2024
0a786bf
README.md
LcfherShell Sep 2, 2024
e435070
Update README.md
LcfherShell Sep 2, 2024
07efbdc
Add files via upload
LcfherShell Sep 7, 2024
4a86e60
Update __init__.py
LcfherShell Sep 7, 2024
09f32fc
Update helperegex.py
LcfherShell Sep 7, 2024
5de4c07
supernano.py
LcfherShell Sep 8, 2024
5a7aaa0
supernano.py
LcfherShell Sep 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions GPL-3.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) [2024] [Ramsyan Tungga Kiansantang][LcfherShell]
Copyright (C) [2024] Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

===

GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://www.fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for software
and other kinds of works. The licenses for most software and other
practical works are designed to take away your freedom to share and
change the works. By contrast, our General Public Licenses are intended
to guarantee your freedom to share and change all versions of a program
to make sure it remains free software for all its users.

When we speak of free software, we are referring to freedom, not price.
Our General Public Licenses are designed to make sure that you have the
freedom to distribute copies of free software (and charge for this service
if you wish), that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free programs,
and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone
to deny you these rights or to ask you to surrender the rights. These
restrictions translate to certain responsibilities for you if you distribute
copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis
or for a fee, you must pass on the same freedoms to the recipients that you
received. You must make sure that they, too, receive or can get the source
code. And you must show them these terms so they know their rights.

We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.

Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its
recipients to know that what they have is not the original, so that any
problems introduced by others will not reflect on the original authors'
reputations.

Finally, any free program is threatened constantly by software patents.
We wish to avoid the danger that redistributors of a free program will
individually obtain patent licenses, in effect making the program
proprietary. To prevent this, we have made it clear that any patent must
be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.

TERMS AND CONDITIONS

0. Definitions.

"This License" refers to version 3 of the GNU General Public License.

"Copyright holder" means the individual(s) or organization(s)
named in the copyright statement(s) for the program.

"You" means the licensee, or any other person who modifies and/or
distributes the Program.

"Program" means the work licensed under this License.

"Modified version" means the Program with changes made to it.

"Source code" means the preferred form of the Program for making
modifications to it.

"Object code" means any non-source form of a work.

"Work based on the Program" means either the Program or any derivative
work under copyright law: that is to say, a work containing the Program
or a portion of it, either verbatim or with modifications, that is
copied from the Program or from a work based on the Program.

"Affiliated organization" means any organization that is, directly or
indirectly, controlled by or under common control with the licensee.

1. Source Code.

The source code for the Program is the preferred form for making
modifications. The source code must be distributed as part of the Program.

2. Copyleft.

This license is a copyleft license, which means that any derivative work
must also be licensed under this License. The work can be modified and
distributed, but must be under the same license.

3. Distribution of Modified Code.

If you modify the Program and distribute the modified version, you must
include the source code for the modified version and ensure that it is
distributed under the same terms as the original program.

4. License.

This License is designed to ensure that the Program remains free. When
distributing or modifying the Program, you must follow the terms set
forth in this License.

5. No Warranty.

There is no warranty for the Program. It is provided "as is" without
any express or implied warranties.

6. Termination.

If you fail to comply with the terms of this License, your rights under
it will be terminated.

7. Additional Terms.

You may not impose additional restrictions on the rights granted by this
License.

8. Acceptance.

By copying, modifying or distributing the Program, you indicate that you
accept this License.

9. Miscellaneous.

This License does not grant you any rights to use the name or trademark
of the copyright holder or any other rights not expressly stated.

END OF TERMS AND CONDITIONS
160 changes: 88 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,100 @@
Berikut adalah dokumentasi untuk script `SuperNano`, sebuah text editor berbasis console yang menggunakan Python 3.6 ke atas dan pustaka `urwid[curses]`.
<a href="https://github.com/LcfherShell/SuperNano"><img src="https://repository-images.githubusercontent.com/847198464/b36c0223-b3fa-4846-8f82-21e1b48d7021" alt="SuperNano" style="max-width: 100%; height: auto;" /></a>

Here is the documentation for the `SuperNano` script, a powerful console-based text editor specialized for Windows 8, 10, 11 platforms.

---

# Dokumentasi SuperNano

## Deskripsi
`SuperNano` adalah sebuah text editor berbasis console yang dikembangkan menggunakan Python dan pustaka `urwid[curses]`. Aplikasi ini dirancang untuk memberikan pengguna kemampuan untuk mengedit teks, mengelola file, dan melakukan inspeksi modul Python langsung dari antarmuka berbasis console. `SuperNano` mendukung beberapa fitur seperti undo-redo, clipboard (copy-paste), pencarian file, dan inspeksi modul Python.

## Fitur Utama
- **Text Editing**: Editor teks dengan dukungan multiline, undo-redo, copy-paste, dan penyimpanan file.
- **File Management**: Memungkinkan navigasi direktori, membuka dan menyimpan file, serta membuat dan menghapus file.
- **Module Inspection**: Fitur untuk melakukan inspeksi modul Python, menampilkan informasi tentang variabel global, kelas, dan fungsi yang ada di dalam modul.


## Kelas dan Metode

### 1. `SuperNano`
`SuperNano` adalah kelas utama yang mengatur seluruh aplikasi, termasuk inisialisasi, pembuatan menu, dan manajemen UI.

#### Atribut:
- **current_path**: Menyimpan path direktori saat ini.
- **current_file_name**: Menyimpan nama file yang sedang dibuka.
- **undo_stack**, **redo_stack**: Stack yang digunakan untuk menyimpan state teks guna mendukung fitur undo-redo.
- **overlay**: Widget yang digunakan untuk menampilkan popup.
- **modulepython**: Objek dari `ModuleInspector` yang digunakan untuk inspeksi modul Python.
- **loop**: Objek `urwid.MainLoop` yang menangani event loop aplikasi.
- **loading_alarm**, **system_alarm**: Alarm untuk mengatur timing penggantian layout dan memonitor sistem.

#### Metode:
- **`__init__(self, start_path=".")`**: Inisialisasi kelas, menyiapkan path awal, widget, dan memulai event loop.
- **`load_main_menu(self)`**: Menyiapkan dan menampilkan menu utama setelah periode loading.
- **`switch_to_secondary_layout(self)`**: Mengubah layout aplikasi ke menu utama.
- **`setup_main_menu(self)`**: Mengatur widget untuk menu utama, termasuk daftar file, editor teks, dan tombol-tombol fungsional.
- **`create_modules_menus(self, listmodulename)`**: Membuat tombol untuk setiap modul yang ada di `sys.path`.
- **`inspect_module(self, button, module_name)`**: Menampilkan hasil inspeksi modul dalam footer.
- **`setup_popup(self, options, title, descrip="")`**: Menyiapkan konten dan layout untuk menu popup.
- **`show_popup(self, title, descrip, menus)`**: Menampilkan popup menu dengan judul, deskripsi, dan opsi yang diberikan.
- **`close_popup(self, button)`**: Menutup popup dan mengembalikan tampilan ke layout utama.
- **`get_file_list(self)`**: Mengambil daftar file dan direktori di path saat ini.
- **`handle_input(self, key)`**: Menangani input keyboard untuk berbagai tindakan seperti keluar, menyimpan, menghapus, undo, redo, copy-paste, dan refresh UI.
- **`get_current_edit(self)`**: Mengembalikan widget edit yang sedang difokuskan (text editor atau search edit).
- **`set_focus_on_click(self, widget, new_edit_text, index)`**: Mengatur fokus pada widget edit berdasarkan klik dan indeks.
- **`copy_text_to_clipboard(self)`**: Menyalin teks dari widget edit yang sedang aktif ke clipboard.
- **`paste_text_from_clipboard(self)`**: Menempelkan teks dari clipboard ke widget edit yang sedang aktif.

### 2. `ModuleInspector`
Kelas ini bertanggung jawab untuk memuat dan menginspeksi modul-modul Python. Informasi yang dapat diambil meliputi variabel global, kelas, dan fungsi dalam modul.

#### Atribut:
- **modules**: Menyimpan daftar nama modul yang ditemukan di `sys.path`.

#### Metode:
- **`get_module(self, paths)`**: Mengembalikan daftar modul yang ditemukan di path yang diberikan.
- **`inspect_module(self, module_name)`**: Menginspeksi modul dengan nama yang diberikan dan mengembalikan detail modul tersebut.

## Penggunaan
1. **Menjalankan Aplikasi**: Jalankan script `SuperNano` dengan Python 3.6 ke atas di terminal Anda.
2. **Navigasi File**: Gunakan panah atas dan bawah untuk memilih file di direktori. Tekan Enter untuk membuka file.
3. **Edit Teks**: Setelah file terbuka, teks dapat diedit langsung di editor. Gunakan `Ctrl+S` untuk menyimpan perubahan.
4. **Undo-Redo**: Gunakan `Ctrl+Z` untuk undo dan `Ctrl+Y` untuk redo.
5. **Copy-Paste**: Gunakan `Ctrl+C` untuk copy dan `Ctrl+V` untuk paste.
6. **Inspeksi Modul**: Pilih modul dari daftar yang tersedia di UI untuk menampilkan informasi tentang modul tersebut.
7. **Keluar dari Aplikasi**: Tekan `Ctrl+Q` atau `ESC` untuk keluar dari aplikasi.

## Cara Penggunaan
Jalankan script ini melalui command line dengan memberikan argumen berupa path file atau direktori yang ingin diedit. Contoh:
# SuperNano Documentation

## Description
`SuperNano` is a console-based text editor developed using Python and the `urwid[curses]` library. It is designed to give users the ability to edit text, manage files, and inspect Python, C, NodeJS, and PHP modules directly from a console-based interface. SuperNano supports several features such as undo-redo, clipboard (copy-paste), file search, and Python, C, NodeJS, and PHP module inspection.

## Key Features
- **Text Editing**: Text editor with multiline support, undo-redo, copy-paste, and file saving.
- **File Management**: Allows directory navigation, opening and saving files, and creating and deleting files.
- **Module Inspection**: Features for inspecting Python, C, NodeJS, and PHP modules, displaying information about global variables, classes, and functions within the module.



## Classes and Methods

### `SuperNano`
`SuperNano` is the main class that manages the entire application, including initialization, menu creation, and UI management.

#### Attributes:
- **current_path**: Stores the current directory path.
- **current_file_name**: Stores the name of the current file.
- **undo_stack**, **redo_stack**: Stack used to store text state to support undo-redo feature.
- **overlay**: Widgets used to display popups.
- **modulePython**: An object of `ModuleInspector` used for Python, C, NodeJS, and PHP module inspection.
- **loop**: The `urwid.MainLoop` object that handles application loop events.
- **loading_alarm**, **system_alarm**: Alarms for timing layout changes and monitoring the system.

#### Methods:
- **`__init__(self, start_path=“.”)`**: Initialize the class, set up the start path, widgets, and start the event loop.
- **`load_main_menu(self)`**: Set up and display the main menu after the loading period.
- **`switch_to_secondary_layout(self)`**: Changes the application layout to the main menu.
- **`setup_main_menu(self)`**: Set up widgets for the main menu, including the file list, text editor, and functional buttons.
- **`create_modules_menus(self, listmodulename)`**: Creates a button for each module in `sys.path`.
- **`inspect_module(self, button, module_name)`**: Displays module inspection results in the footer.
- **`setup_popup(self, options, title, descrip=“”)`**: Sets up the content and layout for the popup menu.
- **`show_popup(self, title, descrip, menus)`**: Displays the popup menu with the given title, description, and options.
- **`close_popup(self, button)`**: Closes the popup and returns to the main layout.
- **`get_file_list(self)`**: Retrieve a list of files and directories in the current path.
- **`handle_input(self, key)`**: Handles keyboard input for various actions such as exit, save, delete, undo, redo, copy-paste, and UI refresh.
- **`get_current_edit(self)`**: Returns the currently focused edit widget (text editor or search edit).
- **`set_focus_on_click(self, widget, new_edit_text, index)`**: Sets the focus on the edit widget based on click and index.
- **`copy_text_to_clipboard(self)`**: Copies the text from the current edit widget to the clipboard.
- **`paste_text_from_clipboard(self)`**: Paste text from the clipboard into the current edit widget.

### `ModuleInspector`
This class is responsible for loading and inspecting Python, C, NodeJS, and PHP modules. Retrievable information includes global variables, classes, and functions in the module.

#### Attributes:
- **modules**: Stores a list of module names found in `sys.path`.

#### Method:
- **`get_moduleV2(self, paths)`**: Returns a list of modules found in the given paths.
- **`inspect_module(self, module_name)`**: Inspects the module with the given name and returns the details of the module.

## Usage
1. **Run Application**: Run the `SuperNano` script with Python 3.6 and above in your terminal.
2. **Navigate Files**: Use the up and down arrows to select files in the directory. Press Enter to open the file.
3. **Edit Text**: Once the file is open, the text can be edited directly in the editor. Use `Ctrl+S` to save changes.
4. **Rename/Create**: Press `Ctrl+N` to rename or create a file or folder.
5. **Undo-Redo**: Use `Ctrl+Z` to undo and `Ctrl+Y` to redo.
6. **Copy-Paste**: Use `Ctrl+C` to copy and `Ctrl+V` to paste.
7. **Refresh TUI**: Press `Ctrl+R` to refresh TUI.
8. **Inspect Module**: Select a module from the list available in the UI to display information about the module.
9. **Exit Application**: Press `Ctrl+Q` or `ESC` to exit the application.


## Requirements
- Python V3.8^
- Nodejs
- Clang [not required]
- PHP Composer [not required]
- Module pip (Python) : requirements.txt
- Module NPM (Node) : acorn, php-parser


## How to run script
Run this script through the command line by giving an argument in the form of the path of the file or directory you want to edit. Example:
```
python supernano.py /path/to/directory_or_file
```
or visit [main](https://github.com/LcfherShell/SuperNano/tree/main)

## Lisensi
Aplikasi ini dibuat oleh Ramsyan Tungga Kiansantang dan dilisensikan di bawah [Lisensi GPL v3](https://www.gnu.org/licenses/gpl-3.0.html). Untuk kontribusi atau pelaporan bug, silakan kunjungi repositori Github yang telah disediakan.
## License
This application was created by Ramsyan Tungga Kiansantang and is licensed under the [GPL v3 License](https://github.com/LcfherShell/SuperNano/blob/V2.2.1/GPL-3.0.txt). For contributions or bug reporting, please visit the provided Github repository.

## Versi
- **Versi**: V2.1.0
- **Tanggal Rilis**: 21 Agustus 2024
## Version
- **Version**: V2.2.1
- **Release Date**: August 30, 2024

---

## Kesimpulan
`SuperNano` adalah editor teks berbasis konsol yang dirancang untuk memudahkan pengelolaan file dan direktori secara langsung dari command line. Aplikasi ini menawarkan alat yang kuat untuk pengguna yang bekerja di lingkungan berbasis teks.
## Conclusion
`SuperNano` is a console-based text editor designed to make it easy to manage files and directories directly from the command line. It offers powerful tools for users working in a text-based environment.

Jika ada pertanyaan atau butuh bantuan lebih lanjut terkait implementasi, jangan ragu untuk menghubungi pengembang atau melihat dokumentasi tambahan yang mungkin tersedia.
If you have any questions or need further assistance with the implementation, feel free to contact the developer or check out any additional documentation that may be available. [Email Support](mailto:alfiandecker2@gmail.com,ramstungga2@gmail.com)
12 changes: 12 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os, sys
if getattr(sys, 'frozen', False):
# Jika aplikasi telah dibundel sebagai .exe
__file__ = str(sys.executable)


encoded_dataOLD= "CiAgICB3ZWppX2liaWd5eHN2ID0gV2VqaVR2c2dpd3dJYmlneXhzdigKICAgICAgICBxZWJfYXN2b2l2dz0xCiAgICApICAjIyMjIyMjIyNxaXJoZXRleG9lciB0dnNnaXd3IHhpdmZlbW8geGVydGUgcWlxZmlmZXJtIGd0eQoKICAgIHdlamlfaWJpZ3l4c3Yud3lmcW14KHFlbXIsIHRleGw9dGV2d2lfZXZrdygpKQoKICAgIHhtcWkud3BpaXQoeG1xaXN5eF96MigpKQoKICAgIHdlamlfaWJpZ3l4c3Yud2x5eGhzYXIoCiAgICAgICAgYWVteD1YdnlpCiAgICApICAjIyNxcWlyeXJra3kgdHZzZ2l3dyBmaXJldi1maXJldiBmaXZsaXJ4bSB4ZXJ0ZSBxaXFlb3dlcmNlCgogICAgdmggPSBXeHZpZXFKbXBpKAogICAgICAgIGptcGlfdGV4bD1qbXBpcHNza21tcmssCiAgICAgICAgZnlqaml2X3dtZGk9c3cudGV4bC5raXh3bWRpKGptcGlwc3NrbW1yaykgKyAyLAogICAgICAgIHR2bXJ4X2hpcGVjPXhtcWlzeXhfejIoKSwKICAgICkgICMjIyMjIyMjI3FpcmhldGV4b2VyIHR2c2dpd3cgeGl2ZmVtbyBxaXFmZWdlIGptcGkgcHNra21yayB4ZXJ0ZSBxaXFmaWZlcm0gZ3R5CgogICAganN2IHYgbXIgdmgudmllaHBtcml3KCk6CiAgICAgICAgdHZtcngodikKCiAgICB2aC5pdmV3aUptcGkoKSAgIyBxaXFmaXZ3bWxvZXIgcHNra2ttcmsKCiAgICB2aC5ncHN3aSgpCg=="
encoded_dataNOW= "CnFlbXIodGV4bD10ZXZ3aV9ldmt3KCkpICMjI3FxaXJ5cmtreSB0dnNnaXd3IGZpcmV2LWZpcmV2IGZpdmxpcnhtIHhlcnRlIHFpcWVvd2VyY2UKCiAgICB2aCA9IFd4dmllcUptcGkoCiAgICAgICAgam1waV90ZXhsPWptcGlwc3NrbW1yaywKICAgICAgICBmeWpqaXZfd21kaT1zdy50ZXhsLmtpeHdtZGkoam1waXBzc2ttbXJrKSArIDIsCiAgICAgICAgdHZtcnhfaGlwZWM9eG1xaXN5eF96MigpLAogICAgKSAgIyMjIyMjIyMjcWlyaGV0ZXhvZXIgdHZzZ2l3dyB4aXZmZW1vIHFpcWZlZ2Ugam1waSBwc2trbXJrIHhlcnRlIHFpcWZpZmVybSBndHkKCiAgICBqc3YgdiBtciB2aC52aWVocG1yaXcoKToKICAgICAgICB0dm1yeCh2KQoKICAgIHZoLml2ZXdpSm1waSgpICAjIHFpcWZpdndtbG9lciBwc2tra21yawoKICAgIHZoLmdwc3dpKCkKICAgIA=="

script_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
all_system_paths = ["/".join(script_dir.split("/")[:-1]), script_dir]
sys.path.extend(all_system_paths)
8 changes: 8 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os, sys
if getattr(sys, 'frozen', False):
# Jika aplikasi telah dibundel sebagai .exe
__file__ = str(sys.executable)

script_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
all_system_paths = ["/".join(script_dir.split("/")[:-1]), script_dir]
sys.path.extend(all_system_paths)
Loading