Skip to content

Conversation

@iliakonnov
Copy link
Contributor

@iliakonnov iliakonnov commented Jun 2, 2017

Closes #12

@iliakonnov iliakonnov changed the title Added source parameter. Closes #12 Added source parameter Jun 2, 2017
@iliakonnov
Copy link
Contributor Author

iliakonnov commented Jun 2, 2017

Please note that when applying this PR, PR #44 will not be able to be merged automatically. To solve confilcts look at iliakonnov@2e6f08c

@waldyrious
Copy link
Member

LGTM. Pinging @HELLOKITTY111 (who opened #12) and @agnivade for review.

Copy link
Member

@agnivade agnivade left a comment

Choose a reason for hiding this comment

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

Hey @iliakonnov - Please have a look at my comments.

Did you test your changes ?

output(get_page(command, options.os))
output(get_page(command, options.source, options.os))
else:
output(get_page(command))
Copy link
Member

Choose a reason for hiding this comment

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

options.source param missing here

tldr.py Outdated


def download_and_store_page_for_platform(command, platform):
def download_and_store_page_for_platform(command, platform, remote):
Copy link
Member

Choose a reason for hiding this comment

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

There are references in the code to this function. Please pass the remote variable there too.

tldr.py Outdated


def get_page_for_platform(command, platform):
def get_page_for_platform(command, platform, remote):
Copy link
Member

Choose a reason for hiding this comment

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

You have to pass the remote here too inside the get_page call from where this function is called.

@iliakonnov
Copy link
Contributor Author

I think now it's OK. 6bad1af



def get_page_for_platform(command, platform):
def get_page_url(platform, command, remote=None):
Copy link
Member

Choose a reason for hiding this comment

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

Why not make remote=DEFAULT_REMOTE itself as the default param ? Then you don't need to make the check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def get_page_url(platform, command, remote=None):
if remote is None:
remote = DEFAULT_REMOTE
return remote + "/" + platform + "/" + quote(command) + ".md"
Copy link
Member

Choose a reason for hiding this comment

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

Use os.path.join ?

Copy link
Contributor Author

@iliakonnov iliakonnov Apr 4, 2018

Choose a reason for hiding this comment

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

I'm just copied code from previous functions. Also, os.path.join is for file path, not url.

tldr.py Outdated
help="Override the operating system [linux, osx, sunos]")

parser.add_argument('-s', '--source',
default="http://raw.github.com/tldr-pages/tldr/master/pages",
Copy link
Member

Choose a reason for hiding this comment

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

Use the DEFAULT_REMOTE variable here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@iliakonnov
Copy link
Contributor Author

iliakonnov commented Apr 4, 2018

Updated as requested: 4a53815

@agnivade
Copy link
Member

agnivade commented Apr 4, 2018

Please rebase from latest master and resolve the merge conflicts.

@iliakonnov
Copy link
Contributor Author

I'm not really with git. Is it OK?

@JacobCallahan
Copy link
Contributor

@iliakonnov The webui doesn't show any merge conflicts, so you should be good there. And they are able to do a squash merge to reduce your total commits from 5 to 1. IMO there is no further action needed on your end, pending any other code issues brought up.

@agnivade agnivade merged commit 2b26ea5 into tldr-pages:master Apr 4, 2018
@iliakonnov iliakonnov deleted the #12 branch April 5, 2018 08:08
felixonmars pushed a commit that referenced this pull request Jun 3, 2018
#50 made the remote use HTTPS, but then #42 changed it back to HTTP when adding the flag.
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.

4 participants