Skip to content

Commit a5e4ddc

Browse files
committed
a bunch of naming change. not working yet
1 parent 7d95f57 commit a5e4ddc

17 files changed

+171
-56
lines changed

.vscode/.ropeproject/config.py

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# The default ``config.py``
2+
# flake8: noqa
3+
4+
5+
def set_prefs(prefs):
6+
"""This function is called before opening the project"""
7+
8+
# Specify which files and folders to ignore in the project.
9+
# Changes to ignored resources are not added to the history and
10+
# VCSs. Also they are not returned in `Project.get_files()`.
11+
# Note that ``?`` and ``*`` match all characters but slashes.
12+
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
13+
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
14+
# '.svn': matches 'pkg/.svn' and all of its children
15+
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
16+
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
17+
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
18+
'.hg', '.svn', '_svn', '.git', '.tox']
19+
20+
# Specifies which files should be considered python files. It is
21+
# useful when you have scripts inside your project. Only files
22+
# ending with ``.py`` are considered to be python files by
23+
# default.
24+
# prefs['python_files'] = ['*.py']
25+
26+
# Custom source folders: By default rope searches the project
27+
# for finding source folders (folders that should be searched
28+
# for finding modules). You can add paths to that list. Note
29+
# that rope guesses project source folders correctly most of the
30+
# time; use this if you have any problems.
31+
# The folders should be relative to project root and use '/' for
32+
# separating folders regardless of the platform rope is running on.
33+
# 'src/my_source_folder' for instance.
34+
# prefs.add('source_folders', 'src')
35+
36+
# You can extend python path for looking up modules
37+
# prefs.add('python_path', '~/python/')
38+
39+
# Should rope save object information or not.
40+
prefs['save_objectdb'] = True
41+
prefs['compress_objectdb'] = False
42+
43+
# If `True`, rope analyzes each module when it is being saved.
44+
prefs['automatic_soa'] = True
45+
# The depth of calls to follow in static object analysis
46+
prefs['soa_followed_calls'] = 0
47+
48+
# If `False` when running modules or unit tests "dynamic object
49+
# analysis" is turned off. This makes them much faster.
50+
prefs['perform_doa'] = True
51+
52+
# Rope can check the validity of its object DB when running.
53+
prefs['validate_objectdb'] = True
54+
55+
# How many undos to hold?
56+
prefs['max_history_items'] = 32
57+
58+
# Shows whether to save history across sessions.
59+
prefs['save_history'] = True
60+
prefs['compress_history'] = False
61+
62+
# Set the number spaces used for indenting. According to
63+
# :PEP:`8`, it is best to use 4 spaces. Since most of rope's
64+
# unit-tests use 4 spaces it is more reliable, too.
65+
prefs['indent_size'] = 4
66+
67+
# Builtin and c-extension modules that are allowed to be imported
68+
# and inspected by rope.
69+
prefs['extension_modules'] = []
70+
71+
# Add all standard c-extensions to extension_modules list.
72+
prefs['import_dynload_stdmods'] = True
73+
74+
# If `True` modules with syntax errors are considered to be empty.
75+
# The default value is `False`; When `False` syntax errors raise
76+
# `rope.base.exceptions.ModuleSyntaxError` exception.
77+
prefs['ignore_syntax_errors'] = False
78+
79+
# If `True`, rope ignores unresolvable imports. Otherwise, they
80+
# appear in the importing namespace.
81+
prefs['ignore_bad_imports'] = False
82+
83+
# If `True`, rope will insert new module imports as
84+
# `from <package> import <module>` by default.
85+
prefs['prefer_module_from_imports'] = False
86+
87+
# If `True`, rope will transform a comma list of imports into
88+
# multiple separate import statements when organizing
89+
# imports.
90+
prefs['split_imports'] = False
91+
92+
# If `True`, rope will remove all top-level import statements and
93+
# reinsert them at the top of the module when making changes.
94+
prefs['pull_imports_to_top'] = True
95+
96+
# If `True`, rope will sort imports alphabetically by module name instead
97+
# of alphabetically by import statement, with from imports after normal
98+
# imports.
99+
prefs['sort_imports_alphabetically'] = False
100+
101+
# Location of implementation of
102+
# rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general
103+
# case, you don't have to change this value, unless you're an rope expert.
104+
# Change this value to inject you own implementations of interfaces
105+
# listed in module rope.base.oi.type_hinting.providers.interfaces
106+
# For example, you can add you own providers for Django Models, or disable
107+
# the search type-hinting in a class hierarchy, etc.
108+
prefs['type_hinting_factory'] = (
109+
'rope.base.oi.type_hinting.factory.default_type_hinting_factory')
110+
111+
112+
def project_opened(project):
113+
"""This function is called after opening the project"""
114+
# Do whatever you like here!

