Skip to main content

web.sh is a cross-platform script (web) and API for launching a browser(with x-www-browser (Linux, Unix), open (OSX), start (Windows),or python -m webbrowser)

Project description

https://img.shields.io/travis/westurner/websh.svg https://img.shields.io/pypi/v/websh.svg

web.sh is a cross-platform script (web) and API for launching a browser (with x-www-browser (Linux, Unix), open (OSX), start (Windows), or python -m webbrowser)

  • Free software: BSD license

Features

  • Open the configured default system web browser with one or more paths or URIs

  • Open to a relative path

  • Open to an absolute path

Installation

Install the web (and x-www-browser-) scripts:

pip install web.sh
pip install -e https://github.com/westurner/web.sh

Usage

The web script commandline interface:

web .
web ./index.html
web $WORKON_HOME/dotfiles/src/dotfiles/docs/_build/html/index.html
web localhost:8082   #  pgs docs/_build/html  # pypi:pgs
web https://westurner.org/dotfiles/
web westurner.org/dotfiles github.com/westurner/dotfiles  # !HTTPS!
x-www-browser- .

web --help commandline help:

Usage: web [-b|-x|-o|-s| <url1> [<url_n>]

Open a webbrowser (default: detect sys.platform)

Options:
-h, --help           show this help message and exit
-b, --webbrowser     Open with `python -m webbrowser`
-x, --x-www-browser  Open with `x-www-browser`
-o, --open           Open with `open`
-s, --start          Open with `start `
-v, --verbose
-q, --quiet
-t, --test

API

  • Instances of websh.websh.WebBrowser implement open_new_tab()

  • websh.websh.WebBrowser.x_www_browser calls open_new_tab() with a list of paths and/or URIs

  • web <urls> calls websh.websh.WebBrowser.x_www_browser to open new tabs for each path or URI:

    urls = (["https://westurner.org/dotfiles/",
             "https://github.com/westurner/dotfiles",
             "https://waffle.io/westurner/dotfiles"])
    output = list(WebBrowser.x_www_browser(urls))
    print(output)

Platform Notes

  • OSX: web -o ./README.rst and web -b ./README.rst open README.rst in the configured editor (not the configured system browser).

    Workarounds:

    • Specify the full path to a specific browser application followed by a quoted URI, for each URI in a newline-delimited list

History

0.1.1 (2015-06-21)

  • DOC: README.rst: links, Features, Usage, API

  • BLD: setup.py console_script entrypoint web = websh.web:main

  • BLD: setup.py console_script entrypoint x-www-browser- = websh.web:main

  • BUG,REF: websh.py: logging, logging config [07f9a0f]

  • BUG,CLN,DOC,REF,TST: websh.py: match_domain, :PymodeLintAuto, argv, logging config [4b33395]

  • ENH: websh.py: https://github.com/westurner/dotfiles/blob/master/scripts/web [29c0ca7]

  • BLD,RLS: *, setup.py, __init__.py: cookiecutter gh:audreyr/cookiecutter-pypackage [e288536]

0.1.2 (2015-06-21)

  • DOC: README.rst: API docs

  • RLS: setup.py, __init__.py: __version__ = 0.1.2

  • First release on PyPI

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

web.sh-0.1.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web.sh-0.1.2-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file web.sh-0.1.2.tar.gz.

File metadata

  • Download URL: web.sh-0.1.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for web.sh-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f815203fd5d3e6fa3eaf5179335900e13055d89d232a0fa5329fc04928f0d45e
MD5 0eea685f92f88c632470f86bd0ceba41
BLAKE2b-256 a1b37d70acfa490f6b788ae82f14f02c8ea0970a54b00b69e3e63c7af4e85660

See more details on using hashes here.

File details

Details for the file web.sh-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for web.sh-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dbcc869c03a2df61213f67a30fabedcd1c9b21cfa5627a606766bd18a224c6e6
MD5 024e3450eb38690657cbef46b602d5a7
BLAKE2b-256 6d56c3519946cc90cca83645ad1739c883cf743534635c8f945edb4a1877f3b8

See more details on using hashes here.

Supported by

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