From aefb88ff69eeacb48cd125c2df2f54aebf5a232b Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Fri, 25 Dec 2015 20:54:25 +0200 Subject: [PATCH] removed dropbox app keys from git --- .gitignore | 1 + motioneye/static/js/main.js | 2 +- motioneye/uploadservices.py | 4 ++-- setup.py | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 67b52a1..26c0720 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ run dist motioneye.egg-info +dropbox.keys diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index 01aac80..ee6b838 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -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 */ } diff --git a/motioneye/uploadservices.py b/motioneye/uploadservices.py index 494091c..3805023 100644 --- a/motioneye/uploadservices.py +++ b/motioneye/uploadservices.py @@ -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' diff --git a/setup.py b/setup.py index 21f6055..24729e5 100644 --- 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 } ) -- 2.39.5