Skip to content

Commit 2144c03

Browse files
committed
Remove all pdb stuff.
1 parent e740c50 commit 2144c03

24 files changed

+0
-1032
lines changed

account/utils.py

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from account.conf import settings
1212

1313
def is_coop_worker(request):
14-
#import pdb; pdb.set_trace()
1514
answer = False
1615
agent = None
1716
try:
@@ -26,7 +25,6 @@ def is_coop_worker(request):
2625
def default_redirect(request, fallback_url, **kwargs):
2726
redirect_field_name = kwargs.get("redirect_field_name", "next")
2827
next = request.GET.get(redirect_field_name)
29-
#import pdb; pdb.set_trace()
3028
if is_coop_worker(request):
3129
next = settings.WORKER_LOGIN_REDIRECT_URL
3230
if not next:

account/views.py

-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def get(self, *args, **kwargs):
288288
return self.render_to_response(ctx)
289289

290290
def post(self, *args, **kwargs):
291-
#import pdb; pdb.set_trace()
292291
coop_worker = False
293292
if self.request.user.is_authenticated():
294293
user = self.request.user

fixCAs.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#import pdb; pdb.set_trace()
21
import sys
32
from valuenetwork.valueaccounting.models import *
43

holodex_script.py

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
a_file_path = os.path.join(SCRIPT_ROOT, "holodex", "dhen-data", "agents.csv")
2727
aa_file_path = os.path.join(SCRIPT_ROOT, "holodex", "dhen-data", "agentRelationships.csv")
2828

29-
#import pdb; pdb.set_trace()
3029
agent_types = AgentType.objects.all()
3130
with open(at_file_path, 'wb') as csvfile:
3231
w = csv.writer(csvfile, delimiter=',', quotechar="'", quoting=csv.QUOTE_ALL)
@@ -153,7 +152,6 @@
153152
154153
155154
def exchange_events_csv(request):
156-
#import pdb; pdb.set_trace()
157155
event_ids = request.GET.get("event-ids")
158156
response = HttpResponse(content_type='text/csv')
159157
response['Content-Disposition'] = 'attachment; filename=contributions.csv'

valuenetwork/api/views.py

-12
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def post_save(self, obj, created=False):
5656
"""
5757
On creation, replace the raw password with a hashed version.
5858
"""
59-
#import pdb; pdb.set_trace()
6059
if created:
6160
obj.set_password(obj.password)
6261
obj.save()
@@ -160,7 +159,6 @@ class ContributionViewSet(viewsets.ModelViewSet):
160159

161160
def get_queryset(self):
162161
queryset = EconomicEvent.objects.filter(is_contribution=True)
163-
#import pdb; pdb.set_trace()
164162
context_slug = self.request.QUERY_PARAMS.get('context', None)
165163
if context_slug is not None:
166164
queryset = queryset.filter(context_agent__slug=context_slug)
@@ -263,7 +261,6 @@ def agent_type_lod(request, agent_type_name):
263261
ats = AgentType.objects.all()
264262
agent_type = None
265263

266-
#import pdb; pdb.set_trace()
267264
for at in ats:
268265
if camelcase(at.name) == agent_type_name:
269266
agent_type = at
@@ -291,7 +288,6 @@ def agent_type_lod(request, agent_type_name):
291288
#}, context_instance=RequestContext(request))
292289

293290
def agent_relationship_type_lod(request, agent_assoc_type_name):
294-
#import pdb; pdb.set_trace()
295291
aats = AgentAssociationType.objects.all()
296292
agent_assoc_type = None
297293
for aat in aats:
@@ -432,7 +428,6 @@ def agent_lod(request, agent_id):
432428

