]> www.vanbest.org Git - motioneye-debian/commitdiff
removed dropbox app keys from git
authorCalin Crisan <ccrisan@gmail.com>
Fri, 25 Dec 2015 18:54:25 +0000 (20:54 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Fri, 25 Dec 2015 18:54:54 +0000 (20:54 +0200)
.gitignore
motioneye/static/js/main.js
motioneye/uploadservices.py
setup.py

index 67b52a1e071850874f9a960fb2ca1ea8ea8a6fcc..26c072045eb1f83586e9038e739d02813149a0c1 100644 (file)
@@ -10,3 +10,4 @@
 run
 dist
 motioneye.egg-info
+dropbox.keys
index 01aac80feee22cd382ecead0a63dc5ad091b6c85..ee6b838572a405dc9d2d2cf911f0bec0b0ff2b1e 100644 (file)
@@ -917,7 +917,7 @@ function updateLayout() {
         var windowWidth = $(window).width();
         
         var columns = layoutColumns;
-        if (isFullScreen() || windowWidth < 1200) {
+        if (isFullScreen() || windowWidth <= 1200) {
             columns = 1; /* always 1 column when in full screen or mobile */
         }
         
index 494091ccac028e190743bb5eccad9d4744dd1de8..38050235c2c383c4a0464c689ebf854d878853dd 100644 (file)
@@ -389,8 +389,8 @@ class Dropbox(UploadService):
     AUTH_URL = 'https://www.dropbox.com/1/oauth2/authorize'
     TOKEN_URL = 'https://api.dropboxapi.com/1/oauth2/token'
 
-    CLIENT_ID = 'dwiw710jz6r60pq'
-    CLIENT_NOT_SO_SECRET = '8jz75qo405ritd5'
+    CLIENT_ID = 'dropbox_client_id_placeholder'
+    CLIENT_NOT_SO_SECRET = 'dropbox_client_secret_placeholder'
     
     LIST_FOLDER_URL = 'https://api.dropboxapi.com/2/files/list_folder'
     UPLOAD_URL = 'https://content.dropboxapi.com/2/files/upload'
index 21f60552d7a95f7c50ee607702bdbe0cdf775a54..24729e5addd3eab8f97395ad09f30f7cabe2e174 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@ import os.path
 
 from codecs import open
 from setuptools import setup
+from setuptools.command.sdist import sdist
 
 import motioneye
 
@@ -15,6 +16,23 @@ with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
     long_description = f.read()
 
 
+class SdistCommand(sdist):
+    def make_release_tree(self, base_dir, files):
+        sdist.make_release_tree(self, base_dir, files)
+        self.apply_patches(base_dir)
+        
+    def apply_patches(self, base_dir):
+        dropbox_keys_file = os.path.join(os.getcwd(), base_dir, 'extra', 'dropbox.keys')
+        if os.path.exists(dropbox_keys_file):
+            g = {}
+            execfile(dropbox_keys_file, g)
+            upload_services_file = os.path.join(os.getcwd(), base_dir, 'motioneye', 'uploadservices.py')
+            if os.system("sed -i 's/dropbox_client_id_placeholder/%s/' %s" % (g['CLIENT_ID'], upload_services_file)):
+                raise Exception('failed to patch uploadservices.py')
+            if os.system("sed -i 's/dropbox_client_secret_placeholder/%s/' %s" % (g['CLIENT_SECRET'], upload_services_file)):
+                raise Exception('failed to patch uploadservices.py')
+
+
 setup(
     name=name,
     version=version,
@@ -64,5 +82,9 @@ setup(
         'console_scripts': [
             'meyectl=motioneye.meyectl:main',
         ],
+    },
+    
+    cmdclass={
+        'sdist': SdistCommand
     }
 )