summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-09-21 16:08:17 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-22 11:40:12 -0400
commitac5ead7f617631fe9cae2d10c2d6d2a709305d1e (patch)
tree8c5ace62089011f5e4d4eaeccc45968a8e43928d
parent073393af311d36c8ca7570ff0d3f0a3117c0b544 (diff)
[pkg] bitmask_js => leap.bitmask_js
-rw-r--r--.gitignore2
-rw-r--r--src/leap/bitmask/core/_web.py4
-rw-r--r--ui/Makefile8
-rw-r--r--ui/pydist/README.md3
-rw-r--r--ui/pydist/leap/__init__.py6
-rw-r--r--ui/pydist/setup.py11
-rw-r--r--ui/webpack.config.js2
7 files changed, 22 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index 0fa20c72..a2f4b4e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,7 +37,7 @@ ENV/
# Javascript, web-ui
ui/node_modules
ui/npm-debug.log
-ui/pydist/bitmask_js
+ui/pydist/leap/bitmask_js
# vim
*.swp
diff --git a/src/leap/bitmask/core/_web.py b/src/leap/bitmask/core/_web.py
index 344e26eb..983b97e1 100644
--- a/src/leap/bitmask/core/_web.py
+++ b/src/leap/bitmask/core/_web.py
@@ -34,7 +34,7 @@ from twisted.python import log
from leap.bitmask.core.dispatcher import CommandDispatcher
try:
- import bitmask_js
+ import leap.bitmask_js
HAS_WEB_UI = True
except ImportError:
HAS_WEB_UI = False
@@ -54,7 +54,7 @@ class HTTPDispatcherService(service.Service):
def startService(self):
if HAS_WEB_UI:
webdir = os.path.abspath(
- pkg_resources.resource_filename('bitmask_js', 'public'))
+ pkg_resources.resource_filename('leap.bitmask_js', 'public'))
else:
log.msg('bitmask_js not found, serving bitmask.core ui')
webdir = os.path.abspath(
diff --git a/ui/Makefile b/ui/Makefile
index d67a02b3..96b632c5 100644
--- a/ui/Makefile
+++ b/ui/Makefile
@@ -5,7 +5,7 @@
dev-build: build-clean
npm install
npm run build
- touch pydist/bitmask_js/__init__.py
+ touch pydist/leap/bitmask_js/__init__.py
dev-install: dev-build
pip install -e pydist
@@ -25,7 +25,7 @@ dev-install-prebuilt:
dist-build: build-clean
npm install
npm run build:production
- touch pydist/bitmask_js/__init__.py
+ touch pydist/leap/bitmask_js/__init__.py
cd pydist && python setup.py bdist_wheel
dist-install: dist-build
@@ -36,7 +36,7 @@ dist-install: dist-build
#
build-clean:
- rm -rf pydist/bitmask_js
+ rm -rf pydist/leap/bitmask_js
rm -rf pydist/dist
rm -rf pydist/build
@@ -44,4 +44,4 @@ clean: build-clean
rm -rf node_modules
uninstall:
- pip uninstall bitmask_js
+ pip uninstall leap.bitmask_js
diff --git a/ui/pydist/README.md b/ui/pydist/README.md
index 6e2b11f6..9e6f187f 100644
--- a/ui/pydist/README.md
+++ b/ui/pydist/README.md
@@ -1,4 +1,5 @@
-This directory holds the python package of the javascript app, called 'bitmask_js'.
+This directory holds the python package of the javascript app, called
+'leap.bitmask_js'.
Why it it done this way? By creating a python package, it is easier for the
javascript app to be distributed with the bitmask client.
diff --git a/ui/pydist/leap/__init__.py b/ui/pydist/leap/__init__.py
new file mode 100644
index 00000000..f48ad105
--- /dev/null
+++ b/ui/pydist/leap/__init__.py
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
diff --git a/ui/pydist/setup.py b/ui/pydist/setup.py
index b5d3ffb1..794b8e2d 100644
--- a/ui/pydist/setup.py
+++ b/ui/pydist/setup.py
@@ -25,26 +25,27 @@ import datetime
import time
long_description = \
-'''bitmask_js
------------------
+'''leap.bitmask_js
+-----------------
This package contains the already compiled javascript resources for the bitmask UI.
If you want to develop for this UI, please checkout the bitmask-dev [0] repo and follow the instructions in the ui/README.md file.
[0] https://github.com/leapcode/bitmask-dev'''
-now = datetime.datetime.now()
+now = datetime.datetime.now()
timestamp = time.strftime('%Y%m%d%H%M', now.timetuple())
setup(
- name='bitmask_js',
+ name='leap.bitmask_js',
version='0.1.%s' % timestamp,
description='Bitmask UI',
long_description=long_description,
author='LEAP Encrypted Access Project',
author_email='info@leap.se',
+ namespace_packages=['leap'],
url='http://leap.se',
- packages=['bitmask_js'],
+ packages=['leap.bitmask_js'],
package_data={
'': ['public/*',
'public/css/*',
diff --git a/ui/webpack.config.js b/ui/webpack.config.js
index c0f8d191..9b2137bc 100644
--- a/ui/webpack.config.js
+++ b/ui/webpack.config.js
@@ -6,7 +6,7 @@ var config = {
context: path.join(__dirname, 'app'),
entry: ['babel-polyfill', './main.js'],
output: {
- path: path.join(__dirname, 'pydist', 'bitmask_js', 'public'),
+ path: path.join(__dirname, 'pydist', 'leap', 'bitmask_js', 'public'),
filename: 'app.bundle.js'
},
resolve: {