donnemartin / gitsome

A supercharged Git/GitHub command line interface (CLI). An official integration for GitHub and GitHub Enterprise: https://github.com/works-with/category/desktop-tools
Other
7.58k stars 436 forks source link

AttributeError: object has no attribute 'summary' (trying to get weekly trending repos) #128

Closed emres closed 7 years ago

emres commented 7 years ago

I'm using version 0.7 of gitsome, and when trying to get the trending repositories for some languages, I receive an error:

Version: 0.7.0
emre at latitudeE6540 in ~ on 
$ gh trending python --weekly
Listing weekly trending python repos...
Traceback (most recent call last):
  File "/home/emre/gitsome/lib/python3.5/site-packages/feedparser.py", line 398, in __getattr__
    return self.__getitem__(key)
  File "/home/emre/gitsome/lib/python3.5/site-packages/feedparser.py", line 356, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'summary'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/emre/gitsome/bin/gh", line 11, in <module>
    load_entry_point('gitsome==0.7.0', 'console_scripts', 'gh')()
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/main_cli.py", line 26, in cli
    github.cli()
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/emre/gitsome/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/githubcli.py", line 839, in trending
    github.trending(language, weekly, monthly, devs, browser, pager)
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/github.py", line 807, in trending
    pager=pager)
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/table.py", line 210, in build_table_setup_trending
    format_method=format_method)
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/table.py", line 69, in build_table
    output += format_method(view_entry) + '\n'
  File "/home/emre/gitsome/lib/python3.5/site-packages/gitsome/formatter.py", line 590, in format_trending_entry
    summary_parts = trending_entry.summary.split('\n')
  File "/home/emre/gitsome/lib/python3.5/site-packages/feedparser.py", line 400, in __getattr__
    raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'summary'

But a similar command for Haskell programming language works fine:


$ gh trending haskell --weekly
Listing weekly trending haskell repos...
  1.   koalaman/shellcheck 
         ShellCheck, a static analysis tool for shell scripts
  2.   chrisdone/wish 
         A trivial web browser written in Haskell
  3.   haskell-miso/miso 
         🍜 A tasty Haskell front-end framework
  4.   jgm/pandoc 
         Universal markup converter
  5.   jozefg/higher-order-unification 
         A small implementation of higher-order unification
  6.   begriffs/postgrest 
         REST API for any Postgres database
  7.   purescript/purescript 
         A small strongly typed language that compiles to Javascript
  8.   hot-leaf-juice/gotta-go-fast 
         A command line utility for practicing typing and measuring your WPM and accuracy.
  9.   matt-noonan/justified-containers 
         Standard containers, with keys that carry type-level proofs of their own presence.
  10.  idris-lang/Idris-dev 
         A Dependently Typed Functional Programming Language
  11.  facebookincubator/duckling 
         Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
  12.  elm-lang/elm-compiler 
         Compiler for Elm, a functional language for reliable webapps.
  13.  typelead/eta 
         The Eta Programming Language, a dialect of Haskell on the JVM
  14.  erebe/greenclip 
         Simple clipboard manager to be integrated with rofi - Static binary available
  15.  commercialhaskell/stack 
         The Haskell Tool Stack
  16.  lspitzner/brittany 
         haskell source code formatter
  17.  koka-lang/koka 
         Koka language compiler and interpreter
  18.  ghc/ghc 
         Mirror of the Glasgow Haskell Compiler. Patches are best submitted to GHC's Phabricator https://phabricator.haskell.org/, bugs and feature-requests are best filed to GHC's Trac https://ghc.haskell.org/trac/ghc, or sent to the mailing list ghc-devs@haskell.org. First time contributors are encouraged to get started by just sending a Pull Req…
  19.  huangz1990/real-world-haskell-cn 
         《Real World Haskell》中文翻译项目
  20.  commercialhaskell/intero 
         Complete interactive development program for Haskell
  21.  jameysharp/corrode 
         C to Rust translator
  22.  simonmichael/hledger 
         The hledger command-line and web-based accounting tool, a Haskell rewrite of ledger.
  23.  jtdaugherty/brick 
         A declarative terminal UI programming library written in Haskell
  24.  input-output-hk/cardano-sl 
         Cryptographic currency implementing Ouroboros PoS protocol
  25.  yesodweb/yesod 
         A RESTful Haskell web framework built on WAI.
  View the page for 1 through 25 with the following command:
    gh view [#] optional: [-b/--browser] [--help]
donnemartin commented 7 years ago

Hi @emres thanks for the bug report!