mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
lint and partially working
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import stripe, os, json
|
||||
import stripe, os
|
||||
from datetime import datetime
|
||||
from collections import OrderedDict
|
||||
import yaml
|
||||
|
||||
|
||||
class Orders():
|
||||
|
||||
def __init__(self, config):
|
||||
@@ -11,7 +11,6 @@ class Orders():
|
||||
stripe.api_key = os.environ['STRIPE_TOKEN']
|
||||
self.orders = []
|
||||
|
||||
|
||||
def fetch_orders(self):
|
||||
start_id = None
|
||||
after_open_date = True
|
||||
@@ -35,29 +34,27 @@ class Orders():
|
||||
|
||||
# pagination
|
||||
start_id = checkout['id']
|
||||
|
||||
|
||||
# put in date order
|
||||
self.orders.reverse()
|
||||
return self.orders
|
||||
|
||||
|
||||
def update_project_list(self):
|
||||
project_list = {}
|
||||
# first project is the filler test project
|
||||
index = 0
|
||||
project = { 'url': self.config['filler_project'], 'status': 'active', 'fill': False }
|
||||
project = {'url': self.config['filler_project'], 'status': 'active', 'fill': False}
|
||||
project_list[index] = project
|
||||
|
||||
# add all the real orders
|
||||
for index, order in enumerate(self.orders):
|
||||
project = { 'url': order['git_url'], 'status': 'active', 'fill': False }
|
||||
project = {'url': order['git_url'], 'status': 'active', 'fill': False}
|
||||
project_list[index + 1] = project
|
||||
|
||||
# fill with the filler
|
||||
for index in range(len(project_list), self.config['num_projects']):
|
||||
project = { 'url': self.config['filler_project'], 'status': 'active', 'fill': True }
|
||||
project = {'url': self.config['filler_project'], 'status': 'active', 'fill': True}
|
||||
project_list[index] = project
|
||||
|
||||
with open('projects.yaml', 'w') as fh:
|
||||
fh.write(yaml.dump(project_list, sort_keys=False))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user