Skip to content

Instantly share code, notes, and snippets.

View jobelenus's full-sized avatar

John Obelenus jobelenus

View GitHub Profile
@jobelenus
jobelenus / gist:7568669
Last active December 28, 2015 21:59
I don't get an exception from doing this... nor do I see the log file on the db server (which has facilities.conf set up)
import loghog, logging
LOGHOG_APP_NAME = 'lenspro-dev'
LOGHOG_HOST = '192.168.3.10'
LOGHOG_PORT = '5577'
LOGHOG_SSL = {
'pemfile': '/etc/loghogd/certs/lp-demo-web.pem',
'cacert': '/etc/loghogd/certs/lp-demo-db0-ca.cert'
}
h = loghog.LoghogHandler(LOGHOG_APP_NAME, host=LOGHOG_HOST, ssl_info=LOGHOG_SSL, port=LOGHOG_PORT, print_debug=True)
r = logging.LogRecord('foo', logging.WARN, '/', 'TESTING', None, None, None)
if num_days <= 3:
if order_is_shipping:
price = model.three_day_rate * qty
else:
price = model.four_day_rate * qty
elif num_days == 4:
price = model.four_day_rate * qty
elif num_days > 4:
days_amount = max(0, self._calculate_price_for_days(num_days-4, qty=qty, model=model))
price = (model.four_day_rate * qty) + days_amount
def main():
smugmug = auth()
c = get_csv_reader()
headers = c.next()
del headers
counter = 0
try:
for row in c:
print '.',
sys.stdout.flush()