Skip to content

Commit 211c9a5

Browse files
catalyst-joe-guodouglasbagnall
authored andcommitted
PEP8: fix E302: expected 2 blank lines, found 1
Signed-off-by: Joe Guo <[email protected]> Reviewed-by: Andrew Bartlett <[email protected]> Reviewed-by: Douglas Bagnall <[email protected]>
1 parent 542e91e commit 211c9a5

File tree

180 files changed

+480
-0
lines changed

Some content is hidden

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

180 files changed

+480
-0
lines changed

.ycm_extra_conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252

253253
SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
254254

255+
255256
def DirectoryOfThisScript():
256257
return os.path.dirname( os.path.abspath( __file__ ) )
257258

auth/credentials/tests/bind.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
creds_user3 = copy.deepcopy(creds)
4747
creds_user4 = copy.deepcopy(creds)
4848

49+
4950
class BindTests(samba.tests.TestCase):
5051

5152
info_dc = None

lib/ldb-samba/tests/match_rules.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# This should be fixed to work inline with Windows.
2323
# The literal strings are in the case Windows uses.
2424
# Windows appear to preserve casing of the RDN and uppercase the other keys.
25+
26+
2527
class MatchRulesTests(samba.tests.TestCase):
2628
def setUp(self):
2729
super(MatchRulesTests, self).setUp()
@@ -943,6 +945,7 @@ def test_misc_matches(self):
943945
expression="memberOf:1.2.840.113556.1.4.1941:=cn=g1,%s" % self.ou_groups)
944946
self.assertEqual(len(res1), 0)
945947

948+
946949
class MatchRuleConditionTests(samba.tests.TestCase):
947950
def setUp(self):
948951
super(MatchRuleConditionTests, self).setUp()

lib/ldb/tests/python/api.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@IDX_DN_GUID": [b"GUID"]
2323
}
2424

25+
2526
def tempdir():
2627
import tempfile
2728
try:
@@ -685,6 +686,8 @@ def test_no_crash_broken_expr(self):
685686
self.assertRaises(ldb.LdbError, lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"]))
686687

687688
# Run the SimpleLdb tests against an lmdb backend
689+
690+
688691
class SimpleLdbLmdb(SimpleLdb):
689692

690693
def setUp(self):
@@ -695,6 +698,7 @@ def setUp(self):
695698
def tearDown(self):
696699
super(SimpleLdbLmdb, self).tearDown()
697700

701+
698702
class SearchTests(LdbBaseTest):
699703
def tearDown(self):
700704
shutil.rmtree(self.testdir)
@@ -1367,6 +1371,7 @@ def setUp(self):
13671371
"@IDXATTR": [b"x", b"y", b"ou"]})
13681372
self.IDX = True
13691373

1374+
13701375
class IndexedCheckSearchTests(IndexedSearchTests):
13711376
"""Test searches using the index, to ensure the index doesn't
13721377
break things (full scan disabled)"""
@@ -1375,6 +1380,7 @@ def setUp(self):
13751380
self.IDXCHECK = True
13761381
super(IndexedCheckSearchTests, self).setUp()
13771382

1383+
13781384
class IndexedSearchDnFilterTests(SearchTests):
13791385
"""Test searches using the index, to ensure the index doesn't
13801386
break things"""
@@ -1389,6 +1395,7 @@ def setUp(self):
13891395
"@IDXATTR": [b"x", b"y", b"ou"]})
13901396
self.IDX = True
13911397

1398+
13921399
class IndexedAndOneLevelSearchTests(SearchTests):
13931400
"""Test searches using the index including @IDXONE, to ensure
13941401
the index doesn't break things"""
@@ -1401,6 +1408,7 @@ def setUp(self):
14011408
self.IDX = True
14021409
self.IDXONE = True
14031410

1411+
14041412
class IndexedCheckedAndOneLevelSearchTests(IndexedAndOneLevelSearchTests):
14051413
"""Test searches using the index including @IDXONE, to ensure
14061414
the index doesn't break things (full scan disabled)"""
@@ -1409,6 +1417,7 @@ def setUp(self):
14091417
self.IDXCHECK = True
14101418
super(IndexedCheckedAndOneLevelSearchTests, self).setUp()
14111419

