Skip to content

Commit 0be6f60

Browse files
author
Nicholas Car
committed
blacked all python files
1 parent 2a8d708 commit 0be6f60

File tree

186 files changed

+7386
-5526
lines changed

Some content is hidden

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

186 files changed

+7386
-5526
lines changed

docs/plugintable.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@
1212
p = {}
1313

1414
for (name, kind), plugin in _plugins.items():
15-
if "/" in name: continue # skip duplicate entries for mimetypes
15+
if "/" in name:
16+
continue # skip duplicate entries for mimetypes
1617
if cls == kind.__name__:
17-
p[name]="%s.%s"%(plugin.module_path, plugin.class_name)
18+
p[name] = "%s.%s" % (plugin.module_path, plugin.class_name)
19+
20+
l1 = max(len(x) for x in p)
21+
l2 = max(10 + len(x) for x in p.values())
1822

19-
l1=max(len(x) for x in p)
20-
l2=max(10+len(x) for x in p.values())
2123

2224
def hr():
23-
print("="*l1,"="*l2)
25+
print("=" * l1, "=" * l2)
26+
2427

2528
hr()
26-
print("%-*s"%(l1,"Name"), "%-*s"%(l2, "Class"))
29+
print("%-*s" % (l1, "Name"), "%-*s" % (l2, "Class"))
2730
hr()
2831

2932
for n in sorted(p):
30-
print("%-*s"%(l1,n), ":class:`~%s`"%p[n])
33+
print("%-*s" % (l1, n), ":class:`~%s`" % p[n])
3134
hr()
3235
print()

examples/conjunctive_graphs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
# query the conjunction of all graphs
5555
xx = None
56-
for x in g[mary: ns.loves / ns.hasCuteName]:
56+
for x in g[mary : ns.loves / ns.hasCuteName]:
5757
xx = x
5858
print("Q: Who does Mary love?")
5959
print("A: Mary loves {}".format(xx))

examples/slice.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
graph.load("foaf.n3", format="n3")
2020

21-
for person in graph[: RDF.type: FOAF.Person]:
21+
for person in graph[: RDF.type : FOAF.Person]:
2222

23-
friends = list(graph[person: FOAF.knows * "+" / FOAF.name])
23+
friends = list(graph[person : FOAF.knows * "+" / FOAF.name])
2424
if friends:
2525
print("%s's circle of friends:" % graph.value(person, FOAF.name))
2626
for name in friends:

examples/sparqlstore_example.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@
1414
graph = Graph("SPARQLStore", identifier="http://dbpedia.org")
1515
graph.open("http://dbpedia.org/sparql")
1616

17-
pop = graph.value(
18-
URIRef("http://dbpedia.org/resource/Berlin"),
19-
dbo.populationTotal)
17+
pop = graph.value(URIRef("http://dbpedia.org/resource/Berlin"), dbo.populationTotal)
2018

21-
print("According to DBPedia, Berlin has a population of {0:,}".format(int(pop), ',d').replace(",", "."))
19+
print(
20+
"According to DBPedia, Berlin has a population of {0:,}".format(
21+
int(pop), ",d"
22+
).replace(",", ".")
23+
)
2224

2325
# using a SPARQLStore object directly
2426
s = SPARQLStore(endpoint="http://dbpedia.org/sparql")
2527
s.open(None)
2628
pop = graph.value(
27-
URIRef("http://dbpedia.org/resource/Brisbane"),
28-
dbo.populationTotal)
29-
print("According to DBPedia, Brisbane has a population of " "{0:,}".format(int(pop), ',d'))
29+
URIRef("http://dbpedia.org/resource/Brisbane"), dbo.populationTotal
30+
)
31+
print(
32+
"According to DBPedia, Brisbane has a population of "
33+
"{0:,}".format(int(pop), ",d")
34+
)

examples/swap_primer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# dataset from the example, and start
5959
# with a fresh new graph.
6060

61-
del(primer)
61+
del primer
6262
primer = ConjunctiveGraph()
6363

6464
# Lets start with a verbatim string straight from the primer text:

rdflib/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
del sys
113113

114114

115-
116115
NORMALIZE_LITERALS = True
117116
"""
118117
If True - Literals lexical forms are normalized when created.

rdflib/collection.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from rdflib.term import Literal
88

99

10-
__all__ = ['Collection']
10+
__all__ = ["Collection"]
1111

1212

1313
class Collection(object):
@@ -67,7 +67,7 @@ def n3(self):
6767
"2"^^<http://www.w3.org/2001/XMLSchema#integer>
6868
"3"^^<http://www.w3.org/2001/XMLSchema#integer> )
6969
"""
70-
return "( %s )" % (' '.join([i.n3() for i in self]))
70+
return "( %s )" % (" ".join([i.n3() for i in self]))
7171

7272
def _get_container(self, index):
7373
"""Gets the first, rest holding node at index."""
@@ -103,8 +103,7 @@ def index(self, item):
103103
elif not newLink:
104104
raise Exception("Malformed RDF Collection: %s" % self.uri)
105105
else:
106-
assert len(newLink) == 1, \
107-
"Malformed RDF Collection: %s" % self.uri
106+
assert len(newLink) == 1, "Malformed RDF Collection: %s" % self.uri
108107
listName = newLink[0]
109108

110109
def __getitem__(self, key):
@@ -246,21 +245,22 @@ def clear(self):
246245

247246
def test():
248247
import doctest
248+
249249
doctest.testmod()
250250

251251

252252
if __name__ == "__main__":
253253
test()
254254

255255
from rdflib import Graph
256+
256257
g = Graph()
257258

258259
c = Collection(g, BNode())
259260

260261
assert len(c) == 0
261262

262-
c = Collection(
263-
g, BNode(), [Literal("1"), Literal("2"), Literal("3"), Literal("4")])
263+
c = Collection(g, BNode(), [Literal("1"), Literal("2"), Literal("3"), Literal("4")])
264264

265265
assert len(c) == 4
266266

0 commit comments

Comments
 (0)