Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
Germey committed Apr 16, 2018
1 parent 0af8216 commit 9bfbc9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions gerapy/client/src/store/states/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default {
timeout: null,
intervals: [],
lang:onLoad(),
lang: onLoad(),
}
function onLoad (){
if (typeof(Storage) !== "undefined" && localStorage .getItem("gerapy-lang") !== "undefined") {
return localStorage.getItem("gerapy-lang");
function onLoad() {
if (typeof(Storage) !== 'undefined' && localStorage.getItem('gerapy-lang') !== 'undefined') {
return localStorage.getItem('gerapy-lang');
} else {
return 'en'
}
Expand Down
12 changes: 7 additions & 5 deletions gerapy/templates/spiders/crawl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ class {{ spider.name|capitalize }}Spider(CrawlSpider):
]
{% endif -%}
custom_settings = {
{% if spider.storage.mysql.host -%}"MYSQL_HOST": "{{ spider.storage.mysql.host }}",{%- endif %}
{% if spider.storage.mysql.port -%}"MYSQL_PORT": {{ spider.storage.mysql.port }},{%- endif %}
{% if spider.storage.mysql.user -%}"MYSQL_USER": "{{ spider.storage.mysql.user }}",{%- endif %}
{% if spider.storage.mysql.password -%}"MYSQL_PASSWORD": "{{ spider.storage.mysql.password }}",{%- endif %}
{% if spider.storage.mysql.database -%}"MYSQL_DATABASE": "{{ spider.storage.mysql.database }}",{%- endif %}
{% if spider.storage.mysql.host -%}"MYSQL_HOST": "{{ spider.storage.mysql.host }}",{%- endif -%}
{% if spider.storage.mysql.port -%}"MYSQL_PORT": {{ spider.storage.mysql.port }},{%- endif -%}
{% if spider.storage.mysql.user -%}"MYSQL_USER": "{{ spider.storage.mysql.user }}",{%- endif -%}
{% if spider.storage.mysql.password -%}"MYSQL_PASSWORD": "{{ spider.storage.mysql.password }}",{%- endif -%}
{% if spider.storage.mysql.database -%}"MYSQL_DATABASE": "{{ spider.storage.mysql.database }}",{%- endif -%}
"ITEM_PIPELINES": {
{% if spider.storage.mysql.enable -%}
'gerapy.pipelines.MySQLPipeline': 300,
{% endif -%}
}
}
{% if spider.start_urls -%}
Expand Down

0 comments on commit 9bfbc9b

Please sign in to comment.