1420+
14121421
class IndexedAndOneLevelDNFilterSearchTests(SearchTests):
14131422
"""Test searches using the index including @IDXONE, to ensure
14141423
the index doesn't break things"""
@@ -1427,6 +1436,7 @@ def setUp(self):
14271436
self.IDX = True
14281437
self.IDXONE = True
14291438

1439+
14301440
class GUIDIndexedSearchTests(SearchTests):
14311441
"""Test searches using the index, to ensure the index doesn't
14321442
break things"""
@@ -1460,6 +1470,7 @@ def setUp(self):
14601470
self.IDX = True
14611471
self.IDXGUID = True
14621472

1473+
14631474
class GUIDAndOneLevelIndexedSearchTests(SearchTests):
14641475
"""Test searches using the index including @IDXONE, to ensure
14651476
the index doesn't break things"""
@@ -1479,6 +1490,7 @@ def setUp(self):
14791490
self.IDXGUID = True
14801491
self.IDXONE = True
14811492

1493+
14821494
class GUIDIndexedSearchTestsLmdb(GUIDIndexedSearchTests):
14831495

14841496
def setUp(self):
@@ -1719,6 +1731,7 @@ def setUp(self):
17191731
def tearDown(self):
17201732
super(AddModifyTestsLmdb, self).tearDown()
17211733

1734+
17221735
class IndexedAddModifyTests(AddModifyTests):
17231736
"""Test searches using the index, to ensure the index doesn't
17241737
break things"""
@@ -1798,6 +1811,7 @@ def test_add_dup_guid_add(self):
17981811
"x": "z", "y": "a",
17991812
"objectUUID": b"0123456789abcde2"})
18001813

1814+
18011815
class GUIDIndexedAddModifyTests(IndexedAddModifyTests):
18021816
"""Test searches using the index, to ensure the index doesn't
18031817
break things"""
@@ -1822,6 +1836,7 @@ def tearDown(self):
18221836
self.l.transaction_commit()
18231837
super(GUIDTransIndexedAddModifyTests, self).tearDown()
18241838

1839+
18251840
class TransIndexedAddModifyTests(IndexedAddModifyTests):
18261841
"""Test index behaviour insdie the transaction"""
18271842

@@ -1833,6 +1848,7 @@ def tearDown(self):
18331848
self.l.transaction_commit()
18341849
super(TransIndexedAddModifyTests, self).tearDown()
18351850

1851+
18361852
class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
18371853

18381854
def setUp(self):
@@ -1842,6 +1858,7 @@ def setUp(self):
18421858
def tearDown(self):
18431859
super(GuidIndexedAddModifyTestsLmdb, self).tearDown()
18441860

1861+
18451862
class GuidTransIndexedAddModifyTestsLmdb(GUIDTransIndexedAddModifyTests):
18461863

18471864
def setUp(self):
@@ -1851,6 +1868,7 @@ def setUp(self):
18511868
def tearDown(self):
18521869
super(GuidTransIndexedAddModifyTestsLmdb, self).tearDown()
18531870

1871+
18541872
class BadIndexTests(LdbBaseTest):
18551873
def setUp(self):
18561874
super(BadIndexTests, self).setUp()
@@ -2011,6 +2029,7 @@ def setUp(self):
20112029

20122030
super(GUIDBadIndexTests, self).setUp()
20132031

2032+
20142033
class DnTests(TestCase):
20152034

20162035
def setUp(self):
@@ -2253,6 +2272,7 @@ def test_is_null(self):
22532272
dn = ldb.Dn(self.ldb, '')
22542273
self.assertTrue(dn.is_null())
22552274

2275+
22562276
class LdbMsgTests(TestCase):
22572277

22582278
def setUp(self):
@@ -2621,6 +2641,7 @@ def request(self, *args, **kwargs):
26212641
l = ldb.Ldb(self.filename)
26222642
self.assertEqual(["init"], ops)
26232643

2644+
26242645
class LdbResultTests(LdbBaseTest):
26252646

26262647
def setUp(self):

lib/talloc/test_pytalloc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import talloc
1212
import _test_pytalloc
1313

14+
1415
def dummy_func():
1516
pass
1617

@@ -109,6 +110,7 @@ def test_compare_different_types(self):
109110
self.assertFalse(obj1 >= obj2)
110111
self.assertFalse(obj1 > obj2)
111112

113+
112114
class TallocBaseComparisonTests(unittest.TestCase):
113115

114116
def test_compare_same(self):

lib/tevent/bindings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import _tevent
2929

