Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Not so pythonic #13

Closed
andresriancho opened this issue Jun 2, 2013 · 0 comments
Closed

Not so pythonic #13

andresriancho opened this issue Jun 2, 2013 · 0 comments

Comments

@andresriancho
Copy link
Contributor

There are a couple of things about the API which I dislike:

  • vFeed shouldn't take a CVE as init parameter. The best way to architecture this is:
    • Have a vFeedConnection class which takes an optional vfeed.db object as init param
    • vFeedConnection has a search method, which takes a CVE id and returns a Vulnerability object
    • The vulnerability object has all the information CVE, CWE, CPE, MS, etc. already set as attributes
    • The user gets the information from the vulnerability.
vfeed_conn = vFeedConnection()
vulnerability = vfeed_conn.search('CVE-...')
print vulnerability.get_MS()

Please note that I also propose a change from "checkMS" to "get_MS" (and the same for all the other "check*" calls.

Finally, the "get_MS" / "get_KB" shouldn't return dictionaries, it is very ugly to access the result of the query using result['foo'], I would prefer result.foo (see https://pypi.python.org/pypi/easydict). Also achievable with namedtuples.

You can go ahead and create different issues for fixing these, or simply ignore all.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants