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