{"id":35015630,"url":"https://github.com/mdda/geany-project-tree","last_synced_at":"2025-12-27T05:19:28.594Z","repository":{"id":16878018,"uuid":"19638487","full_name":"mdda/geany-project-tree","owner":"mdda","description":"GeanyPy plugin for Geany that implements a \"Project-Tree\" view that make Geany more IDE-like (IMHO)","archived":false,"fork":false,"pushed_at":"2019-01-22T14:55:44.000Z","size":150,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-11T07:58:08.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdda.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-10T10:08:06.000Z","updated_at":"2020-05-24T03:13:00.000Z","dependencies_parsed_at":"2022-08-27T00:02:00.869Z","dependency_job_id":null,"html_url":"https://github.com/mdda/geany-project-tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/mdda/geany-project-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fgeany-project-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fgeany-project-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fgeany-project-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fgeany-project-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdda","download_url":"https://codeload.github.com/mdda/geany-project-tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Fgeany-project-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T05:19:26.813Z","updated_at":"2025-12-27T05:19:28.572Z","avatar_url":"https://github.com/mdda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project-Tree plugin for Geany\n\n\u003e  Note that this only works for ```geany``` up to version ```1.31```.  \n\u003e  See [this issue](https://github.com/codebrainz/geanypy/issues/48) for more details.\n\u003e  For now, I'm holding back my RPM install to version 1.31 (and not really suffering),\n\u003e  however if I see that (for instance) [peasy](https://github.com/kugel-/peasy) becomes\n\u003e  viable, I'll update here.\n\n\u003e  OTOH, since [this issue](https://github.com/kugel-/peasy/issues/10) isn't very promising \n\u003e  (after such a quiet period for ```peasy```), I'm looking at building an extension\n\u003e  for VScode that does the same job (and is backwards compatible with existing ```.project``` and ```.sesssion``` files).\n\n\u003e  As another alternative, I'm having a dig around doing this directly in C++, since \n\u003e  ```geany``` as an editor is super-familiar, small, and 'works-for-me'...\n\n\n## Motivation\n\nThis plugin gives Geany sidebar a 'project-tree' view of your files.  \n\nThe project-tree view can be different from how they're laid out on disk : \nPersonally, I prefer to keep a 'thematic' structure to a project - \nat the very least, it can be handy to keep files in an order not dictated by their sequence alphabetically.\n\n![Screenshot](./img/geany-project-tree_screenshot-1.png?raw=true)\n\nThe plugin is also designed to keep separate state for different repository folders, with the state being stored locally, \nso that one can put it into version control, for instance.\n\nI had previously contributed to a separate sidebar widget/app for SciTE, called SciTEpm (which is why this plugin\ncontains a loader for the xml files that SciTEpm saves).\n\n## File Layout\n\nFor each actual project that you have (as distinct from what Geany calls projects), typically one would \nlaunch Geany from its root directory (where the .git directory is stored, for instance).\n\nThe project-tree plugin's files are stored in a '.geany' directory (it will confirm before writing anything to disk) :\n\n * .geany\n   + project-tree-layout.ini\n   + session.ini\n   + [OPTIONAL: project-tree-layout_devel.ini]\n   + [OPTIONAL: session_default.ini ] \n * ... the rest of your files ...\n\nOf these files:\n * 'project-tree-layout.ini' will be relatively static (once the project is in mainenance mode), so could well be put into version control\n * 'session.ini' is just a dump of open files, so is probably not sensible to put into version control\n * 'project-tree-layout_devel.ini' is read-only, for testing\n * 'session_default.ini' is used if session.ini doesn't exist - so could be used as a starter set of relevant files for newcomers\n \n \n## Usage\n\nThe project-tree sidebar can be right-clicked, to get to :\n * 'Add this file', which adds the currently open document to the project-tree\n * 'Add group', which adds a new group heading\n * and other functions that should be obvious\n \nIt also allows drag-and-drop internally, so you can organize files \u0026 groups to your heart's content.\n\nAt the top of the sidebar is a quick menu, allowing you to Load/Save the Project-Tree layout, and current open files.\n\nWhen loaded for the first time in a directory, it's immediately ready to use : It will ask whether to create the \n'.geany' folder if you need to save the tree or the session.\n\n\n## Commentary\n\n### INI files\n\nThe .ini files are standard form, while enabling the storing of the full tree structure.\n\n\n### GTK drag-and-drop\n\nThis works within the Project-Tree sidepanel.  And it was really painful to do - \nparticularly since (for instance) some drops should be disallowed :\n\n * anything onto a file\n * anything onto itself, or a descendent, etc\n\nHopefully, someone that gets caught with the same problems can avoid *days* of Googling, and have a look at the code here.\n\n\n### Automagic Menubar Creation\n\nThe module contains code to 'instantly' create menus (and menubars) based upon annotated function names.  This looks \nrather kludgy, I know, but makes it very quick to add new features, etc.\n\nFor example, the following creates a File dropdown (ordering can be changed numerically) with a 'Load Project Tree' entry \nthat's auto-linked to the function that requires it:\n\n```python\ndef _menubar_0_File_0_Load_Project_Tree(self, data):\n    \"\"\"\n    Loads the project tree specified by the user in the message box\n    \"\"\"\n    print \"_menubar_0_File_0_Load_Project_Tree\"\n    project_tree_layout_ini = self._prompt_for_ini_file(\"*tree*.ini\")\n    if project_tree_layout_ini:\n        self._change_base_directory(os.path.dirname(os.path.dirname(project_tree_layout_ini))) # strip off .geany/XYZ.ini\n        self._load_project_tree(self.treeview.get_model(), project_tree_layout_ini)\n    return True\n```\n\nAnnotation style for menubar callbacks :\n *  _menubar _{order#} _{heading-label} _{submenu-order#} _{submenu-label}\n\n### Automagic Menu Creation\n\nSimilarly, for the right-click menu popup :\n\n```python\ndef _popup_0_SEPARATOR(self, data): pass\n    \ndef _popup_1_Add_Group(self, data):\n    print \"_popup_1_Add_Group\"\n    dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, \n                                    gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL,  \"Add Group :\")\n    \n    return True\n```\n\nAnnotation style for menu callbacks (normally for popups) :\n * _popup _{order#} _{heading-label}\n    \n\n\n## Dependencies\n\nThis plugin depends on GeanyPy. See GeanyPy's documentation/website for information on installation.\n\nOn Fedora, for instance, installing GeanyPy is as simple as : \n\n``` bash\n# yum install geany-plugins-geanypy python-devel\n\n```\n\n \n## Installation\n\nFirst you need to know where GeanyPy stores its plugin directory - and that the path has been set up.\n\nAs a local user on Fedora, this is done simply by running ```geany```, and making sure that the geanypy plugin is installed.\n\nThen (for versions \u003c 1.27, which is Fedora\u003c=22):\n\n```bash\ncd {base directory inside this repository}\nln -s `pwd`/project-tree ~/.config/geany/plugins/geanypy/plugins/\n```\n\nOr (for versions \u003e= 1.27, which is Fedora\u003e=23) - because ```GeanyPy``` is now a 'unified' plugin:\n\n```bash\ncd {base directory inside this repository}\nln -s `pwd`/project-tree/project_tree.py ~/.config/geany/plugins/\n```\n\nGeany will need to be restarted for GeanyPy to pick up the new plugin available.  If it doesn't work, you can also try to add it to the main geany installation instead :\n\n```bash\ncd {base directory inside this repository}\nsudo ln -s `pwd`/project-tree/project_tree.py /usr/lib64/geany/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Fgeany-project-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdda%2Fgeany-project-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Fgeany-project-tree/lists"}