Skip to content

Commit

Permalink
Use plain import instead of from import
Browse files Browse the repository at this point in the history
Because as far as I'm aware from X import Y isn't preferred and also
using a plain import is how we are doing it in simplenote.vim.

I'm not sure what should be done in __init__.py though so I've left that
alone for now.
  • Loading branch information
atomicules committed Nov 23, 2015
1 parent 00acf66 commit e946ec8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -21,8 +21,8 @@ Usage
======
simplenote.py can be imported into any python module::

from simplenote import Simplenote
simplenote = Simplenote(user, password)
import simplenote
simplenote = simplenote.Simplenote(user, password)

The object then provides the following API methods::

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Expand Up @@ -27,8 +27,8 @@ with the service.

First import the module and create an object::

from simplenote import Simplenote
simplenote = Simplenote(user, password)
import simplenote
simplenote = simplenote.Simplenote(user, password)

This object then provides the following API methods::

Expand Down
7 changes: 3 additions & 4 deletions tests/test_simplenote.py
Expand Up @@ -6,15 +6,14 @@
#Override NOTE_FETCH_LENGTH for testing purposes
import simplenote
simplenote.simplenote.NOTE_FETCH_LENGTH = 5
from simplenote import Simplenote, SimplenoteLoginFailed

class TestSimplenote(unittest.TestCase):

@classmethod
def setUpClass(cls):
cls.user = "simplenote-test@lordofhosts.de"
password = "foobar"
cls.simplenote_instance = Simplenote(cls.user, password)
cls.simplenote_instance = simplenote.Simplenote(cls.user, password)

def setUp(self):
self.clear_all_notes()
Expand Down Expand Up @@ -47,8 +46,8 @@ def test_simplenote_auth(self):
self.assertNotEqual(None, token)

def test_simplenote_failed_auth(self):
s = Simplenote(self.user, "")
self.assertRaises(SimplenoteLoginFailed, s.get_token)
s = simplenote.Simplenote(self.user, "")
self.assertRaises(simplenote.SimplenoteLoginFailed, s.get_token)

def test_simplenote_get_list_length(self):
res, status = self.simplenote_instance.get_note_list()
Expand Down

0 comments on commit e946ec8

Please sign in to comment.