30+
3031
class BackendListTests(TestCase):
3132

3233
def test_backend_list(self):

python/examples/samr.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626

2727
from samba.dcerpc import samr, security
2828

29+
2930
def display_lsa_string(str):
3031
return str.string
3132

33+
3234
def FillUserInfo(samr, dom_handle, users, level):
3335
"""fill a user array with user information from samrQueryUserInfo"""
3436
for i in range(len(users)):
@@ -39,6 +41,7 @@ def FillUserInfo(samr, dom_handle, users, level):
3941
users[i] = info
4042
samr.Close(user_handle)
4143

44+
4245
def toArray((handle, array, num_entries)):
4346
ret = []
4447
for x in range(num_entries):
@@ -51,16 +54,19 @@ def test_Connect(samr):
5154
print "Testing samr_Connect"
5255
return samr.Connect2(None, security.SEC_FLAG_MAXIMUM_ALLOWED)
5356

57+
5458
def test_LookupDomain(samr, handle, domain):
5559
"""test the samr_LookupDomain interface"""
5660
print "Testing samr_LookupDomain"
5761
return samr.LookupDomain(handle, domain)
5862

63+
5964
def test_OpenDomain(samr, handle, sid):
6065
"""test the samr_OpenDomain interface"""
6166
print "Testing samr_OpenDomain"
6267
return samr.OpenDomain(handle, security.SEC_FLAG_MAXIMUM_ALLOWED, sid)
6368

69+
6470
def test_EnumDomainUsers(samr, dom_handle):
6571
"""test the samr_EnumDomainUsers interface"""
6672
print "Testing samr_EnumDomainUsers"
@@ -69,6 +75,7 @@ def test_EnumDomainUsers(samr, dom_handle):
6975
for idx, user in users:
7076
print "\t%s\t(%d)" % (user.string, idx)
7177

78+
7279
def test_EnumDomainGroups(samr, dom_handle):
7380
"""test the samr_EnumDomainGroups interface"""
7481
print "Testing samr_EnumDomainGroups"
@@ -77,11 +84,13 @@ def test_EnumDomainGroups(samr, dom_handle):
7784
for idx, group in groups:
7885
print "\t%s\t(%d)" % (group.string, idx)
7986

87+
8088
def test_domain_ops(samr, dom_handle):
8189
"""test domain specific ops"""
8290
test_EnumDomainUsers(samr, dom_handle)
8391
test_EnumDomainGroups(samr, dom_handle)
8492

93+
8594
def test_EnumDomains(samr, handle):
8695
"""test the samr_EnumDomains interface"""
8796
print "Testing samr_EnumDomains"

python/examples/winreg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
print "Connecting to " + binding
3333
conn = winreg.winreg(binding, sambaopts.get_loadparm())
3434

35+
3536
def list_values(key):
3637
(num_values, max_valnamelen, max_valbufsize) = conn.QueryInfoKey(key, winreg.String())[4:8]
3738
for i in range(num_values):
@@ -53,6 +54,7 @@ def list_values(key):
5354
# printf("\t\t0x%llx (%lld)\n", v.value, v.value)
5455
# }
5556

57+
5658
def list_path(key, path):
5759
count = 0
5860
(num_subkeys, max_subkeylen, max_subkeysize) = conn.QueryInfoKey(key, winreg.String())[1:4]

python/samba/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ def setup_file(template, fname, subst_vars=None):
305305
f.close()
306306

307307
MAX_NETBIOS_NAME_LEN = 15
308+
309+
308310
def is_valid_netbios_char(c):
309311
return (c.isalnum() or c in " !#$%&'()-.@^_{}~")
310312

@@ -364,9 +366,11 @@ def dn_from_dns_name(dnsdomain):
364366
"""return a DN from a DNS name domain/forest root"""
365367
return "DC=" + ",DC=".join(dnsdomain.split("."))
366368

369+
367370
def current_unix_time():
368371
return int(time.time())
369372

373+
370374
def string_to_byte_array(string):
371375
blob = [0] * len(string)
372376

@@ -375,6 +379,7 @@ def string_to_byte_array(string):
375379

376380
return blob
377381

382+
378383
def arcfour_encrypt(key, data):
379384
from samba.crypto import arcfour_crypt_blob
380385
return arcfour_crypt_blob(data, key)

0 commit comments

Comments
 (0)