./0000755000175000017500000000000011724500100010571 5ustar inventinvent./AUTHORS.rst0000644000175000017500000000041411724500043012455 0ustar inventinvent`httpcode` is written and maintained by Ruslan Spivak and various contributors: Patches and Suggestions ``````````````````````` - Flavio Curella, https://github.com/fcurella - Peter Aronoff, https://github.com/telemachus - Mark Striemer, https://github.com/mstriemer./README.rst0000644000175000017500000000472411724500043012275 0ustar inventinvent:: _ _ _____ _____ ____ ____ ___ ____ _____ | | | |_ _|_ _| _ \ / ___/ _ \| _ \| ____| | |_| | | | | | | |_) | | | | | | | | | _| | _ | | | | | | __/| |__| |_| | |_| | |___ |_| |_| |_| |_| |_| \____\___/|____/|_____| `httpcode` is a little utility that explains the meaning of an HTTP status code on the command line. `http://httpcode.readthedocs.org `_ Installation ------------ :: $ [sudo] pip install httpcode Usage ----- Explain 405 status code :: $ hc 405 Status code 405 Message: Method Not Allowed Code explanation: Specified method is invalid for this resource. Or 418 status code :) :: $ hc 418 Status code 418 Message: I'm a teapot Code explanation: The HTCPCP server is a teapot List all codes :: $ hc Status code 100 Message: Continue Code explanation: Request received, please continue Status code 101 Message: Switching Protocols Code explanation: Switching to new protocol; obey Upgrade header Status code 200 Message: OK Code explanation: Request fulfilled, document follows ... Search code(s) by description (case-insensitive) :: $ hc -s too Status code 413 Message: Request Entity Too Large Code explanation: Entity is too large. Status code 414 Message: Request-URI Too Long Code explanation: URI is too long. Filter codes with a regex :: $ hc 30[12] Status code 301 Message: Moved Permanently Code explanation: Object moved permanently -- see URI list Status code 302 Message: Found Code explanation: Object moved temporarily -- see URI list Use an 'x' for any digit :: $ hc 1xx Status code 100 Message: Continue Code explanation: Request received, please continue Status code 101 Message: Switching Protocols Code explanation: Switching to new protocol; obey Upgrade header Show help :: $ hc -h Usage: hc [code] [options] code may contain regular expression or use 'x' to denote any digit code examples: 418, 30[12], 3.*, 1xx Without parameters lists all available HTTP status codes and their description Options: -h, --help show this help message and exit -s SEARCH, --search=SEARCH Search for a code by name or description. Search text may contain regular expressions. Roadmap ------- Add more codes ./docs/0000755000175000017500000000000011724500043011527 5ustar inventinvent./docs/source/0000755000175000017500000000000011724500043013027 5ustar inventinvent./docs/source/conf.py0000644000175000017500000001707411724500043014337 0ustar inventinvent# -*- coding: utf-8 -*- # # httpcode documentation build configuration file, created by # sphinx-quickstart on Wed Dec 21 15:35:58 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'httpcode' copyright = u'2011, Ruslan Spivak' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.5' # The full version, including alpha/beta/rc tags. release = '0.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. html_theme_path = ['_theme'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = 'httpcode' # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'httpcodedoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'httpcode.tex', u'httpcode Documentation', u'Ruslan Spivak', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'httpcode', u'httpcode Documentation', [u'Ruslan Spivak'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'httpcode', u'httpcode Documentation', u'Ruslan Spivak', 'httpcode', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' ./docs/source/index.rst0000644000175000017500000000544311724500043014676 0ustar inventinvent.. httpcode documentation master file, created by sphinx-quickstart on Wed Dec 21 15:35:58 2011. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to httpcode =================== :: _ _ _____ _____ ____ ____ ___ ____ _____ | | | |_ _|_ _| _ \ / ___/ _ \| _ \| ____| | |_| | | | | | | |_) | | | | | | | | | _| | _ | | | | | | __/| |__| |_| | |_| | |___ |_| |_| |_| |_| |_| \____\___/|____/|_____| `httpcode` is a little utility that explains the meaning of an HTTP status code on the command line. Installation ------------ .. code-block:: bash $ [sudo] pip install httpcode Usage ----- Explain 405 status code .. code-block:: bash $ hc 405 Status code 405 Message: Method Not Allowed Code explanation: Specified method is invalid for this resource. Or 418 status code :) .. code-block:: bash $ hc 418 Status code 418 Message: I'm a teapot Code explanation: The HTCPCP server is a teapot List all codes .. code-block:: bash $ hc Status code 100 Message: Continue Code explanation: Request received, please continue Status code 101 Message: Switching Protocols Code explanation: Switching to new protocol; obey Upgrade header Status code 200 Message: OK Code explanation: Request fulfilled, document follows ... Search code(s) by description (case-insensitive) .. code-block:: bash $ hc -s too Status code 413 Message: Request Entity Too Large Code explanation: Entity is too large. Status code 414 Message: Request-URI Too Long Code explanation: URI is too long. Filter codes with a regex .. code-block:: bash $ hc 30[12] Status code 301 Message: Moved Permanently Code explanation: Object moved permanently -- see URI list Status code 302 Message: Found Code explanation: Object moved temporarily -- see URI list Use an 'x' for any digit .. code-block:: bash $ hc 1xx Status code 100 Message: Continue Code explanation: Request received, please continue Status code 101 Message: Switching Protocols Code explanation: Switching to new protocol; obey Upgrade header Show help .. code-block:: bash $ hc -h Usage: hc [code] [options] code may contain regular expression or use 'x' to denote any digit code examples: 418, 30[12], 3.*, 1xx Without parameters lists all available HTTP status codes and their description Options: -h, --help show this help message and exit -s SEARCH, --search=SEARCH Search for a code by name or description. Search text may contain regular expressions. Roadmap ------- Add more codes ./docs/source/_theme/0000755000175000017500000000000011724500043014270 5ustar inventinvent./docs/source/_theme/default/0000755000175000017500000000000011724500043015714 5ustar inventinvent./docs/source/_theme/default/theme.conf0000644000175000017500000000132311724500043017664 0ustar inventinvent[theme] inherit = basic stylesheet = default.css pygments_style = sphinx [options] rightsidebar = false stickysidebar = false collapsiblesidebar = false externalrefs = false footerbgcolor = #11303d footertextcolor = #ffffff sidebarbgcolor = #1c4e63 sidebarbtncolor = #3c6e83 sidebartextcolor = #ffffff sidebarlinkcolor = #98dbcc relbarbgcolor = #133f52 relbartextcolor = #ffffff relbarlinkcolor = #ffffff bgcolor = #ffffff textcolor = #000000 headbgcolor = #f2f2f2 headtextcolor = #20435c headlinkcolor = #c60f0f linkcolor = #355f7c visitedlinkcolor = #355f7c codebgcolor = #eeffcc codetextcolor = #333333 bodyfont = sans-serif headfont = 'Trebuchet MS', sans-serif ./docs/source/_theme/default/layout.html0000644000175000017500000000067711724500043020131 0ustar inventinvent{% extends "basic/layout.html" %} {%- block extrahead %} Fork me on GitHub {% endblock %} ./docs/source/_theme/default/static/0000755000175000017500000000000011724500043017203 5ustar inventinvent./docs/source/_theme/default/static/sidebar.js0000644000175000017500000001120411724500043021150 0ustar inventinvent/* * sidebar.js * ~~~~~~~~~~ * * This script makes the Sphinx sidebar collapsible. * * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton * used to collapse and expand the sidebar. * * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden * and the width of the sidebar and the margin-left of the document * are decreased. When the sidebar is expanded the opposite happens. * This script saves a per-browser/per-session cookie used to * remember the position of the sidebar among the pages. * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ $(function() { // global elements used by the functions. // the 'sidebarbutton' element is defined as global after its // creation, in the add_sidebar_button function var bodywrapper = $('.bodywrapper'); var sidebar = $('.sphinxsidebar'); var sidebarwrapper = $('.sphinxsidebarwrapper'); // for some reason, the document has no sidebar; do not run into errors if (!sidebar.length) return; // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded var bw_margin_expanded = bodywrapper.css('margin-left'); var ssb_width_expanded = sidebar.width(); // margin-left of the bodywrapper and width of the sidebar // with the sidebar collapsed var bw_margin_collapsed = '.8em'; var ssb_width_collapsed = '.8em'; // colors used by the current theme var dark_color = $('.related').css('background-color'); var light_color = $('.document').css('background-color'); function sidebar_is_collapsed() { return sidebarwrapper.is(':not(:visible)'); } function toggle_sidebar() { if (sidebar_is_collapsed()) expand_sidebar(); else collapse_sidebar(); } function collapse_sidebar() { sidebarwrapper.hide(); sidebar.css('width', ssb_width_collapsed); bodywrapper.css('margin-left', bw_margin_collapsed); sidebarbutton.css({ 'margin-left': '0', 'height': bodywrapper.height() }); sidebarbutton.find('span').text('»'); sidebarbutton.attr('title', _('Expand sidebar')); document.cookie = 'sidebar=collapsed'; } function expand_sidebar() { bodywrapper.css('margin-left', bw_margin_expanded); sidebar.css('width', ssb_width_expanded); sidebarwrapper.show(); sidebarbutton.css({ 'margin-left': ssb_width_expanded-12, 'height': bodywrapper.height() }); sidebarbutton.find('span').text('«'); sidebarbutton.attr('title', _('Collapse sidebar')); document.cookie = 'sidebar=expanded'; } function add_sidebar_button() { sidebarwrapper.css({ 'float': 'left', 'margin-right': '0', 'width': ssb_width_expanded - 28 }); // create the button sidebar.append( '
«
' ); var sidebarbutton = $('#sidebarbutton'); light_color = sidebarbutton.css('background-color'); // find the height of the viewport to center the '<<' in the page var viewport_height; if (window.innerHeight) viewport_height = window.innerHeight; else viewport_height = $(window).height(); sidebarbutton.find('span').css({ 'display': 'block', 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 }); sidebarbutton.click(toggle_sidebar); sidebarbutton.attr('title', _('Collapse sidebar')); sidebarbutton.css({ 'color': '#FFFFFF', 'border-left': '1px solid ' + dark_color, 'font-size': '1.2em', 'cursor': 'pointer', 'height': bodywrapper.height(), 'padding-top': '1px', 'margin-left': ssb_width_expanded - 12 }); sidebarbutton.hover( function () { $(this).css('background-color', dark_color); }, function () { $(this).css('background-color', light_color); } ); } function set_position_from_cookie() { if (!document.cookie) return; var items = document.cookie.split(';'); for(var k=0; k