repo_id stringclasses 208
values | file_path stringlengths 31 190 | content stringlengths 1 2.65M | __index_level_0__ int64 0 0 |
|---|---|---|---|
qxf2_public_repos | qxf2_public_repos/summarize-my-data/LICENSE | MIT License
Copyright (c) 2017 Qxf2
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, ... | 0 |
qxf2_public_repos | qxf2_public_repos/summarize-my-data/SUMMARY.md | # Table of contents
* [Summarize my numbers for me!](README.md)
| 0 |
qxf2_public_repos | qxf2_public_repos/summarize-my-data/book.json | {
"root": "./docs",
"plugins": ["codetabs"]
} | 0 |
qxf2_public_repos | qxf2_public_repos/summarize-my-data/README.md | # Summarize my numbers for me!
## Reading charts are hard
\[Temporary\] The text you see here is Qxf2 trying out GitBook for all our repositories. Given that this repo has not yet been worked on, we are going to make it a guinea pig. Becoming a super hero is a fairly straight forward process:
```
$ give me super-pow... | 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/docs/testing-gitbook.md | Trying out code tabs plugin: https://github.com/GitbookIO/plugin-codetabs
{% codetabs name="Python", type="py" -%}
msg = "Hello World"
print msg
{%- language name="JavaScript", type="js" -%}
var msg = "Hello World";
console.log(msg);
{%- language name="HTML", type="html" -%}
<b>Hello World</b>
{%- endcodetabs %}
| 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/docs/SUMMARY.md | # Summary
* [Introduction](README.md)
* [Example page](testing-gitbook.md)
| 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/docs/README.md | # Introduction
| 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/_book/testing-gitbook.html |
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Example page · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta ... | 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/_book/index.html |
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Introduction · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta ... | 0 |
qxf2_public_repos/summarize-my-data | qxf2_public_repos/summarize-my-data/_book/search_index.json | {"index":{"version":"0.5.12","fields":[{"name":"title","boost":10},{"name":"keywords","boost":15},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"./":["introduct"],"testing-gitbook.html":["\"hello","=","code","codetab","console.log(msg);hello","exampl","https://github.com/gitbookio/plugin","msg","msgv... | 0 |
qxf2_public_repos/summarize-my-data/_book | qxf2_public_repos/summarize-my-data/_book/gitbook/theme.js | !function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n?n:e)},c,c.ex... | 0 |
qxf2_public_repos/summarize-my-data/_book | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook.js | !function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.ex... | 0 |
qxf2_public_repos/summarize-my-data/_book | qxf2_public_repos/summarize-my-data/_book/gitbook/style.css | /*! normalize.css v2.1.0 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:1... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-livereload/plugin.js | (function() {
var newEl = document.createElement('script'),
firstScriptTag = document.getElementsByTagName('script')[0];
if (firstScriptTag) {
newEl.async = 1;
newEl.src = '//' + window.location.hostname + ':35729/livereload.js';
firstScriptTag.parentNode.insertBefore(newEl, firstScriptTag);
}
... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-highlight/website.css | .book .book-body .page-wrapper .page-inner section.normal pre,
.book .book-body .page-wrapper .page-inner section.normal code {
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Tomorrow Comment */
/* Tomorrow Red */
/* Tomorrow Orange */
/* Tomorrow Yellow */
/* Tomorrow Green */
... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-highlight/ebook.css | pre,
code {
/* http://jmblog.github.io/color-themes-for-highlightjs */
/* Tomorrow Comment */
/* Tomorrow Red */
/* Tomorrow Orange */
/* Tomorrow Yellow */
/* Tomorrow Green */
/* Tomorrow Aqua */
/* Tomorrow Blue */
/* Tomorrow Purple */
}
pre .hljs-comment,
code .hljs-comment,
pre .hljs-title,
code... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-search/search-engine.js | require([
'gitbook',
'jquery'
], function(gitbook, $) {
// Global search objects
var engine = null;
var initialized = false;
// Set a new search engine
function setEngine(Engine, config) {
initialized = false;
engine = new Engine(config);
init(config);
... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-search/search.css | /*
This CSS only styled the search results section, not the search input
It defines the basic interraction to hide content when displaying results, etc
*/
#book-search-results .search-results {
display: none;
}
#book-search-results .search-results ul.search-results-list {
list-style-type: none;
padding-le... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-search/search.js | require([
'gitbook',
'jquery'
], function(gitbook, $) {
var MAX_RESULTS = 15;
var MAX_DESCRIPTION_SIZE = 500;
var usePushState = (typeof history.pushState !== 'undefined');
// DOM Elements
var $body = $('body');
var $bookSearchResults;
var $searchInput;
var $searchList;
var... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-search/lunr.min.js | /**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12
* Copyright (C) 2015 Oliver Nightingale
* MIT Licensed
* @license
*/
!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-lunr/search-lunr.js | require([
'gitbook',
'jquery'
], function(gitbook, $) {
// Define global search engine
function LunrSearchEngine() {
this.index = null;
this.store = {};
this.name = 'LunrSearchEngine';
}
// Initialize lunr by fetching the search index
LunrSearchEngine.prototype.init ... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-lunr/lunr.min.js | /**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12
* Copyright (C) 2015 Oliver Nightingale
* MIT Licensed
* @license
*/
!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-codetabs/codetabs.css | .codetabs {
}
.codetabs .codetabs-header .tab {
display: inline-block;
padding: 3px 6px;
border-bottom: 2px solid transparent;
cursor: pointer;
opacity: 0.7;
}
.codetabs .codetabs-header .tab.active {
border-bottom-color: #428bca;
cursor: default;
opacity: 1;
}
.codetabs .codetabs-bo... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-codetabs/codetabs.js | require([
'jquery'
], function($) {
$(document).on('click.plugin.codetabs', '.codetabs .codetabs-header .tab', function(e) {
var $btn = $(e.target);
var $tabs = $btn.parents('.codetabs');
var tabId = $btn.data('codetab');
$tabs.find('.tab').removeClass('active');
$tabs.f... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook/fonts | qxf2_public_repos/summarize-my-data/_book/gitbook/fonts/fontawesome/fontawesome-webfont.svg | <?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata></metadata>
<defs>
<font id="fontawesomeregular" horiz-adv-x="1536" >
<font-face units-per-em="1792" ascent="1536" descent="-256" /... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-fontsettings/fontsettings.js | require(['gitbook', 'jquery'], function(gitbook, $) {
// Configuration
var MAX_SIZE = 4,
MIN_SIZE = 0,
BUTTON_ID;
// Current fontsettings state
var fontState;
// Default themes
var THEMES = [
{
config: 'white',
text: 'White',
... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-fontsettings/website.css | /*
* Theme 1
*/
.color-theme-1 .dropdown-menu {
background-color: #111111;
border-color: #7e888b;
}
.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner {
border-bottom: 9px solid #111111;
}
.color-theme-1 .dropdown-menu .buttons {
border-color: #7e888b;
}
.color-theme-1 .dropdown-menu .button {
color... | 0 |
qxf2_public_repos/summarize-my-data/_book/gitbook | qxf2_public_repos/summarize-my-data/_book/gitbook/gitbook-plugin-sharing/buttons.js | require(['gitbook', 'jquery'], function(gitbook, $) {
var SITES = {
'facebook': {
'label': 'Facebook',
'icon': 'fa fa-facebook',
'onClick': function(e) {
e.preventDefault();
window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[url... | 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/LICENSE | MIT License
Copyright (c) 2021 sravantit25
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/requirements.txt | Flask
Flask-WTF
wtforms-components
flask-sqlalchemy==2.5.1
SQLAlchemy==1.4
flask-migrate
mailchimp-marketing==3.0.44
pylint
PyMySQL==1.0.2
oauthlib>=3.2.1
pytz
wtforms==2.3.3
great_expectations
pytest
tld==0.12.6
prometheus-client
psutil
prometheus-flask-exporter>=0.22.4
pact-python>=2.0.1
schemathesis>=3.19.5
| 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/Dockerfile | #Dockerfile to build an image/container to host Newsletter Generator Application
#Pull an Image
FROM qxf2rohand/newsletter_automation:latest
LABEL maintainer = "Qxf2 Services"
#Mounting a code as volume into the container
ADD . /newsletter_automation
#Make port 5000 available to the container
EXPOSE 5000
#Execute c... | 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/MANIFEST.in | recursive-include newsletter_automation/ *
recursive-include newsletter_automation/conf *
recursive-include newsletter_automation/helpers *
recursive-include newsletter_automation/newsletter *
recursive-include newsletter_automation/newsletter/templates *
recursive-include newsletter_automation/newsletter/static ... | 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/README.md | # Newsletter automation
This project is to automate the process of creating the weekly Qxf2 newsletter. We take the URLs posted on the Skype channel as input and create a MailChimp campaign.
## Run the project locally using Docker
1. Clone the repository
2. Run <br>
`docker build --tag $TAG .`<br>
`docker... | 0 |
qxf2_public_repos | qxf2_public_repos/newsletter_automation/setup.py | #!/bin/env python
import os
import setuptools
if os.path.exists('./README.md'):
with open('./README.md', 'r', encoding='utf=8') as fh:
long_description = fh.read()
# There isn't a cleaner solution to get the latest package addition to requirements.txt
# We are using https://stackoverflow.com/a/14399775
#... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/output.tf | # Newsletter application resources Output Values
output "instance_publicip" {
description = "EC2 Instance Public IP"
value = aws_instance.newsletter_instance.public_ip
}
output "instance_publicdns" {
description = "EC2 Instance Public DNS"
value = aws_instance.newsletter_instance.public_dns
}
outpu... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/newsletter_ec2.tf | # To generate secure key pair for ec2 instance
resource "tls_private_key" "newsletter_key" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "newsletter_generated_key" {
key_name = var.keyname
public_key = tls_private_key.newsletter_key.public_key_openssh
provisioner "local-exec" {
comm... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/variable.tf | # AWS related variables - Modify region and instance type as per your requirement
variable "region" {
description = "Newsletter automation ec2 instance deploy region"
type = string
default = "us-east-1"
}
variable "newsletter_ec2_inst_type" {
description = "declaring ec2 instance type for newsletter... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/README.md | __Newsletter Automation app deployment using Terraform__
------
This folder contains Terraform Configuration files to deploy app. These configuration files provisions
a) An EC2: Deploys an ec2 instance with required software installations to run the app.
b) a Lambda: for URL filteration.
c) ... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/newsletter_sqs.tf | /*
# SQS queue creation -
Purpose to send a message to Lambda to trigger Test Event.
Queue -> Lambda
*/
resource "aws_sqs_queue" "lambda_trigger_sqs" {
name = "urlfilterlambda-trigger-queue"
max_message_size = 262144
visibility_timeout_seconds = 60
message_retention_s... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/newslettersg.tf | # Create a security group for newsletter automation application.
resource "aws_security_group" "sg_newsletter" {
name = "External resources"
egress {
from_port = 0
to_port = 0
protocol = "-1"
description = "egress enables to reach external resources"
cidr_blocks = ["0.0.0.0/0"]
}
... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/nginx_config.template | # Default server configuration
#
upstream newsletter-automation-app {
server 0.0.0.0:5000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/newsletter_lambda.tf |
# Clones the GitHub repository and installs dependencies using pip
# in the specified directory, choosing pip3 if available.
resource "null_resource" "aws_lambda_repo_clone" {
provisioner "local-exec" {
command = <<-EOT
git clone ${var.github_repo}
# Determine the correct pip executable (pip3 o... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/ami-datasource.tf | # Retrieves the most recent Ubuntu 22.04 AMI
# from Canonical's repository
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
# 099720109477... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/terraform/version.tf | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.16"
}
}
required_version = ">= 1.2.0"
}
# Define the AWS provider
provider "aws" {
region = var.region # Replace with your desired region
profile = var.profile
}
# Define the archive provider
provider "ar... | 0 |
qxf2_public_repos/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/run.py | """
Flask App for Newsletter automation
"""
from newsletter import app
import logging
import os
@app.before_first_request
def before_first_request():
log_level = logging.INFO
for handler in app.logger.handlers:
app.logger.removeHandler(handler)
root = os.path.dirname(os.path.abspath(__file__))
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/script.py.mako | """${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/env.py | from __future__ import with_statement
import logging
from logging.config import fileConfig
from flask import current_app
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/alembic.ini | # A generic, single database configuration.
[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false
# Logging configuration
[loggers]
keys = root,sqlal... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/README | Generic single-database configuration. | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/migrations | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/versions/5d7c367953eb_.py | """empty message
Revision ID: 5d7c367953eb
Revises: 237df1268348
Create Date: 2021-08-13 15:55:32.331264
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5d7c367953eb'
down_revision = '237df1268348'
branch_labels = None
depends_on = None
def upgrade():
# ... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/migrations | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/versions/90063792a995_.py | """empty message
Revision ID: 90063792a995
Revises: 5d7c367953eb
Create Date: 2022-07-19 19:44:43.086027
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '90063792a995'
down_revision = '5d7c367953eb'
branch_labels = None
depe... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/migrations | qxf2_public_repos/newsletter_automation/newsletter_automation/migrations/versions/237df1268348_.py | """empty message
Revision ID: 237df1268348
Revises:
Create Date: 2021-07-29 21:33:34.739710
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '237df1268348'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gener... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/newsletter_automation/tests/consumer_tests/build_create_campaign_contract.py | """ Add consumer pact tests to create campaign mocking mailchimp provider"""
import requests, json, os
import logging
import atexit
import unittest
from pact import Consumer, Provider
PACT_MOCK_HOST = 'localhost'
PACT_MOCK_PORT = 1234
PACT_DIR = os.path.dirname(os.path.realpath(__file__))
log = logging.getLogger(__na... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/sso_google_oauth.py | """
A Flask app for Google SSO
"""
import os
from oauthlib import oauth2
import conf.sso_conf as conf
BASE_URL = os.environ.get('REDIRECT_URI','http://localhost:5000')
CLIENT_ID = conf.CLIENT_ID
CLIENT_SECRET = conf.CLIENT_SECRET
DATA = {
'response_type':"code",
'redirect_uri':f"{BASE_URL}/callback",... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/schedule_forms.py | from flask_wtf import FlaskForm
from wtforms import TextField, SubmitField,HiddenField
from wtforms.validators import InputRequired
from wtforms.fields.html5 import DateTimeLocalField
class SendTestEmail(FlaskForm):
newsletter_subject = TextField('newsletter_subject')
class ScheduleForm(FlaskForm):
schedule... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/models.py | """
Models for the Newsletter Automation app
"""
from email.policy import default
from newsletter import db
class AddNewsletter(db.Model):
"Class for AddNewsletter db model"
__tablename__ = 'add_newsletter'
newsletter_id = db.Column(db.Integer, primary_key=True)
subject = db.Column(db.String(50))
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/__init__.py | #!/bin/env python
import os
import urllib.parse
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_wtf.csrf import CSRFProtect
from flask import Blueprint
from prometheus_flask_exporter import PrometheusMetrics
app = Flask(__name__)
flask_metrics = PrometheusMe... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/forms.py | #Flask Form To add Data
#from newsletter.routes import description
from flask_wtf import FlaskForm
from flask_wtf.recaptcha import validators
from wtforms import TextField, TextAreaField, SubmitField
from wtforms.fields.html5 import URLField
from wtforms.fields.core import Label, StringField
from wtforms.validators imp... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/edit_article_form.py | """Flask Form To edit articles"""
from flask_wtf import FlaskForm
from wtforms import TextField, TextAreaField, SubmitField,SelectField
from wtforms.validators import DataRequired, Length, Regexp
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from . models import Article_category
def fetch_categories():
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/create_newsletter_form.py | """
This Module Contains the Form classes for Add articles form
"""
from email import message
from wsgiref.validate import validator
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectField, TextAreaField
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/schedule_form_routes.py | """
This file is used to send test email from mail chimp and
it schedule the newletter automation also
"""
from flask import request, flash, redirect, render_template
from sqlalchemy import desc
import pytz
from helpers.mailchimp_helper import Mailchimp_Helper
from . models import AddNewsletter, NewsletterContent, News... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/routes.py | #Endpoints to different Pages/Endpoints
import json
import re
import requests
from operator import countOf
from builtins import Exception
from flask import Flask, request, flash, url_for, redirect, render_template, jsonify,session
from sqlalchemy.orm.exc import MultipleResultsFound
from . models import Articles, db, A... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/static | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/static/css/style.css | body {
background: #e1eaf5;
font-family: 'Poppins', sans-serif;
}
.container {
background: white;
width: 100%;
margin: auto auto 0;
box-shadow: 0 0 5px rgba(65,67,144,0.15);
padding: 50px;
}
h1 {
margin: 0 0 30px;
color: #475369;
}
ul {
padding: 0 0 30px;
border-bottom: 1p... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/preview_newsletter.html | {% extends "base.html" %}
{% block css_static %}
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
{% endblock css_static %}
{% block content %}
<div class="container">
<meta name="csrf-token" content="{{ csrf_token() }}">
<form method="POST" , action="">
<fieldset class="form-group">
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/home.html | {% extends "base.html" %}
{% block content %}
<div class="container">
<div class="row">
<h3>Hello there!</h3>
<p>Welcome to Qxf2's newsletter generator. We developed this application to achieve two goals:</p>
<ol>
<li>1. Make newsletter generation quicker</li>
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/articles.html | {% extends "base.html" %}
{% block content %}
<div class="container">
<form action = "{{ request.path }}" method = "post">
<legend>Add Article</legend>
<div class="col-md-12">
<table class="table table-hover table" >
<tr>
<td > URL:{{ addarticlesform.url(id="url", class="form-... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/send_test_email.html | {% include "header.html" %}
{% include "layout.html" %}
{% block content %}
<div class="col-md-4">
<form method="POST">
{{ sendtestemail.hidden_tag() }}
{{ sendtestemail.newsletter_subject(id="newsletterSubject", value=subject, class="form-control",id="larger") }}
<br>
<input type=submit class="bt... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/base.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7GQL8C6CP8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/login.html | <!DOCTYPE html>
<html>
<head>
<title>Login</title>
</head>
<body>
<center>
<div class="logo">
<img src="{{ url_for('static', filename='img/qxf2_logo.png') }}" alt="logo" />
</div>
<h1>Qxf2 Newsletter App</h1>
<h4>Sign in to continue</h4>
... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/manage_articles.html | {% extends "base.html" %}
{% block css_static %}
<!-- jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<!-- DataTables JS -->
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/select/1.4.0/js/d... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/unauthorized.html | <html>
<head>
<title>Unauthorized</title>
</head>
<body>
<h2>You are unauthorized to view this page</h2>
<h3>Try with Qxf2 here : <a href="/login" >Try again</a></h3>
</body>
</html> | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/old_articles.html | {% extends "base.html" %}
{% block css_static %}
<!-- jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<!-- DataTables JS -->
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<!-- DataTables CSS -->
<link rel="stylesheet" href="https... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/edit_article.html | {%extends "base.html" %}
{% block content %}
<div class="container">
<form action="" method="POST">
{{ form.csrf_token }}
<fieldset class="form-group">
<legend>Edit Article</legend>
<table class="table table-hover table">
<tr>
<th>URL</th>... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/show_campaign.html | {% extends "base.html" %}
{% block content %}
<div class="container">
<form method="POST" , action="">
<fieldset class="form-group">
<legend>Show Campaign Table</legend>
<div>
<table class="table table-hover table">
<tr>
<... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/schedule_newsletter.html | {% include "header.html" %}
{% include "layout.html" %}
{% block content %}
<div class="col-md-10">
<form method="POST">
{{ scheduleform.csrf_token }}
{{ scheduleform.schedule_date(class="_datepicker",id="larger") }}
<input type=submit class="btn btn-outline-info" value="Schedule Newsletter" >
</form>
</div... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/result.html | {% extends "base.html" %}
{% block content %}
<div class="container">
<p>Result of addition: <span style="background-color:#fdf1ef;">{{ msg }}</span></p>
<a href="./articles">Add another article</a><br>
<a href="./manage-articles">Go to Manage articles page</a><br>
<a href="./create-newsletter">Go to Creat... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/header.html | <div class="row col-md-12">
<!--Logo and tagline-->
<div class="col-md-2 top-space-5">
<a href="/"><img src="/static/img/qxf2_logo.png" class="img-responsive logo col-md-12" alt="Qxf2 Services"></a>
</div>
<div class="col-md-8 top-space-15 text-center">
<h1 class="banner-brown text-center">Qxf2 Newsle... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter | qxf2_public_repos/newsletter_automation/newsletter_automation/newsletter/templates/create_newsletter.html | {% extends "base.html" %}
{% block css_static %}
<!-- Select2 CSS -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Select2 JS -->
<script src="htt... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/conf/apikey_conf.py | """
API key credentials for authentication
"""
import os
API_KEY = os.environ.get('API_KEY') | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/conf/sso_conf.py | """
SSO client ID and client secret
"""
import os
CLIENT_ID = os.environ.get('CLIENT_ID')
CLIENT_SECRET = os.environ.get('CLIENT_SECRET')
| 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/conf/mailchimp_conf.py | """
Configuration for mailchimp integrtaion
"""
import os
MAILCHIMP_API_KEY = os.environ.get('MAILCHIMP_API_KEY')
SERVER_PREFIX = os.environ.get('SERVER_PREFIX')
SUBSCRIBER_LIST_ID = os.environ.get('SUBSCRIBER_LIST_ID')
FROM_NAME= 'Qxf2 Services'
REPLY_TO='informedtester@qxf2.com' | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/helpers/authentication_required.py | """
Decorator for authenticating all pages
"""
import json
import os
from functools import wraps
from flask import render_template, session, request, jsonify
import conf.apikey_conf as APIKEY
class Authentication_Required:
"Authentication for all classes"
def requires_auth(func):
"verify given user aut... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/helpers/mailchimp_helper.py | """
Helper for mailchimp actions
API references :
1. https://github.com/mailchimp/mailchimp-marketing-python
2. https://mailchimp.com/developer/marketing/guides/quick-start/
"""
import mailchimp_marketing as MailchimpMarketing
import conf.mailchimp_conf as conf_file
import os
import sys
sys.path.append(os.path.dirnam... | 0 |
qxf2_public_repos/newsletter_automation/newsletter_automation | qxf2_public_repos/newsletter_automation/newsletter_automation/helpers/Editable_Newsletter_Template.html | <!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>*|MC... | 0 |
qxf2_public_repos/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/tests/integration/conftest.py | import os,pytest,sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from page_objects.PageFactory import PageFactory
from conf import browser_os_name_conf
from conf import base_url_conf
from conf import api_tests_conf
from conf import report_portal_conf
from endpoints.API_Player import API_Player
from uti... | 0 |
qxf2_public_repos/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/tests/integration/pytest.ini | [pytest]
addopts = -v -s -rsxX --continue-on-collection-errors --tb=short --ignore=utils/Test_Rail.py --ignore=tests/test_boilerplate.py --ignore=utils/Test_Runner_Class.py -p no:cacheprovider
norecursedirs = .svn _build tmp* log .vscode .git
markers =
GUI: mark a test as part of the GUI regression suite
API: m... | 0 |
qxf2_public_repos/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/tests/integration/requirements.txt | requests==2.31.0
pytest==8.1.1
reportportal-client==5.5.4
selenium>=4.16.0
python_dotenv==0.16.0
Appium_Python_Client==0.28
pytest-xdist>=1.31
pytest-html>=3.0.0
pytest-rerunfailures>=9.1.1
pytest_reportportal==5.4.0
pillow>=6.2.0
tesults
boto3==1.33.0
typing-extensions
loguru
imageio
questionary>=1.9.0
clear-screen>=0... | 0 |
qxf2_public_repos/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/tests/integration/package.json | {
"devDependencies": {
"@percy/cli": "^1.27.4"
}
}
| 0 |
qxf2_public_repos/newsletter_automation/tests | qxf2_public_repos/newsletter_automation/tests/integration/tox.ini | [tox]
skipsdist = true
[testenv]
#Setting the dependency file
deps = -r{toxinidir}/requirements.txt
#used to not trigger the “not installed in virtualenv” warning message
whitelist_externals=*
#setting the environment
setenv= app_path= {toxinidir}/bitcoin-info/app/
#Command to run the test
commands = python -m py... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/API_Player.py | """
API_Player class does the following:
a) serves as an interface between the test and API_Interface
b) contains several useful wrappers around commonly used combination of actions
c) maintains the test context/state
"""
from base64 import b64encode
from .API_Interface import API_Interface
from utils.results import Re... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/Base_API.py | """
A wrapper around Requests to make Restful API calls
"""
import requests
from urllib.error import HTTPError
from urllib.error import URLError
class Base_API:
"Main base class for Requests based scripts"
def get(self, url,data=None, headers={}):
"Get request"
json_response = None
er... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/Delete_Article_Endpoints.py | """
API endpoints for article
"""
import requests
class Delete_Article_Endpoints:
"Class for article endpoints"
def delete_articles_url(self,suffix=''):
"""Append API end point to base URL"""
return self.base_url+'/api/articles/all'+suffix
def delete_article_url(self,suffix=''):
... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/Edit_Article_Endpoints.py | """
API endpoints for article
"""
from bs4 import BeautifulSoup
class Edit_Article_Endpoints:
"Class for article endpoints"
def edit_articles_url(self,suffix=''):
"""Append API end point to base URL"""
return self.base_url+'/manage-articles'+suffix
def edit_article(self,data,heade... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/API_Interface.py | """
A composed interface for all the API objects
Use the API_Player to talk to this class
"""
import requests
from .Base_API import Base_API
from .Article_API_Endpoints import Article_API_Endpoints
from .Delete_Article_Endpoints import Delete_Article_Endpoints
from conf import base_url_conf as conf
class API_Interfac... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration | qxf2_public_repos/newsletter_automation/tests/integration/endpoints/Article_API_Endpoints.py | """
API endpoints for article
"""
class Article_API_Endpoints:
"Class for article endpoints"
def articles_url(self,suffix=''):
"""Append API end point to base URL"""
return self.base_url+'/api'+suffix
def add_article(self,data,headers):
"Adds a new article"
url = self.... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration/tests | qxf2_public_repos/newsletter_automation/tests/integration/tests/accessibility_tests/add articles page_output.txt | {"inapplicable":[{"description":"Ensures every accesskey attribute value is unique","help":"accesskey attribute value must be unique","helpUrl":"https://dequeuniversity.com/rules/axe/3.1/accesskeys?application=axeAPI","id":"accesskeys","impact":null,"nodes":[],"tags":["best-practice","cat.keyboard"]},{"description":"En... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration/tests | qxf2_public_repos/newsletter_automation/tests/integration/tests/accessibility_tests/edit articles page_output.txt | {"inapplicable":[{"description":"Ensures every accesskey attribute value is unique","help":"accesskey attribute value must be unique","helpUrl":"https://dequeuniversity.com/rules/axe/3.1/accesskeys?application=axeAPI","id":"accesskeys","impact":null,"nodes":[],"tags":["best-practice","cat.keyboard"]},{"description":"En... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration/tests | qxf2_public_repos/newsletter_automation/tests/integration/tests/accessibility_tests/create newsletter page_output.txt | {"inapplicable":[{"description":"Ensures every accesskey attribute value is unique","help":"accesskey attribute value must be unique","helpUrl":"https://dequeuniversity.com/rules/axe/3.1/accesskeys?application=axeAPI","id":"accesskeys","impact":null,"nodes":[],"tags":["best-practice","cat.keyboard"]},{"description":"En... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration/tests | qxf2_public_repos/newsletter_automation/tests/integration/tests/accessibility_tests/manage articles page_output.txt | {"inapplicable":[{"description":"Ensures every accesskey attribute value is unique","help":"accesskey attribute value must be unique","helpUrl":"https://dequeuniversity.com/rules/axe/3.1/accesskeys?application=axeAPI","id":"accesskeys","impact":null,"nodes":[],"tags":["best-practice","cat.keyboard"]},{"description":"En... | 0 |
qxf2_public_repos/newsletter_automation/tests/integration/tests | qxf2_public_repos/newsletter_automation/tests/integration/tests/accessibility_tests/login_output.txt | {"inapplicable":[{"description":"Ensures every accesskey attribute value is unique","help":"accesskey attribute value must be unique","helpUrl":"https://dequeuniversity.com/rules/axe/3.1/accesskeys?application=axeAPI","id":"accesskeys","impact":null,"nodes":[],"tags":["best-practice","cat.keyboard"]},{"description":"En... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.