Skip to content

Instantly share code, notes, and snippets.

View moylop260's full-sized avatar

Moisés López - https://www.vauxoo.com/ moylop260

View GitHub Profile
import datetime
import pyotp
import qrcode
class TotpAuth:
def __init__(self, secret=None):
if secret is None:
secret = pyotp.random_base32()
#migrate to "https://github.com/vauxoo-dev/gist-vauxoo"
'''
#!/usr/bin/env python
# coding: utf-8
import sys
import os
import subprocess
import uuid
import ConfigParser
import launchpad
#moved to https://github.com/vauxoo-dev/gist-vauxoo/blob/master/check_print_and_pdb.py
'''
import ast
import sys
"""
This script check py file for no get "print" or "pdb" sentence.
"""
#file name of file py to check
import os
path = '.'
for dirname, dirnames, filenames in os.walk(path):
# print path to all filenames with extension py.
for filename in filenames:
fname_path = os.path.join(dirname, filename)
fext = os.path.splitext(fname_path)[1]
if fext == '.py':
print fname_path
2014-08-19 20:30:07,569 21493 INFO 15219-4-7-0-op-all openerp.modules.loading: module l10n_in_hr_payroll: loading test/payment_advice.yml
2014-08-19 20:30:07,593 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: In order to test Payment Advice I create a new Payment Advice
2014-08-19 20:30:07,593 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: I create a new Payment Advice with NEFT Transaction Enable
2014-08-19 20:30:07,682 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: I check that the Payment Advice is in "Draft"
2014-08-19 20:30:07,684 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: Now I confirm Payment Advice
2014-08-19 20:30:07,701 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: I check that the Payment Advice state is "Confirmed"
2014-08-19 20:30:07,703 21493 TEST 15219-4-7-0-op-all openerp.tools.yaml_import: In order to test the PDF report defined on a Payment Advice, we will print a Print Advice Report when NEFT is checked
2014-08-19 20:30:07,828 21493 ERR
find . -name *.xml -exec sed -i 's/noupdate="1"/noupdate="0"/g' {} \;
--Save out in dropdb.sh and execute with chmod +x
--This delete all database of runbot app
SELECT 'dropdb ' || '"' || datname || '"' AS dropcmd
FROM pg_catalog.pg_database d
WHERE --datname ~ E'^\[0-9]{5}-[\w|\-|.]*' AND
pg_catalog.pg_get_userbyid(d.datdba) = 'runbot'
AND (datname like '%-base' OR datname like '%-all')
ORDER BY 1;
import time
import os
def grep_attemps(fname, grep, wait_sec=3, attemps=30):
#import pdb;pdb.set_trace()
with open(fname, "r") as f:
where = f.tell()
for i in range(attemps):
lines = f.readlines()
if not lines:
[MASTER]
profile=no
ignore=CVS,.git,scenarios
persistent=yes
cache-size=500
[MESSAGES CONTROL]
#disable=all
#enable=C0102,C0121,C0301,C0302,I0013,R0914,W0101,W1111,E0101,E0601,E0602,E1124,E1306
#enable=all
#moved to https://github.com/vauxoo-dev/gist-vauxoo/blob/master/travis_run.py
"""
import os
import yaml
import re
import logging
import stat
_logger = logging.getLogger(__name__)