Skip to main content

A python module to help creating explorer menus for Windows Explorer.

Project description

Explorer Menu

A python module to help creating explorer menus for Windows Explorer.

How to use

Defining items

Items can either be:

  • Action items - items with a command associated to them
node('Label', 'cmd.exe /K echo action')
  • Container items - items that may contain other container items and/or action items
node('Root Label', node(...), node(...), ...)

Registering items

Simply call the register method of any item and it will be registered, along with all children items:

node('Label', 'cmd.exe /K echo action').register()

node('Root Label', node(...), node(...), node(...)).register()

After items are registered you will be able to find them by right clicking in an empty area of any folder of your Windows Explorer.

Removing items

Simply call the remove method of any item and it will be removed, along with all children items:

node('Label', 'cmd.exe /K echo action').remove()

node('Root Label', node(...), node(...), node(...)).remove()

Building commands

You can also use the cmd(command, keep_cmd_window=False) method to create commands:

from explorermenu import cmd

# explicitly invoking cmd.exe
node('Label', 'cmd.exe /K echo action')

# same as above, but building command with cmd() method
node('Label', cmd('echo action', keep_cmd_window=True))

Example:

from explorermenu.menu_items import node
from explorermenu import cmd

# a single action item
single_action_item = node('Root action', cmd('echo Root action', keep_cmd_window=True))

# a nested set of items
nested_set = \
    node('Root',
         node('Child 1',
              node('Grand child 1',
                   node('Grandgrand child 1', cmd('echo Grandgrand child 1 action', keep_cmd_window=True)),
                   node('Grandgrand child 2', cmd('echo Grandgrand child 2 action', keep_cmd_window=True)),
                   ),
              node('Grand child 2', cmd('echo Grand child 2 action', keep_cmd_window=True))
              ),
         node('Child 2', cmd('echo Child 2 action', keep_cmd_window=True)),
         )

# Register items
single_action_item.register()
nested_set.register()

# Remove items
single_action_item.remove()
nested_set.remove()

Version

v0.2.2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

explorer-menu-0.2.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

explorer_menu-0.2.2-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file explorer-menu-0.2.2.tar.gz.

File metadata

  • Download URL: explorer-menu-0.2.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.2

File hashes

Hashes for explorer-menu-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ad3291eb6e3e168c460eed8896f706c5d6d9d93fa8d76ab0677718015a8bfdaf
MD5 35cac6af95f0c28b7d1d7d18bfccb5b5
BLAKE2b-256 eaa973d2c27a4379ee5b9ff8e954fd62cbbc3ed6e583ec0889b45e4f3455436a

See more details on using hashes here.

File details

Details for the file explorer_menu-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: explorer_menu-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.2

File hashes

Hashes for explorer_menu-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0fc06e7b5fbfabdfc21baf51476e414d25744eea988ca15573c7831e572cb6c8
MD5 f985e6543e172d81edb14817a0a3cf25
BLAKE2b-256 fa5761a2bd801040620ca15a16e04f88c54d9a7dd78480a17ae08d326977a837

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page