Skip to content

luketurner/contextext.py

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

contextext.py - tiny API for Windows context menu entries

Having new items in the Windows Explorer context menu can be nice. But it's a pain to add them manually. This is a simple Python library that makes it easier.

Extensions

You can have the menu entry appear on all file extensions using the wildcard "*". Use special string "Directory" to put menu entry on directories. Use special string "Background" to show menu entry when you right click in the window background.

Todo list

  • Escape quotations when generating .reg values
  • Add support for direct saving with windows API
  • Add support for loading existing extensions with windows API

Examples

Creating new items:

entry = ContextEntry("Launch dev server", "cmd /C node %1", ".js") # create a new context menu item
print("Making these changes:")
print(entry.partial_install_diff) # print the corresponding registry keys
entry.save() # save the new entry to the registry - Windows only - NOT IMPLEMENTED
with f = open("uninstall.reg", "w"):
    f.write(entry.removal_diff)

About

Easily add and remove context menu entries from Windows Explorer. A minimal lib for a simple job.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages