Skip to content

Commit

Permalink
added a custom temp location
Browse files Browse the repository at this point in the history
  • Loading branch information
tecoholic committed May 15, 2015
1 parent 2e93fa9 commit 86d3843
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions zimbalaka/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
zimwriterfs = '/usr/local/bin/zimwriterfs'
assets = os.path.join(os.path.dirname(__file__), 'assets')
static = os.path.join(os.path.dirname(__file__), 'static')
tmploc = '/tmp'
7 changes: 4 additions & 3 deletions zimbalaka/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
<div class="form-group col-sm-6" id="urldiv">
<label class="control-label col-sm-4" for="url">URL</label>
<div class="col-sm-8">
<input id="url" class="form-control" type="text" placeholder="http://some.wikisite.org/wiki/">
<input id="url" class="form-control" type="text" placeholder="http://some.wikisite.org">
<span class="input-group-addon">/wiki/Article</span>
</div>
</div>
<div class="form-group col-sm-6">
<div class="form-group col-xs-12 col-sm-6">
<label for="list" class="control-label">Titles of the articles</label>
<textarea rows="10" id="list" class="form-control" placeholder="One per line"></textarea>
</div>
<div class="form-group col-sm-6 pull-right">
<div class="form-group col-xs-12 col-sm-6 pull-right">
<label class="control-label" for="cats">Articles from Category</label>
<textarea id="cats" rows="10" class="form-control" placeholder="'Category:Some Catergory' 1 per line"></textarea>
</div>
Expand Down
4 changes: 2 additions & 2 deletions zimbalaka/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from subprocess import call
from pyquery import PyQuery as pq

from zimbalaka.default_settings import assets, static, zimwriterfs
from zimbalaka.default_settings import assets, static, zimwriterfs, tmploc

def download_image(dloc, url):
"""Download the image from the given url and add it to the assets"""
Expand Down Expand Up @@ -134,7 +134,7 @@ def zimit(title, articles, cats, url, logger):
zimwriterfs --welcome=index.html --favicon=m/favicon.png --language=fra --title=foobar --description=mydescription \
--creator=Wikipedia --publisher=Kiwix ./my_project_html_directory my_project.zim
"""
dloc = tempfile.mkdtemp()
dloc = tempfile.mkdtemp(dir=tmploc)
baseurl = url
lang = guess_language(url)
down_count = 0
Expand Down

0 comments on commit 86d3843

Please sign in to comment.