File: make_pip_updater.py

package info (click to toggle)
python-pyshortcuts 1.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,632 kB
  • sloc: python: 1,097; makefile: 42
file content (22 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
"""
This example shows how to make a shortcut that runs a single python command

Here, the comand to run is
     python -m pip install --upgrade pyshortcuts

to update to the latest version of this library.


Note that putting '_' or '{}' as the beginning of the command will tell
the script to use the current Python executable.
"""
from pathlib import Path
from pyshortcuts import make_shortcut, uname, get_cwd

pycmd = "_ -m pip install --upgrade pyshortcuts"

iconfile = 'shovel.icns' if uname=='darwin' else 'shovel.ico'
icon = Path(get_cwd(), 'icons', iconfile).absolute().as_posix()

make_shortcut(pycmd, name='Update Pyshortcuts', icon=icon)