3
3
# Distributed under the Boost Software License, Version 1.0.
4
4
# See http://www.boost.org/LICENSE_1_0.txt
5
5
6
- """defines logger classes and few convenience methods, not related to the
6
+ """Defines logger classes and few convenience methods, not related to the
7
7
declarations tree"""
8
8
9
9
import os
@@ -21,11 +21,9 @@ def is_str(s):
21
21
22
22
23
23
def _create_logger_ (name ):
24
- """implementation details """
24
+ """Implementation detail, creates a logger. """
25
25
logger = logging .getLogger (name )
26
26
handler = logging .StreamHandler ()
27
- # handler.setFormatter( logging.Formatter( os.linesep + '%(levelname)s
28
- # %(message)s' ) )
29
27
handler .setFormatter (logging .Formatter ('%(levelname)s %(message)s' ))
30
28
logger .addHandler (handler )
31
29
logger .setLevel (logging .INFO )
@@ -34,10 +32,10 @@ def _create_logger_(name):
34
32
35
33
class loggers :
36
34
37
- """class -namespace, defines few loggers classes, used in the project"""
35
+ """Class -namespace, defines few loggers classes, used in the project"""
38
36
39
37
cxx_parser = _create_logger_ ('pygccxml.cxx_parser' )
40
- """logger for C++ parser functionality
38
+ """Logger for C++ parser functionality
41
39
42
40
If you set this logger level to DEBUG, you will be able to see the exact
43
41
command line, used to invoke GCC-XML and errors that occures during XML
@@ -48,11 +46,11 @@ class loggers:
48
46
49
47
pdb_reader = _create_logger_ ('pygccxml.pdb_reader' )
50
48
"""
51
- logger for MS .pdb file reader functionality
49
+ Logger for MS .pdb file reader functionality
52
50
"""
53
51
54
52
queries_engine = _create_logger_ ('pygccxml.queries_engine' )
55
- """logger for query engine functionality.
53
+ """Logger for query engine functionality.
56
54
57
55
If you set this logger level to DEBUG, you will be able to see what queries
58
56
you do against declarations tree, measure performance and may be even to
@@ -61,7 +59,7 @@ class loggers:
61
59
"""
62
60
63
61
declarations_cache = _create_logger_ ('pygccxml.declarations_cache' )
64
- """logger for declarations tree cache functionality
62
+ """Logger for declarations tree cache functionality
65
63
66
64
If you set this logger level to DEBUG, you will be able to see what is
67
65
exactly happens, when you read the declarations from cache file. You will
@@ -70,14 +68,14 @@ class loggers:
70
68
"""
71
69
72
70
root = logging .getLogger ('pygccxml' )
73
- """root logger exists for your convenience only"""
71
+ """Root logger exists for your convenience only"""
74
72
75
73
all = [root , cxx_parser , queries_engine , declarations_cache , pdb_reader ]
76
- """contains all logger classes, defined by the class"""
74
+ """Contains all logger classes, defined by the class"""
77
75
78
76
79
77
def remove_file_no_raise (file_name ):
80
- """removes file from disk, if exception is raised, it silently
78
+ """Removes file from disk, if exception is raised, it silently
81
79
ignores it"""
82
80
try :
83
81
if os .path .exists (file_name ):
@@ -89,10 +87,10 @@ def remove_file_no_raise(file_name):
89
87
90
88
91
89
def create_temp_file_name (suffix , prefix = None , dir = None ):
92
- """small convenience function that creates temporal file .
90
+ """Small convenience function that creates temporary files .
93
91
94
- This function is a wrapper aroung Python built-in
95
- function - tempfile.mkstemp
92
+ This function is a wrapper around the Python built-in
93
+ function tempfile.mkstemp
96
94
"""
97
95
if not prefix :
98
96
prefix = tempfile .gettempprefix ()
@@ -103,12 +101,12 @@ def create_temp_file_name(suffix, prefix=None, dir=None):
103
101
104
102
105
103
def normalize_path (some_path ):
106
- """return os.path.normpath( os.path.normcase( some_path ) )"""
104
+ """Return os.path.normpath(os.path.normcase(some_path) )"""
107
105
return os .path .normpath (os .path .normcase (some_path ))
108
106
109
107
110
108
def contains_parent_dir (fpath , dirs ):
111
- """returns bool( filter( lambda dir: fpath.startswith( dir ), dirs ) )
109
+ """Returns bool(filter(lambda dir: fpath.startswith(dir), dirs) )
112
110
precondition: dirs and fpath should be normalize_path'ed before calling
113
111
this function
114
112
"""
@@ -117,7 +115,7 @@ def contains_parent_dir(fpath, dirs):
117
115
118
116
119
117
def get_architecture ():
120
- """returns computer architecture: 32 or 64.
118
+ """Returns computer architecture: 32 or 64.
121
119
122
120
The guess is based on maxint.
123
121
"""
@@ -135,7 +133,7 @@ def get_architecture():
135
133
# Thanks to Michele Simionato, for it
136
134
class cached (property ):
137
135
138
- ' Convert a method into a cached attribute'
136
+ """ Convert a method into a cached attribute"""
139
137
140
138
def __init__ (self , method ):
141
139
private = '_' + method .__name__
@@ -198,7 +196,7 @@ def name_of(cls, enum_numeric_value):
198
196
199
197
class native_compiler :
200
198
201
- """provides information about the compiler, which was used to build the
199
+ """Provides information about the compiler, which was used to build the
202
200
Python executable"""
203
201
204
202
@staticmethod
0 commit comments