nficano commited on
Commit
3679905
·
1 Parent(s): b41f884

fixed pydocstyle issues

Browse files
Files changed (2) hide show
  1. pytube/__main__.py +1 -1
  2. pytube/query.py +7 -0
pytube/__main__.py CHANGED
@@ -83,7 +83,7 @@ class YouTube(object):
83
  self.init()
84
 
85
  def init(self):
86
- """descramble the stream data and build Stream instances.
87
 
88
  The initialization process takes advantage of Python's
89
  "call-by-reference evaluation," which allows dictionary transforms to
 
83
  self.init()
84
 
85
  def init(self):
86
+ """Descramble the stream data and build Stream instances.
87
 
88
  The initialization process takes advantage of Python's
89
  "call-by-reference evaluation," which allows dictionary transforms to
pytube/query.py CHANGED
@@ -115,6 +115,11 @@ class StreamQuery:
115
  return StreamQuery(fmt_streams)
116
 
117
  def order_by(self, attribute_name):
 
 
 
 
 
118
  fmt_streams = sorted(
119
  self.fmt_streams,
120
  key=lambda s: getattr(s, attribute_name),
@@ -122,9 +127,11 @@ class StreamQuery:
122
  return StreamQuery(fmt_streams)
123
 
124
  def desc(self):
 
125
  return StreamQuery(self.fmt_streams[::-1])
126
 
127
  def asc(self):
 
128
  return self
129
 
130
  def get_by_itag(self, itag):
 
115
  return StreamQuery(fmt_streams)
116
 
117
  def order_by(self, attribute_name):
118
+ """Apply a sort order to a resultset.
119
+
120
+ :param str attribute_name:
121
+ The name of the attribute to sort by.
122
+ """
123
  fmt_streams = sorted(
124
  self.fmt_streams,
125
  key=lambda s: getattr(s, attribute_name),
 
127
  return StreamQuery(fmt_streams)
128
 
129
  def desc(self):
130
+ """Sort streams in descending order."""
131
  return StreamQuery(self.fmt_streams[::-1])
132
 
133
  def asc(self):
134
+ """Sort streams in ascending order."""
135
  return self
136
 
137
  def get_by_itag(self, itag):