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

Another way to check if pass the test #66

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ deploy:
password: $PYPI_PASSWORD
on:
branch: master
condition: $SHOULD_DEPLOY = 1
condition: $SHOULD_DEPLOY = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please undo this change. Here is travis guideline for on condition deploy.

18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,36 @@ You can contribute in many ways:
```shell
$ py.test
```
6. If execute py.test and always collect 0 items, then you can try to run

6. Commit your changes and push your branch to GitHub::
```shell
$ sudo pip install PyBeacon
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will install PyBeacon from PyPi, not from local repo after making changes. Remove this

```
if your install success and execute just like you expect, then you can suggest that you have already pass the test.

7. Commit your changes and push your branch to GitHub::

```shell
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
```

7. Submit a pull request through the [GitHub website](https://github.com/nirmankarta/PyBeacon).
7. Submit a pull request through the [GitHub website](https://github.com/forksociety/PyBeacon).

## How to contribute?
* Follow the Getting Started guidelines to get a headstart.
* Create an issue first and then get it approved before creating a PR to allow for better management.
* Make sure to make PRs against the `dev` branch.
* No trivial edits, ie. simply rearranging topics will not be accepted.

## Types of Contributions

You can contribute in many ways:

### Report Bugs

Report bugs at https://github.com/nirmankarta/PyBeacon/issues.
Report bugs at https://github.com/forksociety/PyBeacon/issues.

If you are reporting a bug, please include:

Expand Down
4 changes: 4 additions & 0 deletions PyBeacon/PyBeacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def encodeurl(url):
data.append(s)
i += len(scheme)
break
"""if never match to if, then throw exception."""
else:
raise Exception("Invalid url scheme")

Expand Down Expand Up @@ -111,6 +112,7 @@ def encodeUid(uid):
ret = []
for i in range(0, len(uid), 2):
ret.append(int(uid[i:i+2], 16))
"""Python's final character"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this to Final byte stream character in Python

ret.append(0x00)
ret.append(0x00)
return ret
Expand All @@ -119,6 +121,7 @@ def uidIsValid(uid):
"""UID Validation."""
if len(uid) == 32:
try:
"""Must not be alpha except ABCDEF"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change this to UID characters must belong to base 16

int(uid, 16)
return True
except ValueError:
Expand Down Expand Up @@ -170,6 +173,7 @@ def decodeUrl(encodedUrl):
"""
decodedUrl = schemes[encodedUrl[0]]
for c in encodedUrl[1:]:
"""Unprintable character"""
Copy link
Collaborator

@PrabhanshuAttri PrabhanshuAttri May 17, 2018

Choose a reason for hiding this comment

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

These are just not the unprintable chars. Please read about Eddystone URL and UID here and here. Remove this comment. Also, update your branch.

if c <= 0x20:
decodedUrl += extensions[c]
else:
Expand Down