Repository: sunpy/sunpy

Issue:
Limit the number of rows in the BaseClient repr
The VSOClient repr in particular is very long, it makes sense to print it all in the `__str__` method but not in `__repr__`


Discussion:
Hi @Cadair, I think the BaseClient ```__repr__``` method is extended to VSOClient. Is it okay if the ```__repr__ ``` method of the Baseclient class returns a VSOclient object instead of printing the object?

Resolving patch:
diff --git a/sunpy/net/base_client.py b/sunpy/net/base_client.py
--- a/sunpy/net/base_client.py
+++ b/sunpy/net/base_client.py
@@ -326,7 +326,7 @@ def wrapper(self, query_results, **kwargs):
     return wrapper
 
 
-def _print_client(client, html=False):
+def _print_client(client, html=False, visible_entries=None):
     """
     Given a BaseClient instance will print out each registered attribute.
 
@@ -358,7 +358,8 @@ def _print_client(client, html=False):
     lines = [class_name, dedent(client.__doc__.partition("\n\n")[0])]
     if html:
         lines = [f"<p>{line}</p>" for line in lines]
-    lines.extend(t.pformat_all(show_dtype=False, max_width=width, align="<", html=html))
+    lines.extend(t.pformat_all(max_lines=visible_entries, show_dtype=False,
+                               max_width=width, align="<", html=html))
     return '\n'.join(lines)
 
 
@@ -422,19 +423,19 @@ def __repr__(self):
         """
         Returns the normal repr plus the pretty client __str__.
         """
-        return object.__repr__(self) + "\n" + str(self)
+        return object.__repr__(self) + "\n" + _print_client(visible_entries=15, client=self)
 
     def __str__(self):
         """
         This enables the "pretty" printing of BaseClient.
         """
-        return _print_client(self)
+        return _print_client(client=self)
 
     def _repr_html_(self):
         """
         This enables the "pretty" printing of the BaseClient with html.
         """
-        return _print_client(self, html=True)
+        return _print_client(visible_entries=15, client=self, html=True)
 
     @abstractmethod
     def search(self, *args, **kwargs):
diff --git a/sunpy/net/fido_factory.py b/sunpy/net/fido_factory.py
--- a/sunpy/net/fido_factory.py
+++ b/sunpy/net/fido_factory.py
@@ -517,7 +517,7 @@ def _make_query_to_client(self, *query):
         return results
 
     def __repr__(self):
-        return object.__repr__(self) + "\n" + str(self)
+        return object.__repr__(self) + "\n" + self._print_clients(visible_entries=15)
 
     def __str__(self):
         """
@@ -529,9 +529,9 @@ def _repr_html_(self):
         """
         This enables the "pretty" printing of the Fido Clients with html.
         """
-        return self._print_clients(html=True)
+        return self._print_clients(visible_entries=15, html=True)
 
-    def _print_clients(self, html=False) -> str:
+    def _print_clients(self, html=False, visible_entries=None) -> str:
         width = -1 if html else get_width()
 
         t = Table(names=["Client", "Description"], dtype=["U80", "U120"])
@@ -541,7 +541,8 @@ def _print_clients(self, html=False) -> str:
         for key in BaseClient._registry.keys():
             t.add_row((key.__name__, dedent(
                 key.__doc__.partition("\n\n")[0].replace("\n    ", " "))))
-        lines.extend(t.pformat_all(show_dtype=False, max_width=width, align="<", html=html))
+        lines.extend(t.pformat_all(max_lines=visible_entries,
+                                   show_dtype=False, max_width=width, align="<", html=html))
         return '\n'.join(lines)
 
 


Test patch: