Example #1
0
def log_file_status(ds, **kwargs):
    cmd1 = '/home/admin/GTA_logs/Sutas_logs'
    dir_names = []
    log_files = []
    for (dirpath, dirname, filenames) in os.walk(cmd1):
        log_files.extend(filenames)
        dir_names.extend(dirnames)

    cmd1 += '/' + dir_names[0] + '/' + 'report.html'
    f = codecs.openc(cmd1, 'r')
    data = f.read()

    connection = None
    try:
        connection = psycopg2.connect("dbname='gtaproject1' host='10.10.1.10' user='******' password='******'")
        cur = connection.cursor()
        user_id = kwargs['dag_run'].conf['user_id']
        test = 'test_log'
        insert_query = """ INSERT INTO authentication_executionstatus (user_id, key, value) VALUES (%s,%s,%s) """
        record_to_insert = (user_id, test, data)
        cur.execute(insert_query, record_to_insert)
        connection.commit()
    except psycopg2.DatabaseError as err:
        print("Error in DB inserting:", err)
        sys.exit(1)
Example #2
0
def get_long_description():
    """Return the contents of README.rst"""
    here = os.path.abspath(os.path.dirname(__file__))
    # Get the long description from the README file
    long_description = ''
    with openc(os.path.join(here, 'README.rst'), encoding='utf-8') as fileh:
        long_description = fileh.read()
    return long_description
Example #3
0
def open_file(file_name, splitlines=False):
    here = path.abspath(path.dirname(__file__))
    with openc(path.join(here, file_name), encoding='utf-8') as opened_file:
        file_output = opened_file.read().strip()

    if splitlines:
        file_output = file_output.splitlines()

    return file_output
Example #4
0
def get_requirements():
    """Read requirements.txt"""
    here = os.path.abspath(os.path.dirname(__file__))
    requirements = []
    filename = os.path.join(here, 'requirements.txt')
    with openc(filename, encoding='utf-8') as fileh:
        for lines in fileh:
            package = lines.split('>=')[1].strip()
            requirements.append(lines.strip())
    return requirements
Example #5
0
def get_version():
    """Read the version from version.py"""
    here = os.path.abspath(os.path.dirname(__file__))
    filename = os.path.join(here, 'pytrr', 'version.py')
    with openc(filename, encoding='utf-8') as fileh:
        for lines in fileh:
            if lines.startswith('FULL_VERSION ='):
                version = ast.literal_eval(lines.split('=')[1].strip())
                return version
    return 'unknown'
Example #6
0
https://github.com/pypa/sampleproject

"""
# Licensed under the MIT Licence

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open as openc
import os
from astro_scripts.__about__ import __version__

here = os.path.abspath(os.path.dirname(__file__))

# Get the long description from the README file
with openc(os.path.join(here, 'README.rst')) as f:
   long_description = f.read()

about = {'__version__': __version__}

# https://www.reddit.com/r/Python/comments/3uzl2a/setuppy_requirementstxt_or_a_combination/
with openc('requirements.txt') as f:
    requirements = f.read().splitlines()

setup(
    name='astro_scripts',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version=about["__version__"],
Example #7
0
__author__ = 'Rick Zhang'
__time__ = '2018/10/14'

import sys
from codecs import open as openc
from os import path

from setuptools import find_packages, setup

here = path.abspath(path.dirname(__file__))

py_version = sys.version_info
assert py_version.major == 3
assert py_version.minor >= 5

with openc(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

with openc('requirements.txt', 'r') as f:
    require_list = [line.strip() for line in f]

setup(
    name='arbcharm',
    version='1.0.0',
    description='Charm Of Arbitrage',
    long_description=long_description,
    url='https://github.com/RunningToTheEdgeOfTheWorld/arbcharm',
    author='Rick Zhang',
    author_email='*****@*****.**',
    license='MIT',
    classifiers=[
Example #8
0
"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
"""

import os
# To use a consistent encoding
from codecs import open as openc
# Always prefer setuptools over distutils
from setuptools import setup, find_packages

HERE = os.path.abspath(os.path.dirname(__file__))

# Get the long description from the README file
with openc(os.path.join(HERE, 'README.md'), encoding='utf-8') as f:
    LONG_DESCRIPTION = f.read()

setup(
    name='scores',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version='1.0.0',
    description='A python flask app to manage board game scores',
    LONG_DESCRIPTION=LONG_DESCRIPTION,

    # The project's main homepage.
    url='https://github.com/zesk06/scores',