A more Pythonic version of doxypy, a Doxygen filter for Python.
doxypypy
A more Pythonic version of doxypy, a Doxygen filter for Python.
Intent
For now Doxygen has limited support for Python. It recognizes Python comments,
but otherwise treats the language as being more or less like Java. It doesn't
understand basic Python syntax constructs like docstrings, keyword arguments,
generators, nested functions, decorators, or lambda expressions. It likewise
doesn't understand conventional constructs like doctests or ZOPE-style
interfaces. It does however support inline filters that can be used to make
input source code a little more like what it's expecting.
The excellent doxypy makes it possible to embed Doxygen commands in Python
docstrings, and have those docstrings converted to Doxygen-recognized comments
on the fly per Doxygen's regular input filtering process. It however does not
address any of the other previously mentioned areas of difficulty.
This project started off as a fork of doxypy but quickly became quite distinct.
It shares little (if any) of the same code at this point (but maintains the
original license just in case). It is meant to support all the same command
line options as doxypy, but handle additional Python syntax beyond docstrings.
Additional Syntax Supported
Python can have functions and classes within both functions and classes.
Doxygen best understands this concept via its notion of namespaces. This filter
thus can supply Doxygen tags marking namespaces on every function and class.
This addresses the issue of Doxygen merging inner functions' documentation with
the documentation of the parent.
Python class members whose names begin with a double-underscore are mangled
and kept private by the language. Doxygen does not understand this natively
yet, so this filter additionally provides Doxygen tags to label such variables
as private.
Python frequently embeds doctests within docstrings. This filter makes it
trivial to mark off such sections of the docstring so they get displayed as
code.
ZOPE-style interfaces overload class definitions to be interface definitions,
use embedded variable assignments to identify attributes, and use specific
function calls to indicate interface adherence. Furthermore, they frequently
don't have any code beyond their docstrings, so naively removing docstrings
would result in broken Python. This filter has basic understanding of these
interfaces and treats them accordingly, supplying Doxygen tags as appropriate.
Fundamentally Python docstrings are meant for humans and not machines, and ought
not to have special mark-up beyond conventional structured text. This filter
heuristically examines Python docstrings, and ones like the sample for complex
in PEP 257 or that generally follow the stricter Google Python Style Guide
will get appropriate Doxygen tags automatically added.
How It Works
This project takes a radically different approach than doxypy. Rather than use
regular expressions tied to a state machine to figure out syntax, Python's own
Abstract Syntax Tree module is used to extract items of interest. If the
autobrief option is enabled, docstrings are parsed via a set of regular
expressions and a producer / consumer pair of coroutines.
Example
This filter will correctly process code like the following working (albeit
contrived) example:
defmyfunction(arg1, arg2, kwarg='whatever.'):
""" Does nothing more than demonstrate syntax. This is an example of how a Pythonic human-readable docstring can get parsed by doxypypy and marked up with Doxygen commands as a regular input filter to Doxygen. Args: arg1: A positional argument. arg2: Another positional argument. Kwargs: kwarg: A keyword argument. Returns: A string holding the result. Raises: ZeroDivisionError, AssertionError, & ValueError. Examples:>>> myfunction(2, 3) '5 - 0, whatever.'>>> myfunction(5, 0, 'oops.') Traceback (most recent call last): ... ZeroDivisionError: integer division or modulo by zero>>> myfunction(4, 1, 'got it.') '5 - 4, got it.'>>> myfunction(23.5, 23, 'oh well.') Traceback (most recent call last): ... AssertionError>>> myfunction(5, 50, 'too big.') Traceback (most recent call last): ... ValueError"""assertisinstance(arg1, int)
if arg2 >23:
raiseValueErrorreturn'{0} - {1}, {2}'.format(arg1 + arg2, arg1 / arg2, kwarg)
There are a few points to note:
1. No special tags are used. Best practice human-readable section headers
are enough.
2. Some flexibility is allowed. Most common names for sections are accepted,
and items and descriptions may be separated by either colons or dashes.
The brief must be the first item and be no longer than one line.
4. Everything thrown into an examples section will be treated as code, so it's
the perfect place for doctests.
Additional more comprehensive examples can be found in the test area.
Installing doxypypy
One can use either pip or easy_install for installation.
Running either:
pip install doxypypy
or:
easy_install doxypypy
with administrator privileges should do the trick.
Previewing doxypypy Output
After successful installation, doxypypy can be run from the command line to
preview the filtered results with:
doxypypy -a -c file.py
Typically you'll want to redirect output to a file for viewing in a text editor:
doxypypy -a -c file.py > file.py.out
Invoking doxypypy from Doxygen
To make Doxygen run your Python code through doxypypy, set the FILTER_PATTERNS
tag in your Doxyfile as follows:
FILTER_PATTERNS = *.py=py_filter
py_filter must be available in your path as a shell script (or Windows batch
file). If you wish to run py_filter in a particular directory you can include
the full or relative path.
For Unix-like operating systems, py_filter should like something like this:
#!/bin/bash
doxypypy -a -c $1
In Windows, the batch file should be named py_filter.bat, and need only
contain the one line:
doxypypy -a -c %1
Running Doxygen as usual should now run all Python code through doxypypy. Be
sure to carefully browse the Doxygen output the first time to make sure that
Doxygen properly found and executed doxypypy。
(可选)允许使用 Internet Explorer 4.0 中的透明 Flash 内容、绝对定位和分层显示功能。此标记/属性仅在带有 Flash Player ActiveX 控件的 Windows 中有效。
"Window"在 Web 页上用影片自己的矩形窗口来播放应用程序。"Window"表明此 Flash 应用程序与 HTML 层没有任何交互,并且始终位于最顶层。
"Opaque" 使应用程序隐藏页面上位于它后面的所有内容。
"Transparent"使 HTML 页的背景可以透过应用程序的所有透明部分显示出来,并且可能会降低动画性能。
"Opaque windowless"和"Transparent windowless"都可与 HTML 层交互,从而允许 SWF 文件上方的层遮蔽应用程序。
Help -> Software Updates -> Find and Install... -> Search for new features to install -> Add Update Site... ->
Name : Veloeclipse
URL: http://propsorter.sourceforge.net/veloeclipse
Spiceworks' free PC inventory software lets
you scan your network and get detailed info about every network device.
Download now, and view your entire network inventory in just minutes.
IFTTT 是“if this then that”的缩写,事实上是让你的网络行为能够引发连锁反应、让你使用更为方便,其宗旨是“Put the internet to work for you”(让互联网为你服务)。ifttt旨在帮助人们利用各网站的开放API,将Facebook、Twitter等各个网站或应用衔接,完成任务,使“每个人都可以成为整个互联网不用编程的程序员”。ifttt通过流程将各种信息串联起来,然后再集中把你要的信息呈现给你。解决了信息的冗杂,收取或关注重要信息的问题。 使用步骤:
1.关注IFTTT公众平台
2.回复 "give me rss"
IFTTT公众平台会自动回复并分配给你一个IFTTT地址 : http://plugs.sinaapp.com/ifttt/rss/***** ,星号部分是你的唯一ID,这个地址是你与FACEBOOK和TWITTER同步消息的关键,如果忘记可以输入“give me rss”重新获取。
You enjoyed something on the Internet, and just want to download them for your own pleasure.
You watch your favorite videos online from your computer, but you are prohibited from saving them. You feel that you have no control over your own computer. (And it's not how an open Web is supposed to work.)
You want to get rid of any closed-source technology or proprietary JavaScript code, and disallow things like Flash running on your computer.
You are an adherent of hacker culture and free software.
What you-get can do for you:
Download videos / audios from popular websites such as YouTube, Youku, Niconico, and a bunch more. (See the full list of supported sites)
Stream an online video in your media player. No web browser, no more ads.
Download images (of interest) by scraping a web page.
The official release of you-get is distributed on PyPI, and can be installed easily from a PyPI mirror via the pip package manager. Note that you must use the Python 3 version of pip:
You may either download the stable (identical with the latest release on PyPI) or the develop (more hotfixes, unstable features) branch of you-get. Unzip it, and put the directory containing the you-get script into your PATH.
Alternatively, run
$ [sudo] python3 setup.py install
Or
$ python3 setup.py install --user
to install you-get to a permanent path.
Option 5: Git clone
This is the recommended way for all developers, even if you don't often code in Python.
$ git clone git://github.com/soimort/you-get.git
Then put the cloned directory into your PATH, or run ./setup.py install to install you-get to a permanent path.
Upgrading
Based on which option you chose to install you-get, you may upgrade it via:
At this point, format selection has not been generally implemented for most of our supported sites; in that case, the default format to download is the one with the highest quality.
ffmpeg is a required dependency, for downloading and joining videos streamed in multiple parts (e.g. on some sites like Youku), and for YouTube videos of 1080p or high resolution.
If you don't want you-get to join video parts after downloading them, use the --no-merge/-n option.
Download anything else
If you already have the URL of the exact resource you want, you can download it directly with:
This feature is an experimental one and far from perfect. It works best on scraping large-sized images from popular websites like Tumblr and Blogger, but there is really no universal pattern that can apply to any site on the Internet.
Search on Google Videos and download
You can pass literally anything to you-get. If it isn't a valid URL, you-get will do a Google search and download the most relevant video for you. (It might not be exactly the thing you wish to see, but still very likely.)
$ you-get "Richard Stallman eats"
Pause and resume a download
You may use Ctrl+C to interrupt a download.
A temporary .download file is kept in the output directory. Next time you run you-get with the same arguments, the download progress will resume from the last session. In case the file is completely downloaded (the temporary .downloadextension is gone), you-get will just skip the download.
To enforce re-downloading, use the --force/-f option. (Warning: doing so will overwrite any existing file or temporary file with the same name!)
Set the path and name of downloaded file
Use the --output-dir/-o option to set the path, and --output-filename/-O to set the name of the downloaded file:
These options are helpful if you encounter problems with the default video titles, which may contain special characters that do not play well with your current shell / operating system / filesystem.
These options are also helpful if you write a script to batch download files and put them into designated folders with designated names.
Proxy settings
You may specify an HTTP proxy for you-get to use, via the --http-proxy/-x option:
However, the system proxy setting (i.e. the environment variable http_proxy) is applied by default. To disable any proxy, use the --no-proxy option.
Tips:
If you need to use proxies a lot (in case your network is blocking certain sites), you might want to use you-get withproxychains and set alias you-get="proxychains -q you-get" (in Bash).
For some websites (e.g. Youku), if you need access to some videos that are only available in mainland China, there is an option of using a specific proxy to extract video information from the site: --extractor-proxy/-y.
Watch a video
Use the --player/-p option to feed the video into your media player of choice, e.g. mplayer or vlc, instead of downloading it:
It is possible to use the -p option to start another download manager, e.g., you-get -p uget-gtk 'https://www.youtube.com/watch?v=jNQXAC9IVRw', though they may not play together very well.
Load cookies
Not all videos are publicly available to anyone. If you need to log in your account to access something (e.g., a private video), it would be unavoidable to feed the browser cookies to you-get via the --cookies/-c option.
Note:
As of now, we are supporting two formats of browser cookies: Mozilla cookies.sqlite and Netscape cookies.txt.
Reuse extracted data
Use --url/-u to get a list of downloadable resource URLs extracted from the page. Use --json to get an abstract of extracted data in the JSON format.
Warning:
For the time being, this feature has NOT been stabilized and the JSON schema may have breaking changes in the future.
You can reach us on the Gitter channel #soimort/you-get (here's how you set up your IRC client for Gitter). If you have a quick question regarding you-get, ask it there.
All kinds of pull requests are welcome. However, there are a few guidelines to follow:
The develop branch is where your pull request should go.
Remember to rebase.
Document your PR clearly, and if applicable, provide some sample links for reviewers to test with.
Write well-formatted, easy-to-understand commit messages. If you don't know how, look at existing ones.
We will not ask you to sign a CLA, but you must assure that your code can be legally redistributed (under the terms of the MIT license).