433429
#following method supplied by Niklas at rdflib-jsonld support to get the desired output for nested rdf inputs for rdflib
434430
def simplyframe(data):
435-
#import pdb; pdb.set_trace()
436431
items, refs = {}, {}
437432
for item in data['@graph']:
438433
itemid = item.get('@id')
@@ -443,7 +438,6 @@ def simplyframe(data):
443438
if isinstance(v, dict):
444439
refid = v.get('@id')
445440
if refid and refid.startswith('_:'):
446-
#import pdb; pdb.set_trace()
447441
refs.setdefault(refid, (v, []))[1].append(item)
448442
for ref, subjects in refs.values():
449443
if len(subjects) == 1:
@@ -460,7 +454,6 @@ def agent_jsonld(request):
460454
path, instance_abbrv, context, store, vf_ns = get_lod_setup_items()
461455

462456
agent_types = AgentType.objects.all()
463-
#import pdb; pdb.set_trace()
464457
for at in agent_types:
465458
#if at.name != "Person" and at.name != "Organization" and at.name != "Group" and at.name != "Individual":
466459
if at.name != "Person" and at.name != "Group" and at.name != "Individual":
@@ -475,7 +468,6 @@ def agent_jsonld(request):
475468
store.add((ref, RDFS.subClassOf, vf_ns.Group))
476469

477470
aa_types = AgentAssociationType.objects.all()
478-
#import pdb; pdb.set_trace()
479471
for aat in aa_types:
480472
property_name = camelcase_lower(aat.label)
481473
inverse_property_name = camelcase_lower(aat.inverse_label)
@@ -492,7 +484,6 @@ def agent_jsonld(request):
492484
store.add((ref, OWL.inverseOf, inv_ref))
493485
store.add((inv_ref, OWL.inverseOf, ref))
494486

495-
#import pdb; pdb.set_trace()
496487
associations = AgentAssociation.objects.filter(state="active")
497488
agents = [assn.is_associate for assn in associations]
498489
agents.extend([assn.has_associate for assn in associations])
@@ -533,7 +524,6 @@ def agent_jsonld(request):
533524
store.add((inv_ref, vf_ns["relationship"], inv_ref_relationship))
534525

535526
ser = store.serialize(format='json-ld', context=context, indent=4)
536-
#import pdb; pdb.set_trace()
537527
#import json
538528
#data = json.loads(ser)
539529
#simplyframe(data)
@@ -543,7 +533,6 @@ def agent_jsonld(request):
543533
def agent_jsonld_query(request):
544534

545535

546-
#import pdb; pdb.set_trace()
547536
g = Graph()
548537
url = "http://nrp.webfactional.com/api/agent-jsonld/"
549538
remote_jsonld = urlopen(url).read()
@@ -555,7 +544,6 @@ def agent_jsonld_query(request):
555544
local_expanded_json = g.serialize(format="json-ld", indent=4)
556545
local_expanded_dict = simplejson.loads(local_expanded_json)
557546

558-
#import pdb; pdb.set_trace()
559547

560548
result = ""
561549
agents = [x for x in graph if x['@id'].find('agent-lod') > -1]

valuenetwork/board/forms.py

-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class FilterForm(forms.Form):
2525

2626
def __init__(self, pattern=None, *args, **kwargs):
2727
super(FilterForm, self).__init__(*args, **kwargs)
28-
#import pdb; pdb.set_trace()
2928
if pattern:
3029
self.pattern = pattern
3130
et = EventType.objects.get(name="Transfer")
@@ -57,7 +56,6 @@ class TransferFlowForm(forms.Form):
5756

5857
def __init__(self, assoc_type_identifier=None, context_agent=None, qty_help=None, *args, **kwargs):
5958
super(TransferFlowForm, self).__init__(*args, **kwargs)
60-
#import pdb; pdb.set_trace()
6159
if context_agent and assoc_type_identifier:
6260
self.fields["to_agent"].queryset = context_agent.all_has_associates_by_type(assoc_type_identifier=assoc_type_identifier)
6361
if qty_help:
@@ -89,7 +87,6 @@ class ExchangeFlowForm(forms.Form):
8987

9088
def __init__(self, assoc_type_identifier=None, context_agent=None, qty_help=None, *args, **kwargs):
9189
super(ExchangeFlowForm, self).__init__(*args, **kwargs)
92-
#import pdb; pdb.set_trace()
9390
if context_agent and assoc_type_identifier:
9491
self.fields["to_agent"].queryset = context_agent.all_has_associates_by_type(assoc_type_identifier=assoc_type_identifier)
9592
if qty_help:
@@ -163,7 +160,6 @@ class Meta:
163160

