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

Add support for setting folder where pypandoc downloads installation files to #167

Closed
JessicaTegner opened this issue Nov 20, 2018 · 4 comments

Comments

@JessicaTegner
Copy link
Owner

JessicaTegner commented Nov 20, 2018

Hi.
Would it be posible to be able to specify the path to where pypandoc downloads installation packages for pandoc.
Like where you can set "download_pandoc(targetfolder="path/to/custom/pandoc/folder")"
Installation pages are the files like "pandoc-2.4-windows-x86_64.msi", "pandoc-2.4-windows-x86_64.pkg" and such.

Suggestion:

Extend the pypandoc.download_pandoc function to include an argument for setting the installer download folder.
Something like: download_pandoc(targetfolder/"Here/pandoc/gets/installed", installation_file_cash="here/the/temporary/installation/files/gets/downloaded/to")
And set it so the new parameter defaults to the current working dir (like it does now), if a custom path aren't provided.

Why:

It cause problems for windows users (with User account control) and Mac Os users, if the program that used pypandoc (that tries to download pandoc through pypandoc) are placed in a permission restricted folder (f.x. the C:\Program Files) or in /Applications on mac.

@ecederstrand
Copy link
Contributor

Isn't this what the targetfolder argument does? See https://github.com/bebraw/pypandoc/blob/master/pypandoc/pandoc_download.py#L152

@JessicaTegner
Copy link
Owner Author

@ecederstrand
this is not what targetfolder does, from the file itself:

  • targetfolder: directory, where the binaries should be installed.

What that does, is set the path, where pandoc gets installed. What I'm asking for, is an option to set where the pandoc installers (ie pandoc-x.x.msi and the same for mac) gets downloaded to, before getting installed.

@abarrafo
Copy link
Contributor

I fixed this in a branch, but it seems this repo is locked down without instruction in the Contribution block on how to proceed. I am unable to push my branch and create a pull request.

I am running pypandoc in an AWS Lambda function that only permits file write access into the /tmp path requiring this implementation.

abarrafo added a commit to abarrafo/pypandoc that referenced this issue Jan 23, 2020
@abarrafo
Copy link
Contributor

I fixed this in a branch, but it seems this repo is locked down without instruction in the Contribution block on how to proceed. I am unable to push my branch and create a pull request.

I am running pypandoc in an AWS Lambda function that only permits file write access into the /tmp path requiring this implementation.

Ok, I was able to fork https://github.com/abarrafo/pypandoc it and then create a PR. Looks like the project has some broken CI/CD stuff that needs attending to proceed with a merge here.

clrpackages pushed a commit to clearlinux-pkgs/pypandoc that referenced this issue Apr 14, 2020
Alexander Klimov (1):
      Fix version comparison

Andrew Barraford (1):
      Download Folder, #167, fixes: JessicaTegner/pypandoc#167

Chaz Reid (3):
      :)
      fix pd -> pypandoc
      remove superfluous arg name source=

Elena ``of Valhalla'' Grandi (1):
      Fix parsing of unicode paths on non-unicode locales

Erik Cederstrand (2):
      Skip code that isn't needed when the url is set
      platform is still needed for unpacking

Jakob Jul Elben (1):
      Typo

Jan Katins (7):
      Fix miktex install on appveyor
      Test py3.7 and 3.8 and remove py3.5 on Travis
      Do not cache old miktex directory anymore
      Test py3.7 and 3.8 and remove py3.5 on appveyor
      Include long description as markdown
      Remove ambiguous usage of convert in tests
      Release version 1.5

Jan Schulz (12):
      Make py2.7 happy with unicode author names
      Fix tests with newer pandoc
      Remove pypy from travis setup
      Fix appveyor latex setup
      Remove outdated python versions from tests
      Fix flake8 errors
      Workaround a problem in pip10
      Workaround a problem with uppercase lua filenames in pandoc
      Allow file:// based URLs
      Rename variable name to make it clearer
      Skip file: url test on windows
      Add pandoc version print on appveyor

Priyam Singh (1):
      add quiet keyword to download_pandoc

Rebecca Heineman (3):
      Added quiet to _ensure_pandoc_path
      Added Windows specific Pandoc paths
      Added my name to contributors

Sameer Singh (2):
      Edited so that installer gets removed after pandoc installation.
      Added boolean argument delete_installer to download_pandoc

Tsuyoshi Hombashi (1):
      Change to to avoid "DeprecationWarning: invalid escape sequence"

Wolf Vollprecht (1):
      Filename of the archive has changed to `xz` ending

lbartoletti (1):
      Update README.md

radek-sprta (1):
      Add Python 3.6 to the list of supported versions

xoviat (2):
      download: add ensure_pandoc_installed
      autoflakes
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

No branches or pull requests

3 participants