Skip to content

Commit

Permalink
removes phantomjs as global dependencies and make it a node dependencie
Browse files Browse the repository at this point in the history
  • Loading branch information
brunosmartin committed Apr 12, 2016
1 parent a09ab8c commit 60784ce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def render_to_response(self, context, **response_kwargs):
from selenium import webdriver
from signal import SIGTERM
from time import gmtime, strftime
from timtec.settings import MEDIA_ROOT, CERTIFICATE_SIZE
from timtec.settings import MEDIA_ROOT, CERTIFICATE_SIZE, PHANTOMJS_PATH
from PIL import Image
import os

Expand All @@ -366,7 +366,7 @@ def render_to_response(self, context, **response_kwargs):
pdf_filename = certificate.link_hash + today + '.pdf'
pdf_path = os.path.join(MEDIA_ROOT, pdf_filename)

driver = webdriver.PhantomJS()
driver = webdriver.PhantomJS(executable_path=PHANTOMJS_PATH)
driver.set_window_size(width, height)
driver.get(url)
driver.save_screenshot(filename=png_path)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/instalacao_e_configuracao/Instalação.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Primeiro, vamos instalar as dependências:

```
$ sudo apt-get update
$ sudo apt-get install -y libpq-dev libjpeg-dev libpng12-dev build-essential python-dev gettext python-virtualenv phantomjs
$ sudo apt-get install -y libpq-dev libjpeg-dev libpng12-dev build-essential python-dev gettext python-virtualenv
```

### Instalando o nodejs
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"grunt-cli": "~0.1.13",
"grunt-angular-gettext": "~2.1.11",
"less": "~2.6.1",
"ng-annotate": "~1.2"
"ng-annotate": "~1.2",
"phantomjs-prebuilt": "~2.1.7"
},
"devDependencies": {
"jshint": "~2.9.1"
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TIMTEC_USER=vagrant
# useradd --groups sudo --create-home ${TIMTEC_USER}

sudo apt-get update
sudo apt-get install -y libpq-dev libjpeg-dev libpng12-dev build-essential python-dev gettext python-virtualenv nodejs npm git phantomjs
sudo apt-get install -y libpq-dev libjpeg-dev libpng12-dev build-essential python-dev gettext python-virtualenv nodejs npm git

# sudo useradd -U -m ${TIMTEC_USER}

Expand Down
1 change: 1 addition & 0 deletions timtec/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
SOCIALACCOUNT_EMAIL_VERIFICATION = False

CERTIFICATE_SIZE = (862, 596)
PHANTOMJS_PATH = os.path.join(PROJECT_ROOT, 'node_modules/phantomjs-prebuilt/bin/phantomjs')

TWITTER_CONSUMER_KEY = ''
TWITTER_CONSUMER_SECRET = ''
Expand Down

0 comments on commit 60784ce

Please sign in to comment.