164161
def __init__(self, exchange_type=None, context_agent=None, *args, **kwargs):
165162
super(AvailableForm, self).__init__(*args, **kwargs)
166-
#import pdb; pdb.set_trace()
167163
if exchange_type:
168164
tt = exchange_type.transfer_types_non_reciprocal()[0]
169165
self.fields["resource_type"].queryset = tt.get_resource_types()
@@ -200,7 +196,6 @@ class CombineResourcesForm(forms.Form):
200196

201197
def __init__(self, stage=None, resource_type=None, *args, **kwargs):
202198
super(CombineResourcesForm, self).__init__(*args, **kwargs)
203-
#import pdb; pdb.set_trace()
204199
if resource_type and stage:
205200
self.fields["resources"].queryset = resource_type.onhand_for_exchange_stage(stage=stage)
206201

@@ -249,7 +244,6 @@ class ReceiveForm(forms.Form):
249244

250245
def __init__(self, exchange_type=None, context_agent=None, *args, **kwargs):
251246
super(ReceiveForm, self).__init__(*args, **kwargs)
252-
#import pdb; pdb.set_trace()
253247
if exchange_type:
254248
tt = exchange_type.transfer_types_non_reciprocal()[0]
255249
self.fields["resource_type"].queryset = tt.get_resource_types()

valuenetwork/board/views.py

-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def default_context_agent():
2626

2727
#todo: a lot of this can be configured instead of hard-coded
2828
def dhen_board(request, context_agent_id=None):
29-
#import pdb; pdb.set_trace()
3029
agent = get_agent(request)
3130
pattern = ProcessPattern.objects.get(name="Herbs")
3231
selected_resource_type = None
@@ -86,7 +85,6 @@ def dhen_board(request, context_agent_id=None):
8685
@login_required
8786
def add_available(request, context_agent_id):
8887
if request.method == "POST":
89-
#import pdb; pdb.set_trace()
9088
context_agent = EconomicAgent.objects.get(id=context_agent_id)
9189
form = AvailableForm(data=request.POST, prefix="AVL")
9290
if form.is_valid():
@@ -106,7 +104,6 @@ def add_available(request, context_agent_id):
106104
@login_required
107105
def receive_directly(request, context_agent_id):
108106
if request.method == "POST":
109-
#import pdb; pdb.set_trace()
110107
context_agent = EconomicAgent.objects.get(id=context_agent_id)
111108
stage = ExchangeType.objects.get(name="Harvester to Drying Site")
112109
exchange_type = ExchangeType.objects.get(name="Purchase to Drying Site") #todo: odd to have stage different....
@@ -266,7 +263,6 @@ def get_next_stage(exchange_type=None):
266263
@login_required
267264
def purchase_resource(request, context_agent_id, commitment_id): #this is the farm > harvester > drying site, confusing name
268265
if request.method == "POST":
269-
#import pdb; pdb.set_trace()
270266
commitment = get_object_or_404(Commitment, id=commitment_id)
271267
context_agent = EconomicAgent.objects.get(id=context_agent_id)
272268
stage = None
@@ -278,7 +274,6 @@ def purchase_resource(request, context_agent_id, commitment_id): #this is the fa
278274
zero_form = ZeroOutForm(prefix=prefix, data=request.POST)
279275

