Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit614907b

Browse files
committed
pep8 linting (whitespace before/after)
E201 whitespace after '('E202 whitespace before ')'E203 whitespace before ':'E225 missing whitespace around operatorE226 missing whitespace around arithmetic operatorE227 missing whitespace around bitwise or shift operatorE228 missing whitespace around modulo operatorE231 missing whitespace after ','E241 multiple spaces after ','E251 unexpected spaces around keyword / parameter equals
1 parentbe34ec2 commit614907b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+410
-410
lines changed

‎git/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ def _init_externals():
4949

5050
#} END imports
5151

52-
__all__= [nameforname,objinlocals().items()
53-
ifnot (name.startswith('_')orinspect.ismodule(obj))]
52+
__all__= [nameforname,objinlocals().items()
53+
ifnot (name.startswith('_')orinspect.ismodule(obj))]

‎git/cmd.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
execute_kwargs= ('istream','with_keep_cwd','with_extended_output',
2121
'with_exceptions','as_process',
22-
'output_stream')
22+
'output_stream')
2323

2424
__all__= ('Git', )
2525

@@ -49,7 +49,7 @@ class Git(LazyMixin):
4949

5050
# CONFIGURATION
5151
# The size in bytes read from stdout when copying git's output to another stream
52-
max_chunk_size=1024*64
52+
max_chunk_size=1024*64
5353

5454
git_exec_name="git"# default that should work on linux and windows
5555
git_exec_name_win="git.cmd"# alternate command name, windows only
@@ -71,7 +71,7 @@ class AutoInterrupt(object):
7171
and possibly raise."""
7272
__slots__= ("proc","args")
7373

74-
def__init__(self,proc,args):
74+
def__init__(self,proc,args):
7575
self.proc=proc
7676
self.args=args
7777

@@ -423,15 +423,15 @@ def transform_kwargs(self, split_single_char_options=False, **kwargs):
423423

424424
@classmethod
425425
def__unpack_args(cls,arg_list):
426-
ifnotisinstance(arg_list, (list,tuple)):
426+
ifnotisinstance(arg_list, (list,tuple)):
427427
ifisinstance(arg_list,unicode):
428428
return [arg_list.encode('utf-8')]
429-
return [str(arg_list)]
429+
return [str(arg_list)]
430430

431431
outlist=list()
432432
forarginarg_list:
433433
ifisinstance(arg_list, (list,tuple)):
434-
outlist.extend(cls.__unpack_args(arg))
434+
outlist.extend(cls.__unpack_args(arg))
435435
elifisinstance(arg_list,unicode):
436436
outlist.append(arg_list.encode('utf-8'))
437437
# END recursion
@@ -563,16 +563,16 @@ def __prepare_ref(self, ref):
563563
returnrefstr
564564
returnrefstr+"\n"
565565

566-
def__get_persistent_cmd(self,attr_name,cmd_name,*args,**kwargs):
566+
def__get_persistent_cmd(self,attr_name,cmd_name,*args,**kwargs):
567567
cur_val=getattr(self,attr_name)
568568
ifcur_valisnotNone:
569569
returncur_val
570570

571-
options= {"istream":PIPE,"as_process":True}
572-
options.update(kwargs)
571+
options= {"istream":PIPE,"as_process":True}
572+
options.update(kwargs)
573573

574-
cmd=self._call_process(cmd_name,*args,**options)
575-
setattr(self,attr_name,cmd)
574+
cmd=self._call_process(cmd_name,*args,**options)
575+
setattr(self,attr_name,cmd)
576576
returncmd
577577

578578
def__get_object_header(self,cmd,ref):

‎git/config.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __new__(metacls, name, bases, clsdict):
2929
ifkmminclsdict:
3030
mutating_methods=clsdict[kmm]
3131
forbaseinbases:
32-
methods= (tfortininspect.getmembers(base,inspect.ismethod)ifnott[0].startswith("_"))
32+
methods= (tfortininspect.getmembers(base,inspect.ismethod)ifnott[0].startswith("_"))
3333
forname,methodinmethods:
3434
ifnameinclsdict:
3535
continue
@@ -89,7 +89,7 @@ def __init__(self, config, section):
8989
def__getattr__(self,attr):
9090
ifattrinself._valid_attrs_:
9191
returnlambda*args,**kwargs:self._call_config(attr,*args,**kwargs)
92-
returnsuper(SectionConstraint,self).__getattribute__(attr)
92+
returnsuper(SectionConstraint,self).__getattribute__(attr)
9393

9494
def_call_config(self,method,*args,**kwargs):
9595
"""Call the configuration at the given method which must take a section name
@@ -140,7 +140,7 @@ class GitConfigParser(cp.RawConfigParser, object):
140140

