From 35a4d01a927a9ad0a774eec6a9ee1b728279c5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 4 Jun 2011 22:24:59 +0200 Subject: [PATCH] Improve a few docstrings in packaging. Also beautify import lists. Having them grouped by lenght makes it slightly easier to look for a module. --- Lib/packaging/create.py | 17 +++++------------ Lib/packaging/util.py | 15 +++++++-------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py index b96aef0fe70..5a2eabdb3da 100644 --- a/Lib/packaging/create.py +++ b/Lib/packaging/create.py @@ -1,15 +1,8 @@ -#!/usr/bin/env python """Interactive helper used to create a setup.cfg file. This script will generate a packaging configuration file by looking at the current directory and asking the user questions. It is intended to -be called as - - pysetup create - -or - - python3.3 -m packaging.create +be called as *pysetup create*. """ # Original code by Sean Reifschneider @@ -26,17 +19,17 @@ or # Detect scripts (not sure how. #! outside of package?) import os +import re import imp import sys import glob -import re import shutil import sysconfig import tokenize -from configparser import RawConfigParser -from textwrap import dedent from hashlib import md5 +from textwrap import dedent from functools import cmp_to_key +from configparser import RawConfigParser # importing this with an underscore as it should be replaced by the # dict form or another structures for all purposes from packaging._trove import all_classifiers as _CLASSIFIERS_LIST @@ -230,7 +223,7 @@ class MainProgram: self._write_cfg() def has_setup_py(self): - """Test for the existance of a setup.py file.""" + """Test for the existence of a setup.py file.""" return os.path.exists('setup.py') def define_cfg_values(self): diff --git a/Lib/packaging/util.py b/Lib/packaging/util.py index 748686d2ebf..ddb8ed98321 100644 --- a/Lib/packaging/util.py +++ b/Lib/packaging/util.py @@ -1,19 +1,18 @@ -"""packaging.util -Miscellaneous utility functions. -""" -import errno -import csv -import hashlib +"""Miscellaneous utility functions.""" + import os -import sys import re +import csv +import sys +import errno import shutil import string +import hashlib import tarfile import zipfile import posixpath -import sysconfig import subprocess +import sysconfig from glob import iglob as std_iglob from fnmatch import fnmatchcase from inspect import getsource