Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethjiang committed Jan 5, 2019
0 parents commit 830a0c3
Show file tree
Hide file tree
Showing 61 changed files with 571 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[**.py]
indent_style = tab

[**.js]
indent_style = space
indent_size = 4
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.pyc
*.swp
.idea
*.iml
*.log
build
dist
*.egg*
.DS_Store
*.zip
/.vagrant
/data
/python3
/node_modules
npm-debug.log
.config*
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.md
recursive-include octoprint_thespaghettidetective/templates *
recursive-include octoprint_thespaghettidetective/translations *
recursive-include octoprint_thespaghettidetective/static *
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TheSpaghettiDetective

**TODO:** Describe what your plugin does.

## Setup

Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
or manually using this URL:

https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/archive/master.zip

**TODO:** Describe how to install your plugin, if more needs to be done than just installing it via pip or through
the plugin manager.

## Configuration

**TODO:** Describe your plugin's configuration options (if any).
119 changes: 119 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/bionic64"

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url = "http://domain.com/path/to/above.box"

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.134.40"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
config.ssh.forward_agent = true

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Don't boot with headless mode
# vb.gui = true

# Use VBoxManage to customize the VM. For example to change memory:
#vb.customize ["modifyvm", :id, "--memory", "2048"]
end
#
# View the documentation for the provider you're using for more
# information on available options.

# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file base.pp in the manifests_path directory.
#
# An example Puppet manifest to provision the message of the day:
#
# # group { "puppet":
# # ensure => "present",
# # }
# #
# # File { owner => 0, group => 0, mode => 0644 }
# #
# # file { '/etc/motd':
# # content => "Welcome to your Vagrant-built virtual machine!
# # Managed by Puppet.\n"
# # }
#
# config.vm.provision "puppet" do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# end

# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision "chef_solo" do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
# end

# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.provision "shell", path: "scripts/provision.sh", privileged: false, args: "/vagrant"
end
6 changes: 6 additions & 0 deletions babel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[python: */**.py]
[jinja2: */**.jinja2]
extensions=jinja2.ext.autoescape, jinja2.ext.with_