141141
# list of RawConfigParser methods able to change the instance
142142
_mutating_methods_= ("add_section","remove_section","remove_option","set")
143-
__slots__= ("_sections","_defaults","_file_or_files","_read_only","_is_initialized",'_lock')
143+
__slots__= ("_sections","_defaults","_file_or_files","_read_only","_is_initialized",'_lock')
144144

145145
def__init__(self,file_or_files,read_only=True):
146146
"""Initialize a configuration reader to read the given file_or_files and to
@@ -187,7 +187,7 @@ def __del__(self):
187187
try:
188188
try:
189189
self.write()
190-
exceptIOError,e:
190+
exceptIOError,e:
191191
print"Exception during destruction of GitConfigParser: %s"%str(e)
192192
finally:
193193
self._lock._release_lock()
@@ -246,7 +246,7 @@ def _read(self, fp, fpname):
246246
optname,vi,optval=mo.group('option','vi','value')
247247
ifviin ('=',':')and';'inoptval:
248248
pos=optval.find(';')
249-
ifpos!=-1andoptval[pos-1].isspace():
249+
ifpos!=-1andoptval[pos-1].isspace():
250250
optval=optval[:pos]
251251
optval=optval.strip()
252252
ifoptval=='""':
@@ -276,7 +276,7 @@ def read(self):
276276

277277
files_to_read=self._file_or_files
278278
ifnotisinstance(files_to_read, (tuple,list)):
279-
files_to_read= [files_to_read]
279+
files_to_read= [files_to_read]
280280

281281
forfile_objectinfiles_to_read:
282282
fp=file_object
@@ -286,7 +286,7 @@ def read(self):
286286
try:
287287
fp=open(file_object)
288288
close_fp=True
289-
exceptIOError,e:
289+
exceptIOError,e:
290290
continue
291291
# END fp handling
292292

@@ -312,7 +312,7 @@ def write_section(name, section_dict):
312312

313313
ifself._defaults:
314314
write_section(cp.DEFAULTSECT,self._defaults)
315-
map(lambdat:write_section(t[0],t[1]),self._sections.items())
315+
map(lambdat:write_section(t[0],t[1]),self._sections.items())
316316

317317
@needs_values
318318
defwrite(self):
@@ -368,7 +368,7 @@ def read_only(self):
368368
""":return: True if this instance may change the configuration file"""
369369
returnself._read_only
370370

371-
defget_value(self,section,option,default=None):
371+
defget_value(self,section,option,default=None):
372372
"""
373373
:param default:
374374
If not None, the given default value will be returned in case
@@ -384,17 +384,17 @@ def get_value(self, section, option, default = None):
384384
returndefault
385385
raise
386386

387-
types= (long,float)
387+
types= (long,float)
388388
fornumtypeintypes:
389389
try:
390-
val=numtype(valuestr)
390+
val=numtype(valuestr)
391391

392392
# truncated value ?
393-
ifval!=float(valuestr):
393+
ifval!=float(valuestr):
394394
continue
395395

396396
returnval
397-
except (ValueError,TypeError):
397+
except (ValueError,TypeError):
398398
continue
399399
# END for each numeric type
400400

@@ -405,8 +405,8 @@ def get_value(self, section, option, default = None):
405405
ifvl=='true':
406406
returnTrue
407407

