Compare commits
No commits in common. "769f0b7fd2dda5cdf0331a5f415c38ee329fd643" and "5f9a2b987928311f58fa186028f5cec1f8c4dc1f" have entirely different histories.
769f0b7fd2
...
5f9a2b9879
19 changed files with 32 additions and 21 deletions
12
ctl
12
ctl
|
|
@ -10,7 +10,6 @@ self=`readlink "$0"`
|
|||
if [ -z $self ]; then
|
||||
self="$0"
|
||||
fi
|
||||
|
||||
if [ "$action" = "init" ]; then
|
||||
cd "`dirname "$self"`"
|
||||
BASE=`pwd`
|
||||
|
|
@ -48,15 +47,7 @@ if [ "$action" = "init" ]; then
|
|||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$action" = "manage" ]; then
|
||||
cmd="pandora/manage.py"
|
||||
fi
|
||||
if [ "$action" = "update" ]; then
|
||||
cmd="update.py"
|
||||
fi
|
||||
|
||||
if [ ! -z $cmd ]; then
|
||||
cd "`dirname "$self"`"
|
||||
BASE=`pwd`
|
||||
SUDO=""
|
||||
|
|
@ -65,10 +56,9 @@ if [ ! -z $cmd ]; then
|
|||
SUDO="sudo -H -u $PANDORA_USER"
|
||||
fi
|
||||
shift
|
||||
$SUDO "$BASE/$cmd" $@
|
||||
$SUDO $BASE/pandora/manage.py $@
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ `whoami` != 'root' ]; then
|
||||
echo you have to be root or run $0 with sudo
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, with_statement
|
||||
|
||||
import time
|
||||
|
||||
from .models import Settings
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, with_statement
|
||||
|
||||
import os
|
||||
|
||||
import ox
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, with_statement
|
||||
|
||||
import ox
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from .actions import actions
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, absolute_import
|
||||
|
||||
import inspect
|
||||
import sys
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division, absolute_import
|
||||
|
||||
import json
|
||||
|
||||
from django.shortcuts import render
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
|
||||
from functools import wraps
|
||||
|
||||
from .shortcuts import render_to_json_response
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
|
@ -96,9 +97,7 @@ class DataTimeline():
|
|||
def get_frame(self, pos):
|
||||
frame = int(pos * self.fps)
|
||||
tile = int(frame * 8 / self.timeline_width)
|
||||
if len(self.file_names) <= tile:
|
||||
tile = len(self.file_names) - 1
|
||||
if self.current_tile != tile and len(self.file_names):
|
||||
if self.current_tile != tile:
|
||||
self.timeline_image = Image.open(self.file_names[tile])
|
||||
self.current_tile = tile
|
||||
x = frame * 8 - tile * self.timeline_width
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# Django settings for pan.do/ra project defaults,
|
||||
# create local_settings.py to overwrite
|
||||
# check pan.do/ra section below for relevant settings
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
from os.path import join, normpath, dirname
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
|
@ -8,7 +8,6 @@ from kombu.mixins import ConsumerMixin
|
|||
|
||||
from . import daemon, key
|
||||
|
||||
logger = logging.getLogger('pandora.websocket')
|
||||
|
||||
queue = Queue('websocket', Exchange(key, type='direct'), routing_key=key)
|
||||
|
||||
|
|
@ -23,11 +22,8 @@ class Worker(ConsumerMixin):
|
|||
callbacks=[self.process_task])]
|
||||
|
||||
def process_task(self, body, message):
|
||||
try:
|
||||
if body['task'] == 'trigger_event':
|
||||
daemon.trigger_event(*body['args'])
|
||||
except:
|
||||
logger.error('faild to trigger event %s', body, exc_info=True)
|
||||
if body['task'] == 'trigger_event':
|
||||
daemon.trigger_event(*body['args'])
|
||||
message.ack()
|
||||
|
||||
def run():
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
from __future__ import print_function
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue