17.12.2012 Views

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

344<br />

La bibliothèque standard<br />

TROISIÈME PARTIE<br />

Invocation de 2to3<br />

$ 2to3 --help<br />

Usage: refactor.py [options] file|dir ...<br />

Options:<br />

-h, --help show this help message and exit<br />

-d, --doctests_only Fix up doctests only<br />

-f FIX, --fix=FIX Each FIX specifies a transformation; default:<br />

all<br />

-x NOFIX, --nofix=NOFIX<br />

Prevent a fixer from being run.<br />

-l, --list-fixes List available transformations (fixes/<br />

fix_*.py)<br />

-p, --print-function Modify the grammar so that print() is a<br />

function<br />

-v, --verbose More verbose logging<br />

-w, --write Write back modified files<br />

-n, --nobackups Don't write backups for modified files.<br />

Le script peut être lancé une première fois à vide dans le répertoire qui contient le<br />

code source, puis appliqué avec -w.<br />

Test puis application de 2to3<br />

$ 2to3 *<br />

RefactoringTool: Skipping implicit fixer: ws_comma<br />

RefactoringTool: Files that need to be modified:<br />

RefactoringTool: processing/__init__.py<br />

RefactoringTool: processing/connection.py<br />

RefactoringTool: processing/finalize.py<br />

RefactoringTool: processing/forking.py<br />

RefactoringTool: processing/heap.py<br />

RefactoringTool: processing/managers.py<br />

RefactoringTool: processing/pool.py<br />

RefactoringTool: processing/process.py<br />

…<br />

$ 2to3 -w *<br />

RefactoringTool: Skipping implicit fixer: ws_comma<br />

RefactoringTool: Files that need to be modified:<br />

RefactoringTool: processing/__init__.py<br />

RefactoringTool: processing/connection.py<br />

RefactoringTool: processing/finalize.py<br />

RefactoringTool: processing/forking.py<br />

RefactoringTool: processing/heap.py<br />

RefactoringTool: processing/managers.py<br />

RefactoringTool: processing/pool.py<br />

RefactoringTool: processing/process.py<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!