280276
if zero_form.is_valid():
281-
#import pdb; pdb.set_trace()
282277
zero_data = zero_form.cleaned_data
283278
zero_out = zero_data["zero_out"]
284279
if zero_out == True:
@@ -310,7 +305,6 @@ def purchase_resource(request, context_agent_id, commitment_id): #this is the fa
310305
formset = create_exchange_formset(prefix=prefix, data=request.POST, context_agent=context_agent, assoc_type_identifier="Harvester")
311306
quantity = 0
312307
ces = []
313-
#import pdb; pdb.set_trace()
314308
for form_ee in formset.forms:
315309
if form_ee.is_valid():
316310
data_ee = form_ee.cleaned_data
@@ -624,7 +618,6 @@ def purchase_resource(request, context_agent_id, commitment_id): #this is the fa
624618
@login_required
625619
def transfer_resource(request, context_agent_id, resource_id): #this is drying site to seller
626620
if request.method == "POST":
627-
#import pdb; pdb.set_trace()
628621
resource = get_object_or_404(EconomicResource, id=resource_id)
629622
context_agent = EconomicAgent.objects.get(id=context_agent_id)
630623
stage = ExchangeType.objects.get(name="Harvester to Drying Site")
@@ -648,7 +641,6 @@ def transfer_resource(request, context_agent_id, resource_id): #this is drying s
648641
give_et = EventType.objects.get(name="Give")
649642
receive_et = EventType.objects.get(name="Receive")
650643
pay_rt = EconomicResourceType.objects.filter(unit__unit_type="value")[0]
651-
#import pdb; pdb.set_trace()
652644

653645
xfer_exchange = Exchange(
654646
name="Transfer " + resource.resource_type.name,
@@ -792,7 +784,6 @@ def transfer_resource(request, context_agent_id, resource_id): #this is drying s
792784

793785
def combine_resources(request, context_agent_id, resource_type_id):
794786
if request.method == "POST":
795-
#import pdb; pdb.set_trace()
796787
resource_type = get_object_or_404(EconomicResourceType, id=resource_type_id)
797788
context_agent = EconomicAgent.objects.get(id=context_agent_id)
798789
stage = ExchangeType.objects.get(name="Drying Site to Seller") #actually the stage here should be the process stage, and the rest should handle that
@@ -911,7 +902,6 @@ def delete_farm_commitment(request, commitment_id):
911902
def undo_col2(request, resource_id):
912903
resource = get_object_or_404(EconomicResource, pk=resource_id)
913904
context_agent_id = default_context_agent().id
914-
#import pdb; pdb.set_trace()
915905
flows = resource.incoming_value_flows()
916906
for item in flows:
917907
if item.class_label() == "Economic Event":
@@ -928,7 +918,6 @@ def undo_col2(request, resource_id):
928918
def undo_col3(request, resource_id):
929919
resource = get_object_or_404(EconomicResource, pk=resource_id)
930920
context_agent_id = default_context_agent().id
931-
#import pdb; pdb.set_trace()
932921
flows = resource.incoming_value_flows()
933922
#todo: I'm not sure how to delete the right rows without going too far back in the chain......
934923
#for item in flows:

valuenetwork/equipment/forms.py

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class Meta:
4444

4545
def __init__(self, equip_resource=None, context_agent=None,tech_type=None, *args, **kwargs):
4646
super(EquipmentUseForm, self).__init__(*args, **kwargs)
47-
#import pdb; pdb.set_trace()
4847
#self.fields["process"].queryset = Process.objects.current()
4948
if equip_resource:
5049
self.fields["technician"].queryset = equip_resource.related_agents(role=tech_type)

valuenetwork/equipment/views.py

-11
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
4141
sale_pattern_id, equip_svc_rt_id, equip_fee_rt_id, tech_rt_id, consumable_rt_id,
4242
payment_rt_id, tech_rel_id, ve_id, va_id, price_id, part_rt_id, cite_rt_id
4343
):
44-
#import pdb; pdb.set_trace()
4544
#scenario: 1=commercial, 2=project, 3=fablab, 4=techshop, 5=other
4645
equipment = get_object_or_404(EconomicResource, id=equip_resource_id)
4746
equipment_svc_rt = get_object_or_404(EconomicResourceType, id=equip_svc_rt_id)
@@ -62,7 +61,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
6261
process_form = ProcessForm(data=request.POST or None)
6362

