[cairo] [PATCH] pycairo: Point to new upstream location
bryce at osg.samsung.com
Fri May 5 00:11:11 UTC 2017
On Fri, Apr 21, 2017 at 11:03:29AM +0200, Christoph Reiter wrote:
> This changes the main pycairo page to point to all the main resources at the
> new location.
> In addition any remaining resources on cairographics.org are referenced under
> "Legacy resources".
> The tutorial/resources pages remain with a link to their new location to not
> break existing links.
> Related discussion:
> src/bindings.mdwn | 2 +-
> src/pycairo.mdwn | 45 +++++++++++------------------
> src/pycairo/resources.mdwn | 61 +---------------------------------------
> src/pycairo/tutorial.mdwn | 70 +---------------------------------------------
> 4 files changed, 19 insertions(+), 159 deletions(-)
Alright, landed (and good luck):
941fe92..96cb24c master -> master
> diff --git a/src/bindings.mdwn b/src/bindings.mdwn
> index 9f6fa7c..612853c 100644
> --- a/src/bindings.mdwn
> +++ b/src/bindings.mdwn
> @@ -35,7 +35,7 @@ languages:
> * Prolog : [PLcairo]
> - * Python : [[pycairo]], [pycairo-3] branch with incomplete port to Python3,
> + * Python : [[pycairo]],
> [qahirah] high-level Pythonic binding, [cairocffi] binding created with
> CFFI, [pygobject] includes Cairo binding.
> diff --git a/src/pycairo.mdwn b/src/pycairo.mdwn
> index 4299cfe..3148cc2 100644
> --- a/src/pycairo.mdwn
> +++ b/src/pycairo.mdwn
> @@ -1,43 +1,30 @@
> [[!meta title="Pycairo"]]
> -Pycairo is a set of Python bindings for the [cairo graphics
> +Pycairo is a set of Python 2 & 3 bindings for the [cairo graphics
> -# Source Code
> -The latest releases are:
> +Since version 1.11.0 pycairo has moved to GitHub and pycairo and py2cairo have
> +been merged back into one project.
> -[py2cairo-1.10.0](/releases/py2cairo-1.10.0.tar.bz2) for python 2.x (>=2.6) 2011/05/01
> +**Git Repository:** <https://github.com/pygobject/pycairo>
> -[pycairo-1.10.0](/releases/pycairo-1.10.0.tar.bz2) for python 3.x (>=3.1) 2011/04/18
> +**Documentation:** <https://pycairo.readthedocs.io>
> -The development versions may be checked out from git using the following commands:
> +**Releases:** <https://github.com/pygobject/pycairo/releases>
> - git clone git://git.cairographics.org/git/py2cairo
> - git clone git://git.cairographics.org/git/pycairo
> +**Python Package Index:** <https://pypi.python.org/pypi/pycairo>
> -# Documentation
> +## Legacy Resources
> -pycairo for [python 2.x](/documentation/pycairo/2)
> +The old git repositories:
> -pycairo for [python 3.x](/documentation/pycairo/3)
> +* Python 3: <https://cgit.freedesktop.org/pycairo/>
> +* Python 2: <https://cgit.freedesktop.org/py2cairo/>
> -# License
> +Bugs from the old bug tracker:
> -Pycairo is [free software](http://www.fsf.org/licensing/essays/free-sw.html).
> -py2cairo is available to be redistributed and/or modified under the terms of either the GNU Lesser General Public License (LGPL) version 2.1 or the Mozilla Public License (MPL) version 1.1.
> -pycairo is licensed under the GNU Lesser General Public License (LGPL) version 3.
> -# Contact
> -Mailing list: [[cairo_mailing_lists|lists]]
> -Bugzilla: [List open bugs] | [Report a bug]
> - : https://bugs.freedesktop.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=pycairo&content=
> - : https://bugs.freedesktop.org/enter_bug.cgi?product=pycairo
> -# Misc
> -[pycairo resources](/pycairo/resources).
> +While all old and new release tarballs are available on GitHub the old ones up
> +to 1.10.0 are still available under [/releases](/releases/) and
> diff --git a/src/pycairo/resources.mdwn b/src/pycairo/resources.mdwn
> index 8671ec6..84cdba2 100644
> --- a/src/pycairo/resources.mdwn
> +++ b/src/pycairo/resources.mdwn
> @@ -1,62 +1,3 @@
> [[!meta title="Pycairo resources"]]
> -This section is for listing various useful [[pycairo|pycairo]] resources, feel free to contribute !
> -# Windows Binary Packages (unofficial)
> -Precompiled binaries for the Microsoft Windows platform can be obtained from the following sources:
> -[Precompiled PyCairo for Python 2.x from Uri Shaked](http://www.salsabeatmachine.org/python/pycairo-win32-packages.html)
> -# Some Libraries/Modules Using pycairo
> - * [Cairo Plot]: a module to plot graphics
> - * [hamster graphics library] - a sprite styled abstraction library for drawing and animation in PyGTK
> - * [matplotlib]: a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.
> - * [PyCha]: PYthon CHArts - a Python package for drawing charts
> - * [PyGoocanvas]: python bindings for GooCanvas which is a canvas widget for GTK+
> - * [PyGTK]: GTK+ for Python.
> - * rsvg: part of [gnome-python-desktop], it provides Python bindings for librsvg
> -# Some Applications Using pycairo
> - * [A Shogiban for Gnushogi].
> - * [gPodder]: a podcatcher.
> - * [Miro]: Internet TV, HD video player.
> - * pycairo projects at [Google Code].
> - * [PyChess].
> - * [Pyroute - OpenStreetMap].
> - * [Shoebot] - a pure Python graphics robot.
> -# Tutorials
> - * [Cairo Tutorial for Python (and other) Programmers]: Generic introduction to cairo concepts oriented to python.
> - * [Cairo Tutorial for PyGTK Programmers]: Tutorial about how to use cairo for drawing in [PyGTK](http://www.pygtk.org).
> - * _Writing a widget using cairo and PyGTK 2.8_ [Part 1], [Part 2]: A translation of the GNOME Journal tutorial by Davyd Madeley from C to Python.
> -# Demos
> - * [A Basic Cairo-clock in Python] using XShape.
> - * [A simple clock implemented in pygtk and cairo].
> -# Recipies
> -See the main [[cookbook]] page.
> - : http://www.tortall.net/mu/wiki/CairoTutorial
> - : http://www.tortall.net/mu/wiki/PyGTKCairoTutorial
> - : http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
> - : http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets2.htm
> - : http://live.gnome.org/PyGoocanvas
> - : http://blog.eikke.com/index.php/ikke/2007/02/17/python_cairo_xshape_and_clocks
> - : http://ralph-glass.homepage.t-online.de/clock/readme.html
> - : http://ralph-glass.homepage.t-online.de/shogi/readme.html
> - : http://pychess.googlepages.com
> - : http://gpodder.berlios.de
> - : http://bitbucket.org/lgs/pycha/wiki/Home
> - : http://www.pygtk.org
> - : http://www.pygtk.org/downloads.html
> - : http://matplotlib.sourceforge.net/
> - : https://launchpad.net/cairoplot
> - : http://code.google.com/hosting/search?q=pycairo&btn=Search+projects
> - : http://www.getmiro.com/
> - : http://wiki.openstreetmap.org/wiki/Pyroute
> - : http://tinkerhouse.net/shoebot/
> - : http://wiki.github.com/tbaugis/hamster_experiments/
> +This site has moved to <https://pycairo.readthedocs.io/en/latest/resources.html>
> diff --git a/src/pycairo/tutorial.mdwn b/src/pycairo/tutorial.mdwn
> index d7d0403..3a8ad0f 100644
> --- a/src/pycairo/tutorial.mdwn
> +++ b/src/pycairo/tutorial.mdwn
> @@ -1,71 +1,3 @@
> [[!meta title="An Introduction to Cairo with Python"]]
> -Cairo is a library for drawing vector graphics. Vector graphics are interesting because they don't lose clarity when resized or transformed.
> -Pycairo is a set of bindings for cairo. It provides the cairo module which can be used to call cairo commands from Python.
> -# Understanding How to use Cairo
> -The best way to understand how to use cairo is to imagine that you are an artist using a paintbrush to draw out a shape on canvas.
> -To begin, you can choose a few characteristics of your brush. You can choose the thickness of your brush and the colour you want to paint with. You can also choose the shape of your brush tip - You can choose either a circle or a square.
> -Once you have chosen your brush, you are ready to start painting. You have to be quite precise when describing what you want to appear.
> -Firstly, decide where you want to place your brush on the canvas. You do this by supplying an x & y coordinate. Next you define how you want your brush stroke to look - an arc, a straight line etc. Finally you define the point where you want your stoke to end, again by supplying an x & y coordinate. Triangles and squares are very easy to do!
> -More complex graphics are generated using variations of the above theme with a few additions such as Fills (colouring in), transformations (zooming in, moving) etc.
> -Using the Python interface to cairo
> -Nearly all the work revolves around using the cairo.Context (or cairo_t the cairo C API). This is the object that you send your drawing commands to. There are a few options available to initialize this object in different ways.
> -# Initializing the cairo.Context Object
> -* One Very Important thing to realize is there is a difference between the coordinates you are describing your graphics on and the coordinates you will be displaying your graphic on.
> - (Ex - When giving a presentation you draw on your transparent acetate before hand, and then display it on your overhead projector - cairo calls the transparent acetate the user space coordinates and the projected image the device space coordinates)
> - On initializing the cairo context object, we tell it how to transform our description to how it should be displayed. To do this we supply a transformation matrix. Modifying the transformation matrix can lead to some very interesting results.
> -* One of cairo's most powerful features is that it can output graphics in many different formats (it can use multiple back ends). For printing, we can have cairo translate our graphics into Postscript to be sent off to the printer. For on screen display, we can have cairo translate our graphics into something glitz can understand for hardware accelerated rendering! It has many more important and useful target back ends.
> -On initializing the cairo.Context, we set its target back end, supplying a few details (such as colour depth and size), as in the example below.
> -# Example
> - #!/usr/bin/env python
> - import math
> - import cairo
> - WIDTH, HEIGHT = 256, 256
> - surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
> - ctx = cairo.Context (surface)
> - ctx.scale (WIDTH, HEIGHT) # Normalizing the canvas
> - pat = cairo.LinearGradient (0.0, 0.0, 0.0, 1.0)
> - pat.add_color_stop_rgba (1, 0.7, 0, 0, 0.5) # First stop, 50% opacity
> - pat.add_color_stop_rgba (0, 0.9, 0.7, 0.2, 1) # Last stop, 100% opacity
> - ctx.rectangle (0, 0, 1, 1) # Rectangle(x0, y0, x1, y1)
> - ctx.set_source (pat)
> - ctx.fill ()
> - ctx.translate (0.1, 0.1) # Changing the current transformation matrix
> - ctx.move_to (0, 0)
> - ctx.arc (0.2, 0.1, 0.1, -math.pi/2, 0) # Arc(cx, cy, radius, start_angle, stop_angle)
> - ctx.line_to (0.5, 0.1) # Line to (x,y)
> - ctx.curve_to (0.5, 0.2, 0.5, 0.4, 0.2, 0.8) # Curve(x1, y1, x2, y2, x3, y3)
> - ctx.close_path ()
> - ctx.set_source_rgb (0.3, 0.2, 0.5) # Solid color
> - ctx.set_line_width (0.02)
> - ctx.stroke ()
> - surface.write_to_png ("example.png") # Output to PNG
> -# Further help
> -Other [[pycairo_resources|pycairo/resources]] (tutorials, examples) are available.
> +This site has moved to <https://pycairo.readthedocs.io/en/latest/tutorial.html>
> cairo mailing list
> cairo at cairographics.org
More information about the cairo