# Path: redsolutioncms/models.py
# class ProcessTask(models.Model):
#     task = models.CharField(verbose_name=_('task'), max_length=255)
#     pid = models.IntegerField(verbose_name=_('process pid'), blank=True, null=True)
#     lock = models.BooleanField(verbose_name=_('task inactive'), default=False)
#     executed = models.BooleanField(verbose_name=_('task executed'), default=False)
#     process_finished = models.BooleanField(verbose_name=_('process finished'), default=False)
#     wait = models.BooleanField(verbose_name=_('wait finish'), default=False)
# 
#     def __unicode__(self):
#         return self.task
# 
# Path: redsolutioncms/loader.py
# def install_in_home():
# def run_cmd(cmd, cmd_dict=None):
# def process_cmd_string(cmd, cmd_dict=None):
# def run_in_home(cmd):
# def main():


from django.core.management.base import BaseCommand, CommandError
from redsolutioncms.models import ProcessTask
from redsolutioncms.loader import home_dir, process_cmd_string
import subprocess
import time
import os, signal
                        import ctypes
# -*- coding: utf-8 -*-

class Command(BaseCommand):

    def handle(self, *args, **options):
        ProcessTask.objects.create(task=process_cmd_string('"%(django)s" runserver --noreload'))

# Path: redsolutioncms/models.py
# class ProcessTask(models.Model):
#     task = models.CharField(verbose_name=_('task'), max_length=255)
#     pid = models.IntegerField(verbose_name=_('process pid'), blank=True, null=True)
#     lock = models.BooleanField(verbose_name=_('task inactive'), default=False)
#     executed = models.BooleanField(verbose_name=_('task executed'), default=False)
#     process_finished = models.BooleanField(verbose_name=_('process finished'), default=False)
#     wait = models.BooleanField(verbose_name=_('wait finish'), default=False)
# 
#     def __unicode__(self):
#         return self.task
# 
# Path: redsolutioncms/loader.py
# def install_in_home():
# def run_cmd(cmd, cmd_dict=None):
# def process_cmd_string(cmd, cmd_dict=None):
# def run_in_home(cmd):
# def main():


# Path: redsolutioncms/management/commands/wrap_runserver.py
from django.core.management.base import BaseCommand, CommandError
from redsolutioncms.models import ProcessTask
from redsolutioncms.loader import home_dir, process_cmd_string
import subprocess
import time
import os, signal
                        import ctypes

# -*- coding: utf-8 -*-

class Command(BaseCommand):

    def handle(self, *args, **options):
        ProcessTask.objects.create(task=process_cmd_string('"%(django)s" runserver --noreload'))

        ProcessTask.objects.create(task=process_cmd_string('"%(django)s" open_browser'))