[javascript: */**.js]
extract_messages = gettext, ngettext
8 changes: 8 additions & 0 deletions extras/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Currently Cookiecutter generates the following helpful extras to this folder:

TheSpaghettiDetective.md
Data file for plugins.octoprint.org. Fill in the missing TODOs once your
plugin is ready for release and file a PR as described at
http://plugins.octoprint.org/help/registering/ to get it published.

This folder may be safely removed if you don't need it.
89 changes: 89 additions & 0 deletions extras/TheSpaghettiDetective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
layout: plugin

id: TheSpaghettiDetective
title: TheSpaghettiDetective
description: OctoPrint plugin for The Spaghetti Detective
author: Kenneth Jiang
license: AGPLv3

# TODO
date: today's date in format YYYY-MM-DD, e.g. 2015-04-21

homepage: https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective
source: https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective
archive: https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/archive/master.zip

# TODO
# Set this to true if your plugin uses the dependency_links setup parameter to include
# library versions not yet published on PyPi. SHOULD ONLY BE USED IF THERE IS NO OTHER OPTION!
#follow_dependency_links: false

# TODO
tags:
- a list
- of tags
- that apply
- to your plugin
- (take a look at the existing plugins for what makes sense here)

# TODO
screenshots:
- url: url of a screenshot, /assets/img/...
alt: alt-text of a screenshot
caption: caption of a screenshot
- url: url of another screenshot, /assets/img/...
alt: alt-text of another screenshot
caption: caption of another screenshot
- ...

# TODO
featuredimage: url of a featured image for your plugin, /assets/img/...

# TODO
# You only need the following if your plugin requires specific OctoPrint versions or
# specific operating systems to function - you can safely remove the whole
# "compatibility" block if this is not the case.

compatibility:

# List of compatible versions
#
# A single version number will be interpretated as a minimum version requirement,
# e.g. "1.3.1" will show the plugin as compatible to OctoPrint versions 1.3.1 and up.
# More sophisticated version requirements can be modelled too by using PEP440
# compatible version specifiers.
#
# You can also remove the whole "octoprint" block. Removing it will default to all
# OctoPrint versions being supported.

octoprint:
- 1.2.0

# List of compatible operating systems
#
# Valid values:
#
# - windows
# - linux
# - macos
# - freebsd
#
# There are also two OS groups defined that get expanded on usage:
#
# - posix: linux, macos and freebsd
# - nix: linux and freebsd
#
# You can also remove the whole "os" block. Removing it will default to all
# operating systems being supported.

os:
- linux
- windows
- macos
- freebsd

---

**TODO**: Longer description of your plugin, configuration examples etc. This part will be visible on the page at
http://plugins.octoprint.org/plugin/TheSpaghettiDetective/
Binary file added jpgs/057.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/058.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/059.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/060.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/061.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/062.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/063.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/064.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/065.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/066.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/067.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/068.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/069.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/070.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/071.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/072.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/073.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/074.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/075.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/076.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/077.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/078.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/079.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/080.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/081.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added jpgs/082.jpg
Binary file added jpgs/083.jpg
Binary file added jpgs/084.jpg
Binary file added jpgs/085.jpg
Binary file added jpgs/086.jpg
Binary file added jpgs/087.jpg
Binary file added jpgs/088.jpg
Binary file added jpgs/089.jpg
Binary file added jpgs/090.jpg
Binary file added jpgs/091.jpg
Binary file added jpgs/092.jpg
Binary file added jpgs/093.jpg
Binary file added jpgs/094.jpg
Binary file added jpgs/095.jpg
Binary file added jpgs/096.jpg
Binary file added jpgs/097.jpg
Binary file added jpgs/098.jpg
Binary file added jpgs/099.jpg
72 changes: 72 additions & 0 deletions octoprint_thespaghettidetective/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# coding=utf-8
from __future__ import absolute_import

### (Don't forget to remove me)
# This is a basic skeleton for your plugin's __init__.py. You probably want to adjust the class name of your plugin
# as well as the plugin mixins it's subclassing from. This is really just a basic skeleton to get you started,
# defining your plugin as a template plugin, settings and asset plugin. Feel free to add or remove mixins
# as necessary.
#
# Take a look at the documentation on what other plugin mixins are available.

import octoprint.plugin

class ThespaghettidetectivePlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin):

##~~ SettingsPlugin mixin

def get_settings_defaults(self):
return dict(
# put your plugin's default settings here
)

##~~ AssetPlugin mixin

def get_assets(self):
# Define your plugin's asset files to automatically include in the
# core UI here.
return dict(
js=["js/TheSpaghettiDetective.js"],
css=["css/TheSpaghettiDetective.css"],
less=["less/TheSpaghettiDetective.less"]
)

##~~ Softwareupdate hook

def get_update_information(self):
# Define the configuration for your plugin to use with the Software Update
# Plugin here. See https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update
# for details.
return dict(
TheSpaghettiDetective=dict(
displayName="Thespaghettidetective Plugin",
displayVersion=self._plugin_version,

# version check: github repository
type="github_release",
user="kennethjiang",
repo="TheSpaghettiDetective",
current=self._plugin_version,

# update method: pip
pip="https://github.com/kennethjiang/TheSpaghettiDetective/archive/{target_version}.zip"
)
)


# If you want your plugin to be registered within OctoPrint under a different name than what you defined in setup.py
# ("OctoPrint-PluginSkeleton"), you may define that here. Same goes for the other metadata derived from setup.py that
# can be overwritten via __plugin_xyz__ control properties. See the documentation for that.
__plugin_name__ = "Thespaghettidetective Plugin"

def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = ThespaghettidetectivePlugin()

global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* TODO: Have your plugin's CSS files generated to here. */
29 changes: 29 additions & 0 deletions octoprint_thespaghettidetective/static/js/TheSpaghettiDetective.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* View model for TheSpaghettiDetective
*
* Author: Kenneth Jiang
* License: AGPLv3
*/
$(function() {
function ThespaghettidetectiveViewModel(parameters) {
var self = this;

// assign the injected parameters, e.g.:
// self.loginStateViewModel = parameters[0];
// self.settingsViewModel = parameters[1];

// TODO: Implement your plugin's view model here.
}

/* view model class, parameters for constructor, container to bind to
* Please see http://docs.octoprint.org/en/master/plugins/viewmodels.html#registering-custom-viewmodels for more details
* and a full list of the available options.
*/
OCTOPRINT_VIEWMODELS.push({
construct: ThespaghettidetectiveViewModel,
// ViewModels your plugin depends on, e.g. loginStateViewModel, settingsViewModel, ...
dependencies: [ /* "loginStateViewModel", "settingsViewModel" */ ],
// Elements to bind to, e.g. #settings_plugin_TheSpaghettiDetective, #tab_plugin_TheSpaghettiDetective, ...
elements: [ /* ... */ ]
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO: Put your plugin's LESS here, have it generated to ../css.
1 change: 1 addition & 0 deletions octoprint_thespaghettidetective/templates/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put your plugin's Jinja2 templates here.
Loading

0 comments on commit 830a0c3

Please sign in to comment.