.vscode/.ropeproject/objectdb

246 Bytes
Binary file not shown.

MANIFEST.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include README.md
2-
recursive-include octoprint_thespaghettidetective_beta/templates *
3-
recursive-include octoprint_thespaghettidetective_beta/translations *
4-
recursive-include octoprint_thespaghettidetective_beta/static *
2+
recursive-include octoprint_thespaghettidetective/templates *
3+
recursive-include octoprint_thespaghettidetective/translations *
4+
recursive-include octoprint_thespaghettidetective/static *

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[The Spaghetti Detective](https://www.thespaghettidetective.com) is a Machine Learning-based algorithm to automatically detects 3D print failures, send you alerts, and let you cancel prints from anywhere.
44

5-
This plugin requires The Spaghetti Detective server to work. You can grab the server source code from [The Spaghetti Detective server github repo](https://github.com/TheSpaghettiDetective/TheSpaghettiDetective) and get it up and running. If you don't want the hassle of setting up and running your own server, you can [sign up a The Spaghetti Detective cloud account](https://www.thespaghettidetective.com/accounts/signup/). It's FREE during beta testing period.
5+
This plugin requires The Spaghetti Detective server to work. You can grab the server source code from [The Spaghetti Detective server github repo](https://github.com/TheSpaghettiDetective/TheSpaghettiDetective) and get it up and running. If you don't want the hassle of setting up and running your own server, you can [sign up a The Spaghetti Detective cloud account](https://www.thespaghettidetective.com/accounts/signup/).
66

77
## Setup
88

gulpfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ var less = require('gulp-less');
33
var sourcemaps = require('gulp-sourcemaps');
44

55
gulp.task('less', function() {
6-
return gulp.src('octoprint_thespaghettidetective_beta/static/less/**/*.less') // Gets all files ending with .scss in app/scss and children dirs
6+
return gulp.src('octoprint_thespaghettidetective/static/less/**/*.less') // Gets all files ending with .scss in app/scss and children dirs
77
.pipe(sourcemaps.init())
88
.pipe(less())
99
.pipe(sourcemaps.write())
10-
.pipe(gulp.dest('octoprint_thespaghettidetective_beta/static/css'));
10+
.pipe(gulp.dest('octoprint_thespaghettidetective/static/css'));
1111
});
1212

1313
gulp.task('watch', function() {
14-
gulp.watch('octoprint_thespaghettidetective_beta/static/less/**/*.less', gulp.series('less'));
14+
gulp.watch('octoprint_thespaghettidetective/static/less/**/*.less', gulp.series('less'));
1515
});

octoprint_thespaghettidetective/__init__.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import octoprint.plugin
3030

31-
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective_beta')
31+
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective')
3232

3333
POST_PIC_INTERVAL_SECONDS = 10.0
3434
POST_STATUS_INTERVAL_SECONDS = 15.0
@@ -59,16 +59,17 @@ def __init__(self):
5959
##~~ Wizard plugin mix
6060

6161
def is_wizard_required(self):
62-
alpha_settings = self._settings.effective.get('plugins', {}).get('thespaghettidetective')
63-
if alpha_settings: # Alpha testers
64-
alpha_migrated = os.path.join(self.get_plugin_data_folder(), '.alpah_migrated')
65-
if not os.path.isfile(alpha_migrated):
66-
with open(alpha_migrated, 'a'): # touch alpha_migrated
62+
import ipdb; ipdb.set_trace()
63+
beta_settings = self._settings.effective.get('plugins', {}).get('thespaghettidetective_beta')
64+
if beta_settings: # Beta testers
65+
beta_migrated = os.path.join(self.get_plugin_data_folder(), '.beta_migrated')
66+
if not os.path.isfile(beta_migrated):
67+
with open(beta_migrated, 'a'): # touch alpha_migrated
6768
pass
68-
if alpha_settings.get('auth_token'):
69-
self._settings.set(["auth_token"],alpha_settings.get('auth_token'), force=True)
70-
if alpha_settings.get('endpoint_prefix'):
71-
self._settings.set(["endpoint_prefix"],alpha_settings.get('endpoint_prefix'), force=True)
69+
if beta_settings.get('auth_token'):
70+
self._settings.set(["auth_token"],beta_settings.get('auth_token'), force=True)
71+
if beta_settings.get('endpoint_prefix'):
72+
self._settings.set(["endpoint_prefix"],beta_settings.get('endpoint_prefix'), force=True)
7273
self._settings.save(force=True)
7374

7475
return not self._settings.get(["auth_token"])
@@ -108,8 +109,8 @@ def get_update_information(self):
108109
# Plugin here. See https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update
109110
# for details.
110111
return dict(
111-
TheSpaghettiDetectiveBeta=dict(
112-
displayName="TheSpaghettiDetective Plugin (Beta)",
112+
TheSpaghettiDetective=dict(
113+
displayName="TheSpaghettiDetective Plugin",
113114
displayVersion=self._plugin_version,
114115

115116
# version check: github repository
@@ -336,7 +337,7 @@ def wait_for_auth_token(self):
336337
# If you want your plugin to be registered within OctoPrint under a different name than what you defined in setup.py
337338
# ("OctoPrint-PluginSkeleton"), you may define that here. Same goes for the other metadata derived from setup.py that
338339
# can be overwritten via __plugin_xyz__ control properties. See the documentation for that.
339-
__plugin_name__ = "The Spaghetti Detective (Beta)"
340+
__plugin_name__ = "The Spaghetti Detective"
340341
__plugin_author__ = "The Spaghetti Detective Team"
341342
__plugin_url__ = "https://thespaghettidetective.com"
342343
__plugin_description__ = "AI-based open source project for 3D printing failure detection."

octoprint_thespaghettidetective/commander.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import re
44

5-
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective_beta')
5+
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective')
66

77
class Commander:
88

octoprint_thespaghettidetective/print_event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import time
33

4-
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective_beta')
4+
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective')
55

66
class PrintEventTracker:
77

octoprint_thespaghettidetective/static/css/TheSpaghettiDetective.css

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

octoprint_thespaghettidetective/static/js/TheSpaghettiDetective.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
$(function() {
88
function testAuthToken(token, container) {
9-
$.ajax("/api/plugin/thespaghettidetective_beta", {
9+
$.ajax("/api/plugin/thespaghettidetective", {
1010
method: "POST",
1111
contentType: "application/json",
1212
data: JSON.stringify({
@@ -66,7 +66,7 @@ $(function() {
6666
}
6767
};
6868

69-
function ThespaghettidetectiveBetaViewModel(parameters) {
69+
function ThespaghettidetectiveViewModel(parameters) {
7070
var self = this;
7171

7272
// assign the injected parameters, e.g.:
@@ -78,7 +78,7 @@ $(function() {
7878
self.hasShownWebcamError = false;
7979

8080
self.onDataUpdaterPluginMessage = function(plugin, data) {
81-
if (plugin != "thespaghettidetective_beta") {
81+
if (plugin != "thespaghettidetective") {
8282
return;
8383
}
8484

@@ -140,7 +140,7 @@ $(function() {
140140
};
141141

142142
self.showTrackerModal = function() {
143-
$.ajax("/api/plugin/thespaghettidetective_beta", {
143+
$.ajax("/api/plugin/thespaghettidetective", {
144144
method: "POST",
145145
contentType: "application/json",
146146
data: JSON.stringify({
@@ -204,13 +204,13 @@ $(function() {
204204
* and a full list of the available options.
205205
*/
206206
OCTOPRINT_VIEWMODELS.push({
207-
construct: ThespaghettidetectiveBetaViewModel,
207+
construct: ThespaghettidetectiveViewModel,
208208
// ViewModels your plugin depends on, e.g. loginStateViewModel, settingsViewModel, ...
209209
dependencies: ["settingsViewModel"],
210210
// Elements to bind to, e.g. #settings_plugin_thespaghettidetective, #tab_plugin_thespaghettidetective, ...
211211
elements: [
212-
"#wizard_plugin_thespaghettidetective_beta",
213-
"#settings_plugin_thespaghettidetective_beta"
212+
"#wizard_plugin_thespaghettidetective",
213+
"#settings_plugin_thespaghettidetective"
214214
]
215215
});
216216
});

octoprint_thespaghettidetective/static/less/TheSpaghettiDetective.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TODO: Put your plugin's LESS here, have it generated to ../css.
2-
div[id$=_plugin_thespaghettidetective_beta] {
2+
div[id$=_plugin_thespaghettidetective] {
33
.header {
44
margin-bottom: 32px;
55

octoprint_thespaghettidetective/templates/thespaghettidetective_settings.jinja2

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="header">
2-
<img class="logo pull-left" src="/plugin/thespaghettidetective_beta/static/img/logo-square.png" /> <h3>The Spaghetti Detective (Beta)</h3>
2+
<img class="logo pull-left" src="/plugin/thespaghettidetective/static/img/logo-square.png" /> <h3>The Spaghetti Detective (Beta)</h3>
33
<p><a href="https://thespaghettidetective.com/" target="_blank">The Spaghetti Detective</a> is an AI-based <strong>open source project</strong> for 3D printing failure detection.</p>
44
</div>
55
<h4>Step 1: <a href="https://app.thespaghettidetective.com/accounts/signup/" target="_blank">Sign up</a> a beta testing account.</h4>
@@ -8,9 +8,9 @@
88
<div>Secret token is the key that makes sure only you can access data in your account, not anyone else.</div>
99
<h4>Step 3: Copy the secret token to the box below.</h4>
1010
<form class="form-horizontal">
11-
<div>If you have problem locating the secret token, click <a data-bind="attr: { href: settingsViewModel.settings.plugins.thespaghettidetective_beta.endpoint_prefix() + '/printer_auth_token/0/' }" target="_blank">here</a>.</div>
11+
<div>If you have problem locating the secret token, click <a data-bind="attr: { href: settingsViewModel.settings.plugins.thespaghettidetective.endpoint_prefix() + '/printer_auth_token/0/' }" target="_blank">here</a>.</div>
1212
<div class="input-append token-input">
13-
<input type="text" class="input-block-level auth-token-input" data-bind="value: settingsViewModel.settings.plugins.thespaghettidetective_beta.auth_token">
13+
<input type="text" class="input-block-level auth-token-input" data-bind="value: settingsViewModel.settings.plugins.thespaghettidetective.auth_token">
1414
<button class="btn test-auth-token" type="button"><i class="fa fa-spinner fa-spin" style="display: none;"></i> Test</button>
1515
</div>
1616
<div class="std-api-status">&nbsp; </div>
@@ -21,7 +21,7 @@
2121
<p>If you feel adventurous, head to <a href="https://github.com/TheSpaghettiDetective/TheSpaghettiDetective">our source code</a> and set up your own server. Then enter your Server Address below:</p>
2222
<label class="control-label">{{ _('Server Address') }}</label>
2323
<div class="controls">
24-
<input type="text" class="input-block-level endpoint-prefix" disabled data-bind="value: settingsViewModel.settings.plugins.thespaghettidetective_beta.endpoint_prefix">
24+
<input type="text" class="input-block-level endpoint-prefix" disabled data-bind="value: settingsViewModel.settings.plugins.thespaghettidetective.endpoint_prefix">
2525
<div class="form-check" style="margin-top: 8px;">
2626
<input class="form-check-input custom-server" type="checkbox" value="" style="margin-top: 0px;">
2727
<label class="form-check-label" for="custom-server" style="display: inline">
@@ -34,7 +34,7 @@
3434
<div class="control-group">
3535
<div class="controls">
3636
<div class="form-check" style="margin-top: 8px;">
37-
<input class="form-check-input custom-server" type="checkbox" data-bind="checked: settingsViewModel.settings.plugins.thespaghettidetective_beta.disable_video_streaming" style="margin-top: 0px;">
37+
<input class="form-check-input custom-server" type="checkbox" data-bind="checked: settingsViewModel.settings.plugins.thespaghettidetective.disable_video_streaming" style="margin-top: 0px;">
3838
<label class="form-check-label" for="custom-server" style="display: inline">
3939
Disable webcam streaming (<a href="https://www.thespaghettidetective.com/docs/webcam-feed-is-laggy/">Why would I want to do that?</a>). <span style="color: red">Restart required.</span>
4040
</label>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends "thespaghettidetective_beta_settings.jinja2" %}
1+
{% extends "thespaghettidetective_settings.jinja2" %}

octoprint_thespaghettidetective/webcam_capture.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import requests
1313
import backoff
1414

15-
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective_beta')
15+
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective')
1616

1717
@backoff.on_exception(backoff.expo, Exception, max_tries=6)
1818
@backoff.on_predicate(backoff.expo, max_tries=6)

octoprint_thespaghettidetective/webcam_stream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from .ws import WebSocketClient
2525
from webcam_capture import capture_jpeg
2626

27-
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective_beta')
27+
_logger = logging.getLogger('octoprint.plugins.thespaghettidetective')
2828

2929
CAM_EXCLUSIVE_USE = os.path.join(tempfile.gettempdir(), '.using_picam')
3030
FFMPEG = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'bin', 'ffmpeg')

0 commit comments

Comments
 (0)