Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1.1.0 #6

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Update 1.1.0 #6

merged 1 commit into from
Sep 29, 2022

Conversation

arichr
Copy link
Owner

@arichr arichr commented Sep 29, 2022

Changes

This commit is more about improving code style, but it also changes:

  1. ...how the gophient.types.Gopher.request() should be invoked:
import gophient

client = gophient.Gopher()
# Before:
client.request(['gopher.floodgap.com', 'groundhog/ws'])
# After:
client.request('gopher.floodgap.com', 'groundhog/ws')
  1. ...how the exceptions should be excepted:
import gophient

try:
    ...
# Before:
except gophient.exc.TypeMismatch:  # gophient.exc.GopherException
    ...
# After:
except gophient.exc.TypeMismatchError:  # gophient.exc.GopherError
    ...

Also:

  • Apply arichr code style
  • Simplify test cases
  • Create dev-requrements.txt (for snyk)
  • Update README.md
  • Rewrite descriptions

* Apply arichr code style
* Simplify test cases
* Create dev-requrements.txt (for snyk)
* Update README.md
* Rewrite descriptions
@arichr arichr added this to the 1.1.0 milestone Sep 29, 2022
@arichr arichr self-assigned this Sep 29, 2022
return b''.join((path, b'?', query, const.EOL))

def parse_response(self, resp: ByteString, encoding: str = 'utf-8') -> Union[list[Item], list, ByteString]:
def parse_response(self, resp: ByteString) -> Union[list[Item], list, ByteString]:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long (86 > 79 characters)

@@ -39,8 +40,8 @@ def parse(cls, client: Item, raw: ByteString, encoding: str = 'utf-8') -> Union[
raw = raw.decode(encoding)
parts = raw[1:].split(const.SEPARATOR)
if len(parts) < 4:
raise ValueError('Broken response or a file.')
except (UnicodeDecodeError, ValueError):
raise ValueError('The server returned a file or a broken response.')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long (84 > 79 characters)

@@ -21,7 +22,7 @@ class Item:
port: int = 70

@classmethod
def parse(cls, client: Item, raw: ByteString, encoding: str = 'utf-8') -> Union[Item, None]:
def parse(cls, client: Gopher, raw: ByteString, encoding: str = 'utf-8') -> Union[Item, None]:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long (98 > 79 characters)

'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
),
keywords='gopher, gophient, client, python3, gopher-client, gopherspace, module, library',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long (94 > 79 characters)


Gophient is a library for connecting to Gopher servers. By using it you can:
Gophient is client library for the Gopherspace. It doesn't require any dependencies and is easy to use.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length

@codeclimate
Copy link

codeclimate bot commented Sep 29, 2022

Code Climate has analyzed commit 043b596 and detected 11 issues on this pull request.

Here's the issue category breakdown:

Category Count
Security 5
Style 6

View more on Code Climate.

@arichr arichr merged commit 57aa71a into main Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant