kopia lustrzana https://github.com/OpenDroneMap/WebODM
commit
014d585263
|
@ -3,6 +3,7 @@ import logging
|
|||
import importlib
|
||||
import subprocess
|
||||
import traceback
|
||||
import platform
|
||||
|
||||
import django
|
||||
import json
|
||||
|
@ -72,7 +73,15 @@ def build_plugins():
|
|||
# and run npm install if needed
|
||||
if plugin.path_exists("public/package.json") and not plugin.path_exists("public/node_modules"):
|
||||
logger.info("Running npm install for {}".format(plugin))
|
||||
subprocess.call(['npm', 'install'], cwd=plugin.get_path("public"))
|
||||
|
||||
try:
|
||||
npm = "npm"
|
||||
if platform.system() == "Windows":
|
||||
npm = "npm.cmd"
|
||||
subprocess.call([npm, 'install'], cwd=plugin.get_path("public"))
|
||||
except FileNotFoundError:
|
||||
logger.warn("npm is not installed, will skip this plugin")
|
||||
continue
|
||||
|
||||
# Check if we need to generate a webpack.config.js
|
||||
if len(plugin.build_jsx_components()) > 0 and plugin.path_exists('public'):
|
||||
|
@ -105,8 +114,15 @@ def build_plugins():
|
|||
subprocess.Popen(['webpack-cli', '--watch'], cwd=plugin.get_path("public"))
|
||||
elif not plugin.path_exists("public/build"):
|
||||
logger.info("Running webpack for {}".format(plugin.get_name()))
|
||||
subprocess.call(['webpack-cli'], cwd=plugin.get_path("public"))
|
||||
|
||||
try:
|
||||
webpack = "webpack-cli"
|
||||
if platform.system() == "Windows":
|
||||
webpack = "webpack-cli.cmd"
|
||||
|
||||
subprocess.call([webpack], cwd=plugin.get_path("public"))
|
||||
except FileNotFoundError:
|
||||
logger.warn("webpack-cli is not installed, plugin will not work")
|
||||
|
||||
def webpack_watch_process_count():
|
||||
count = 0
|
||||
|
|
|
@ -3,6 +3,7 @@ import shutil
|
|||
import tempfile
|
||||
import subprocess
|
||||
import os
|
||||
import platform
|
||||
|
||||
from webodm import settings
|
||||
|
||||
|
@ -80,16 +81,33 @@ class GrassContext:
|
|||
# Create param list
|
||||
params = ["{}={}".format(opt,value) for opt,value in self.script_opts.items()]
|
||||
|
||||
# Track success, output
|
||||
success = False
|
||||
out = ""
|
||||
err = ""
|
||||
|
||||
# Execute it
|
||||
logger.info("Executing grass script from {}: {} -c {} location --exec python {} {}".format(self.get_cwd(), self.grass_binary, self.location, script, " ".join(params)))
|
||||
p = subprocess.Popen([self.grass_binary, '-c', self.location, 'location', '--exec', 'python', script] + params,
|
||||
cwd=self.get_cwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = p.communicate()
|
||||
|
||||
command = [self.grass_binary, '-c', self.location, 'location', '--exec', 'python', script] + params
|
||||
if platform.system() == "Windows":
|
||||
# communicate() hangs on Windows so we use check_output instead
|
||||
try:
|
||||
out = subprocess.check_output(command, cwd=self.get_cwd()).decode('utf-8').strip()
|
||||
success = True
|
||||
except subprocess.CalledProcessError:
|
||||
success = False
|
||||
err = out
|
||||
else:
|
||||
p = subprocess.Popen(command, cwd=self.get_cwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
out, err = p.communicate()
|
||||
|
||||
out = out.decode('utf-8').strip()
|
||||
err = err.decode('utf-8').strip()
|
||||
out = out.decode('utf-8').strip()
|
||||
err = err.decode('utf-8').strip()
|
||||
success = p.returncode == 0
|
||||
|
||||
if p.returncode == 0:
|
||||
if success:
|
||||
return out
|
||||
else:
|
||||
raise GrassEngineException("Could not execute GRASS script {} from {}: {}".format(script, self.get_cwd(), err))
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
amqp==2.2.2
|
||||
amqp==2.5.2
|
||||
anyjson==0.3.3
|
||||
appdirs==1.4.0
|
||||
APScheduler==3.2.0
|
||||
billiard==3.5.0.3
|
||||
celery==4.1.0
|
||||
billiard==3.6.3.0
|
||||
celery==4.4.0
|
||||
coreapi==2.0.9
|
||||
Django==2.1.15
|
||||
django-appconf==1.0.2
|
||||
|
@ -24,24 +24,24 @@ futures==3.0.5
|
|||
geojson==2.3.0
|
||||
gunicorn==19.7.1
|
||||
itypes==1.1.0
|
||||
kombu==4.1.0
|
||||
libsass==0.13.3
|
||||
kombu==4.6.7
|
||||
libsass==0.19.4
|
||||
Markdown==2.6.7
|
||||
olefile==0.44
|
||||
openapi-codec==1.1.7
|
||||
packaging==16.8
|
||||
piexif==1.0.13
|
||||
pilkit==2.0
|
||||
Pillow==6.2.0
|
||||
Pillow==6.2.2
|
||||
pip-autoremove==0.9.0
|
||||
psycopg2==2.7.4
|
||||
psycopg2-binary==2.7.4
|
||||
psycopg2==2.8.4
|
||||
psycopg2-binary==2.8.4
|
||||
PyJWT==1.5.3
|
||||
pyodm==1.5.3b1
|
||||
pyparsing==2.1.10
|
||||
pytz==2018.3
|
||||
pytz==2019.3
|
||||
rcssmin==1.0.6
|
||||
redis==2.10.6
|
||||
redis==3.2.0
|
||||
requests-toolbelt==0.9.1
|
||||
requests==2.21.0
|
||||
rfc3987==1.3.7
|
||||
|
@ -51,9 +51,14 @@ six==1.11.0
|
|||
strict-rfc3339==0.7
|
||||
tzlocal==1.3
|
||||
uritemplate==3.0.0
|
||||
vine==1.1.4
|
||||
vine==1.3.0
|
||||
webcolors==1.5
|
||||
rasterio==1.1.0
|
||||
-e git://github.com/OpenDroneMap/rio-tiler.git#egg=rio-tiler
|
||||
rio-color==1.0.0
|
||||
rio-cogeo==1.1.8
|
||||
rio-cogeo==1.1.8
|
||||
rasterio==1.1.0 ; sys_platform == 'linux' or sys_platform == 'darwin'
|
||||
https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/rasterio-1.1.3-cp37-cp37m-win_amd64.whl ; sys_platform == "win32"
|
||||
https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/GDAL-3.0.4-cp37-cp37m-win_amd64.whl ; sys_platform == "win32"
|
||||
Shapely==1.7.0 ; sys_platform == "win32"
|
||||
eventlet==0.25.1 ; sys_platform == "win32"
|
||||
pyopenssl==19.1.0 ; sys_platform == "win32"
|
Ładowanie…
Reference in New Issue