408-
ifnotisinstance(valuestr,basestring):
409-
raiseTypeError("Invalid value type: only int, long, float and str are allowed",valuestr)
408+
ifnotisinstance(valuestr,basestring):
409+
raiseTypeError("Invalid value type: only int, long, float and str are allowed",valuestr)
410410

411411
returnvaluestr
412412

‎git/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
fromgitdb.dbimportLooseObjectDB
1818

1919

20-
__all__= ('GitCmdObjectDB','GitDB')
20+
__all__= ('GitCmdObjectDB','GitDB')
2121

2222
#class GitCmdObjectDB(CompoundDB, ObjectDBW):
2323

‎git/diff.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
6969
On a bare repository, 'other' needs to be provided as Index or as
7070
as Tree/Commit, or a git command error will occour"""
7171
args=list()
72-
args.append("--abbrev=40")# we need full shas
73-
args.append("--full-index")# get full index paths, not only filenames
72+
args.append("--abbrev=40")# we need full shas
73+
args.append("--full-index")# get full index paths, not only filenames
7474

7575
ifcreate_patch:
7676
args.append("-p")
@@ -82,15 +82,15 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
8282
# fixes https://github.com/gitpython-developers/GitPython/issues/172
8383
args.append('--no-color')
8484

85-
ifpathsisnotNoneandnotisinstance(paths, (tuple,list)):
86-
paths= [paths]
85+
ifpathsisnotNoneandnotisinstance(paths, (tuple,list)):
86+
paths= [paths]
8787

8888
ifotherisnotNoneandotherisnotself.Index:
8989
args.insert(0,other)
9090
ifotherisself.Index:
9191
args.insert(0,"--cached")
9292

93-
args.insert(0,self)
93+
args.insert(0,self)
9494

9595
# paths is list here or None
9696
ifpaths:
@@ -136,7 +136,7 @@ def iter_change_type(self, change_type):
136136
* 'R' for renamed paths
137137
* 'M' for paths with modified data"""
138138
ifchange_typenotinself.change_type:
139-
raiseValueError("Invalid change type: %s"%change_type)
139+
raiseValueError("Invalid change type: %s"%change_type)
140140

141141
fordiffinself:
142142
ifchange_type=="A"anddiff.new_file:
@@ -195,8 +195,8 @@ class Diff(object):
195195
\.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
196196
""",re.VERBOSE|re.MULTILINE)
197197
# can be used for comparisons
198-
NULL_HEX_SHA="0"*40
199-
NULL_BIN_SHA="\0"*20
198+
NULL_HEX_SHA="0"*40
199+
NULL_BIN_SHA="\0"*20
200200

201201
__slots__= ("a_blob","b_blob","a_mode","b_mode","new_file","deleted_file",
202202
"rename_from","rename_to","diff")
@@ -239,10 +239,10 @@ def __eq__(self, other):
239239
returnTrue
240240

241241
def__ne__(self,other):
242-
returnnot (self==other)
242+
returnnot (self==other)
243243

244244
def__hash__(self):
245-
returnhash(tuple(getattr(self,n)forninself.__slots__))
245+
returnhash(tuple(getattr(self,n)forninself.__slots__))
246246

247247
def__str__(self):
248248
h="%s"
@@ -254,7 +254,7 @@ def __str__(self):
254254
msg=''
255255
l=None# temp line
256256
ll=0# line length
257-
forb,ninzip((self.a_blob,self.b_blob), ('lhs','rhs')):
257+
forb,ninzip((self.a_blob,self.b_blob), ('lhs','rhs')):
258258
ifb:
259259
l="\n%s: %o | %s"% (n,b.mode,b.hexsha)
260260
else:
@@ -265,7 +265,7 @@ def __str__(self):
265265
# END for each blob
266266

267267
# add headline
268-
h+='\n'+'='*ll
268+
h+='\n'+'='*ll
269269

270270
ifself.deleted_file:
271271
msg+='\nfile deleted in rhs'

‎git/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __str__(self):
3636
returnret
3737

3838

39-
classCheckoutError(Exception):
39+
classCheckoutError(Exception):
4040

4141
"""Thrown if a file could not be checked out from the index as it contained
4242
changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp