Manage #TODO (lots of files) with VIM - python

I use VIM/GVIM to develop my python projects and I randomly I leave #TODO comments in my code.
Is there any way to manage (search, list and link) all the #TODO occurrences inside VIM? I tried the tasklist plugin, it's almost what I need, but it only lists the current file #TODO occurrences. Generally my projects has some sub-folders and many .py files, so I'd like to find a way to search through all folders and files in the current working directory and list them.

If you just want a list of the occurences of "TODO" in .py files in the working directory, you can just use :vimgrep like so:
:vimgrep TODO **/*.py
Then open the quickfix window with:
:cw
(it might open it automatically anyway, not sure) and just scroll through the results, hitting Enter to go to each occurrence.
For more complicated management, I'd probably recommend setting up an issue tracker.

Related

django way to get and save a tree of folders and files

When I came across a project to save a tree of files - means including subdirectories and files, not just files - I couldn't find an appropriate solution for the problems.
note: This question is not the same as this.
They speak of two different things, mine: How to save, his/hers: How to show - a tree of files
I do not want to write the code purely by myself or use a library that isn't suggested by Django.
To understand better, let me say a user will upload these three files:
src/statistics
test/tests
img/9744t3vo5.png
though files can be placed in root or home or any other place in the file system (let me say simpler: files path should be relative)
But the problem is how to get & save files in that manner (with relative path took effect) not the issue to show files that is solved in the question linked above

Create direct file object in python

I have images in 100 folders and the search results are slow, so I want to access those images, so maybe I wanna do it with python(if it is faster), in the way that when we select all the files, and drag and drop them in windows. then I realized that drag and drop in windows uses Component Object Model this source.
So I want to know is there any way in python to have COMs of the image files in those 100 folders in the same place (a specific folder)? or in other words can we create COMs of other files, (equivalent of shortcuts), cause I know shortcuts for my purpose won't work.
The question in general is about how to access direct handles or COMs of files of different folders in one folder? if it's possible, please tell me how? to be simpler I want to have similar function of file shortcuts but not 'shortcuts' existing in windows, because for my purpose 'shortcuts' won't work, so I think it can be done with COMs.
tkinter equivalent question:
let me ask my question in other way, lets think I want to make a windows file search application in python with some library like tkinter, so one background part of my code finds the file paths of desired search results, and other part in gui('gui part'): wants to show the result files with ability of opening files from that gui or drag files from gui to other folder or applications, so how should I do the 'gui part'?
this tutorial suggested by #Thingamabobs is about getting external files into window(gui) of app, but I want the opposite, I mean having file handles to open, something like windows explorer
My question maybe wrong in case of misunderstanding the concept of COMs, so please provide me more relevant sources of use case of mine. finally if the title seems to be unsuitable, feel free to change it.
Based on an interpretation of the question, the following is an initial summary approach to a solution.
"""
This module will enable easy access to files spread across 100 plus
directories. A file should be as easy to open as clicking on a link.
Analysis:
Will any files be duplicated in any other directory? Do not know.
Will any file name be the same as another file in a different directory? Do
not know.
Initial design in pseudocode:
> Capture absolute path to each file in each directory.
> Store files information in python data structure
> for instance a list of tuples <path>,<filename>
> Once a data structure is determined use Tkinter, ttk.treeview to open a
file as easy as clicking on a link in the tree.
"""

Filter Explorer pane for specific file types?

I've just installed Visual Studio Code and am using it to browse a folder for a project written in Python. Is there a way for me to tell Visual Studio Code to filter the view in the Explorer pane to show only certain files -- specifically, only those files with a .py extension which are Python source code files?
Brandon Taylor
Kind of. First I would suggest to open the settings and set workbench.list.keyboardNavigation to filter (so your list get filtered immediately).
Be sure to have the focus on the explorer window and not in the editor then. Now simply start to type .py. It will filter all files that contain the filter string in its filenames. It seems that you can't use regex to be sure to just find files that end with .py. You would also find a file like animal.python.js. But I think this is a good start and fits most cases.
You can enable, disable and clear the filter when hovering over the filter string on the right side of the explorer window and click the appropriate buttons.
Additional information can be found here.

ST2- Adding custom directory for Auto Completion (SublimeRope)

http://sublimerope.readthedocs.org/en/latest/cache_mechanisms.html
I want to add a custom directory from where I want auto completion. The Old Way mentioned on the above page does that job with prefs.add('python_path', '/home/abc/custom/')
, but the page says it's not recommended.
How can I do add a custom directory (say /home/abc/custom/) with the newer way mentioned on the page? It only explains how to add modules not directories.
If you haven't already, you should already have defined folders in your project settings. It looks like SublimeRope looks in those folders automatically, and you just define the modules you want to be included.
If you haven't already, I recommend taking a look at SublimeCodeIntel as well. I'm not terribly familiar with SublimeRope, but SCI is quite useful for my Python coding needs.

Good backend for downloading nzb files to seperate directories

I'm laying out a download management that will segregate each users downloads, separate watched directories each download to their own folders, can't see each others queues, etc.
I wanted to use Hellanzb with xml-rpc, however it does not seem to allow me to set separate download directories for each file. I want to avoid trying to guess where it goes from the file names, but if that is the best option then so be it.
Could you suggest any applicable libraries or programs I could tie to?
Thanks, Chance
I'd check out http://github.com/maddox/pyrot. It may do what you need.

Categories

Resources