6463
if request.method == "POST":
65-
#import pdb; pdb.set_trace()
6664
if equip_form.is_valid():
6765
data = equip_form.cleaned_data
6866
input_date = data["event_date"]
@@ -139,7 +137,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
139137
)
140138
tech_event.save()
141139
total_price += tech_event.value
142-
#import pdb; pdb.set_trace()
143140
if scenario == '3' or scenario == '4': #fablab, techshop
144141
use_event = EconomicEvent(
145142
event_type = et_use,
@@ -189,7 +186,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
189186
output_event.value = total_value
190187
output_event.save()
191188

192-
#import pdb; pdb.set_trace()
193189
if scenario == '2' and next_process:
194190
cust = next_process.context_agent
195191
else:
@@ -258,7 +254,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
258254
printer_service.quantity = 0
259255
printer_service.save()
260256

261-
#import pdb; pdb.set_trace()
262257
if scenario == '1':
263258
next_process = Process(
264259
name="Make commercial 3D printed part",
@@ -328,7 +323,6 @@ def log_equipment_use(request, scenario, equip_resource_id, context_agent_id, pa
328323
)
329324
svc_input_event.save()
330325

331-
#import pdb; pdb.set_trace()
332326
if next_process:
333327
return HttpResponseRedirect('/%s/%s/%s/%s/%s/%s/%s/%s/%s/%s/%s/%s/'
334328
% ('equipment/pay-equipment-use', scenario, sale.id, process.id, payment_rt_id, equip_resource_id, mtnce_fee_event.id, ve_id, quantity, who.id, next_process.id, int(cite_rt_id)))
@@ -350,7 +344,6 @@ def pay_equipment_use(request, scenario, sale_id, process_id, payment_rt_id, equ
350344
mtnce_fee_event_id, ve_id, use_qty, who_id, next_process_id=None, cite_rt_id=None
351345
):
352346
#scenario: 1=commercial, 2=project, 3=fablab, 4=techshop, 5=other
353-
#import pdb; pdb.set_trace()
354347
sale = get_object_or_404(Exchange, id=sale_id)
355348
process = get_object_or_404(Process, id=process_id)
356349
payment_rt = EconomicResourceType.objects.get(id=payment_rt_id)
@@ -374,7 +367,6 @@ def pay_equipment_use(request, scenario, sale_id, process_id, payment_rt_id, equ
374367
pay_form = PaymentForm(data=request.POST or None)
375368

376369
if request.method == "POST":
377-
#import pdb; pdb.set_trace()
378370
if pay_form.is_valid():
379371
data = pay_form.cleaned_data
380372
payment_method = data["payment_method"]
@@ -416,7 +408,6 @@ def pay_equipment_use(request, scenario, sale_id, process_id, payment_rt_id, equ
416408
serialized_filters = {}
417409
dist_shipment = ship_events[0]
418410
buckets = ve.buckets.all()
419-
#import pdb; pdb.set_trace()
420411
for bucket in buckets:
421412
if bucket.filter_method:
422413
#'{"shipments": [4836], "method": "Shipment"}'}
@@ -461,7 +452,6 @@ def pay_equipment_use(request, scenario, sale_id, process_id, payment_rt_id, equ
461452

462453
@login_required
463454
def log_additional_inputs(request, cite_rt_id, process_id):
464-
#import pdb; pdb.set_trace()
465455
process = get_object_or_404(Process, id=process_id)
466456
cite_rt = EconomicResourceType.objects.get(id=cite_rt_id)
467457
cite_unit = cite_rt.unit_of_use
@@ -470,7 +460,6 @@ def log_additional_inputs(request, cite_rt_id, process_id):
470460
done = None
471461

472462
if request.method == "POST":
473-
#import pdb; pdb.set_trace()
474463
cite = request.POST.get("cite")
475464
work = request.POST.get("work")
476465
done = request.POST.get("done")

valuenetwork/valueaccounting/faircoin_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def init_electrum_fair():
1010
#obsolete
1111
"""
1212
def create_address_for_agent(agent):
13-
#import pdb; pdb.set_trace()
1413
init_electrum_fair()
1514
wallet = efn.wallet
1615
address = None

0 commit comments

Comments
 (0)