Skip to content

Commit

Permalink
Merge pull request #164 from smartin015/cleanup_logs
Browse files Browse the repository at this point in the history
Remove print/console debugging lines
  • Loading branch information
smartin015 committed Nov 26, 2022
2 parents cabb56e + 5269bf1 commit 01e7ab0
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 16 deletions.
2 changes: 0 additions & 2 deletions continuousprint/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ def mv_job(self):
new_id = dq.import_job_from_view(sq.get_job_view(src_id))
except ValidationError as e:
return json.dumps(dict(error=str(e)))

print("Imported job from view")
sq.remove_jobs([src_id])
src_id = new_id

Expand Down
1 change: 1 addition & 0 deletions continuousprint/static/js/continuousprint_job.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ function CPJob(obj, peers, api, profile, materials) {
for (let i = 0; i < len.length; i++) {
mass += linmasses[i] * len[i];
}

if (!isNaN(mass)) {
r[2].remaining += rem * mass;
r[2].total += tot * mass;
Expand Down
1 change: 0 additions & 1 deletion continuousprint/static/js/continuousprint_set.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function data(count=3) {
function api() {
return {
update: (_, data, cb) => {
console.log(data.material);
cb({...data, id: 1, remaining: (data.count || 1), job_remaining: 2, materials: ((data.materials) ? data.materials.split(',') : [])})
},
};
Expand Down
2 changes: 0 additions & 2 deletions continuousprint/static/js/continuousprint_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ function CPSettingsViewModel(parameters, profiles=CP_PRINTER_PROFILES, default_s

let events = []
for (let k of custom_events) {
console.log(k);
let actions = [];
for (let a of result.events[k.event] || []) {
actions.push({
Expand All @@ -346,7 +345,6 @@ function CPSettingsViewModel(parameters, profiles=CP_PRINTER_PROFILES, default_s
});
}
events.sort((a, b) => a.display < b.display);
console.log("Events", events);
self.events(events);
self.scripts_fingerprint = JSON.stringify(result);
});
Expand Down
3 changes: 0 additions & 3 deletions continuousprint/static/js/continuousprint_settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ test('invalid model change is ignored', () => {
test('load queues and scripts on settings view shown', () => {
m = mocks();
m[2].get = function (typ, cb) {
console.log(typ);
if (typ === m[2].QUEUES) {
cb([
{name: "archive"},
Expand All @@ -146,7 +145,6 @@ test('load queues and scripts on settings view shown', () => {
test('dirty exit commits queues', () => {
let m = mocks();
m[2].get = function (typ, cb) {
console.log(typ);
if (typ === m[2].QUEUES) {
cb([]);
} else if (typ === m[2].AUTOMATION) {
Expand All @@ -166,7 +164,6 @@ test('dirty exit commits queues', () => {
test('non-dirty exit does not call commitQueues', () => {
let m = mocks();
m[2].get = function (typ, cb) {
console.log(typ);
if (typ === m[2].QUEUES) {
cb([]);
} else if (typ === m[2].AUTOMATION) {
Expand Down
2 changes: 0 additions & 2 deletions continuousprint/static/js/continuousprint_viewmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,9 @@ function CPViewModel(parameters) {
break;
case "setstate":
data = JSON.parse(data["state"]);
console.log("got setstate", data);
return self._setState(data);
case "sethistory":
data = JSON.parse(data["history"]);
console.log("got sethistory", data);
return self._setHistory(data);
default:
theme = "info";
Expand Down
6 changes: 0 additions & 6 deletions continuousprint/storage/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def _upsertSet(set_id, data, job):
"remaining",
):
v = min(int(v), MAX_COUNT)
print("setattr", k, v)
setattr(s, k, v)
s.job = job

Expand Down Expand Up @@ -228,8 +227,6 @@ def updateJob(job_id, data, queue=DEFAULT_QUEUE):
s["rank"] = float(i)
_upsertSet(s["id"], s, j)

print("updateJob() with ", data)

j.save()
return Job.get(id=job_id).as_dict()

Expand Down Expand Up @@ -284,9 +281,6 @@ def _moveImpl(src, dest_id, retried=False):
postRank = MAX_RANK
# Pick the target value as the midpoint between the two ranks
candidate = abs(postRank - destRank) / 2 + min(postRank, destRank)
# print(
# f"_moveImpl abs({postRank} - {destRank})/2 + min({postRank}, {destRank}) = {candidate}"
# )

# We may end up with an invalid candidate if we hit a singularity - in this case, rebalance all the
# rows and try again
Expand Down

0 comments on commit 01e7ab0

Please sign in to comment.