Browse Source

Remove obsolete function buy_item()

Sebastian Pipping 9 years ago
parent
commit
e26563b946
2 changed files with 1 additions and 13 deletions
  1. 1
    1
      client-barcode/freitagslib/commands.py
  2. 0
    12
      client-barcode/freitagslib/network.py

+ 1
- 1
client-barcode/freitagslib/commands.py View File

@@ -53,7 +53,7 @@ class BuyCommand(object):
53 53
 			raise ValueError("BuyCommand in illegal state")
54 54
 
55 55
 	def run(self, user_name):
56
-		net.buy_item(self._item.id, what_about_it=self._what_to_buy(), user_name=user_name)
56
+		raise NotImplementedError('BuyCommand.run(user_name)')
57 57
 
58 58
 	def item_name(self):
59 59
 		return self._item.name

+ 0
- 12
client-barcode/freitagslib/network.py View File

@@ -71,16 +71,6 @@ def get_user_name_from_auth_blob(authblob):
71 71
 	return d['username']
72 72
 
73 73
 
74
-def buy_item(item_id, what_about_it, user_name):
75
-	require_type(int, item_id)
76
-	assert(what_about_it in (ITEM_ONLY, DEPOSIT_ONLY, ITEM_AND_DEPOSIT))
77
-
78
-	content = _request('buyable/item/' + urllib.quote(str(item_id)),
79
-			{'user':user_name, 'deposit':what_about_it, 'amount':1}, method='POST')
80
-	if content != 'Created':
81
-		raise ValueError('Server says "%s"' % content)
82
-
83
-
84 74
 def bulk_buy(buycommands, user_name):
85 75
 	item_ids = tuple(e.item_id() for e in buycommands if e.includes_commodity())
86 76
 	deposit_ids = tuple(e.item_id() for e in buycommands if e.includes_deposit())
@@ -131,8 +121,6 @@ if __name__ == '__main__':
131 121
 	user_name = get_user_name_from_auth_blob(os.environ['BARCODE_PLUGIN_TEST_AUTH_BLOB'])
132 122
 	print('User name: ' + user_name)
133 123
 
134
-	buy_item(1, True, user_name)
135
-
136 124
 	balance = get_balance(user_name)
137 125
 	print('Balance is %f, type is "%s"' % (balance, type(balance).__name__))
138 126
 

Loading…
Cancel
Save