Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
7b7ee8a2
Commit
7b7ee8a2
authored
Apr 16, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Share code for virtualenv activation
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
dd867959
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
openshift/virtualenv.py
openshift/virtualenv.py
+30
-0
openshift/wsgi.py
openshift/wsgi.py
+2
-6
openshift/wsgi_install.py
openshift/wsgi_install.py
+2
-6
No files found.
openshift/virtualenv.py
0 → 100644
View file @
7b7ee8a2
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <tschan@puzzle.ch>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import
os
def
activate
():
virtenv
=
os
.
environ
[
'OPENSHIFT_PYTHON_DIR'
]
+
'/virtenv/'
virtualenv
=
os
.
path
.
join
(
virtenv
,
'bin/activate_this.py'
)
try
:
execfile
(
virtualenv
,
dict
(
__file__
=
virtualenv
))
except
IOError
:
pass
openshift/wsgi.py
View file @
7b7ee8a2
...
...
@@ -22,17 +22,13 @@
import
os
import
sys
from
django.core.wsgi
import
get_wsgi_application
from
.virtualenv
import
activate
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
environ
[
'OPENSHIFT_REPO_DIR'
],
'weblate'
))
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
environ
[
'OPENSHIFT_REPO_DIR'
],
'openshift'
))
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'weblate.settings_openshift'
virtenv
=
os
.
environ
[
'OPENSHIFT_PYTHON_DIR'
]
+
'/virtenv/'
virtualenv
=
os
.
path
.
join
(
virtenv
,
'bin/activate_this.py'
)
try
:
execfile
(
virtualenv
,
dict
(
__file__
=
virtualenv
))
except
IOError
:
pass
activate
()
application
=
get_wsgi_application
()
openshift/wsgi_install.py
View file @
7b7ee8a2
...
...
@@ -21,13 +21,9 @@
import
os
from
string
import
Template
from
.virtualenv
import
activate
virtenv
=
os
.
environ
[
'OPENSHIFT_PYTHON_DIR'
]
+
'/virtenv/'
virtualenv
=
os
.
path
.
join
(
virtenv
,
'bin/activate_this.py'
)
try
:
execfile
(
virtualenv
,
dict
(
__file__
=
virtualenv
))
except
IOError
:
pass
activate
()
def
application
(
environ
,
start_response
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment