Skip to content
This repository has been archived by the owner. It is now read-only.

Add gold accounting script to be emailed monthly #53

Closed
wants to merge 1 commit into from

Conversation

@MelissaCole
Copy link
Contributor

MelissaCole commented Apr 30, 2015

馃憮 @umbrae

Email the data from the accounting script monthly. Will create a puppet PR and a private PR (g.accounting_email).

The original script:
https://gist.github.com/MelissaCole/eff526fc165891630fc1

user_creddits = get_creddit_balances_on(start_date)

output = cStringIO.StringIO()
output.write('"{}"'.format(

This comment has been minimized.

Copy link
@JordanMilne

JordanMilne Apr 30, 2015

Are you able to use writer = csv.writer(StringIO.StringIO(output)) here instead? Should give you much the same interface as csvfile. You might also have to use StringIO rather than cStringIO in that case as well, cStringIO really doesn't like unicode strings.

send_email(body, [{"name": filename, "contents": output.getvalue()}])


def send_email(body, attachment):

This comment has been minimized.

Copy link
@umbrae

umbrae Apr 30, 2015

nit: this should probably also be attachments just to make it clear it's a list.

@@ -0,0 +1,12 @@
description "email gold accounting csv monthly"

This comment has been minimized.

Copy link
@umbrae

umbrae Apr 30, 2015

Just a note that we'll also need a puppet pull request to make this run on some machine.

@umbrae
Copy link

umbrae commented Apr 30, 2015

馃拝 No real concerns, just one tiny thing! I went easy on reviewing the script itself for style/etc considering it's a script they've already been using successfully.

@MelissaCole
Copy link
Contributor Author

MelissaCole commented May 1, 2015

馃拠

@umbrae
Copy link

umbrae commented May 1, 2015

馃悷

This email will go out to accounting on the second day of each month with
the csv file attached with delicious data from the gold db.
@MelissaCole MelissaCole force-pushed the MelissaCole:master branch from a99691b to 9277702 May 1, 2015
@MelissaCole
Copy link
Contributor Author

MelissaCole commented Jun 4, 2015

@MelissaCole MelissaCole closed this Jun 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can鈥檛 perform that action at this time.