Skip to main content

macOS task management based on python classes, django models and generated apps

Project description

Installation

$ [sudo] pip install mac-task

Benefits

  • no manual edit. only classes and scripts!
  • dynamic tasks state
  • macOS Applications from python classes
  • standalone django models usage

How it works

mac-task based on task.py and mac-app-generator.py:

site-packages/django_settings.py    # export DJANGO_SETTINGS_MODULE="django_settings"
site-packages/task_<name>.py        # module with AppTask subclass(es)
~/Applications/.tasks/<name>.app    # generated app

~/Logs/Applications/<name>/err.log
~/Logs/Applications/<name>/out.log

<alias>  # make app alias if task `todo` is True. for example, add app alias to Dock

you can customize app path, name, icon, logs, etc. more info at mac-app-generator.py

Classes

class __doc__
mac_task.classes.AppTask MacOS app task class. inherited from task.classes.Task and mac_app_generator.App

Functions

function __doc__
mac_task.classes.getclasses() return a list of AppTask subclasses

Executable modules

usage __doc__
python -m mac_task.appify create applications from AppTask subclasses

Examples

from mac_task.classes import AppTask
from task.models import Task

class Stand_up(AppTask):
    """Stand up and move around every 30 minutes"""

    def todo(self):
        return not self.completed_at or self.completed_at.elapsed.minutes >= 30

    def run(self):
        slideshow = mac_slideshow.restart()
        while self.sleep(0.1) and slideshow.running:
            if self.elapsed > 60:
                self.complete()
                self.say("warm-up is complete.[[slnc 1000]] you can back to work")
                break
        slideshow.stop()

if __name__ == "__main__":  # debug
    print(Task.objects.get(class_name=Stand_up.__name__))

What's Next?

  • create your custom AppTask subclass, e.g. - site-packages/my_tasks.py
import task.setup
from mac_task.classes import AppTask

class MyApp(AppTask):
    ...
  • create categories, e.g.: Now, Today, ... and classes
from task.models import Category

class Now(MyApp):
    @property
    def category(self):
        return Category.objects.get_or_create(**kwargs)[0]

Related projects

django-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mac-task-2019.4.13.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page