diff --git a/Buddy/Buddy/Buddy/__init__.py b/Buddy/Buddy/Buddy/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/Buddy/settings.py b/Buddy/Buddy/Buddy/settings.py new file mode 100755 index 0000000..c321296 --- /dev/null +++ b/Buddy/Buddy/Buddy/settings.py @@ -0,0 +1,121 @@ +""" +Django settings for Buddy project. + +Generated by 'django-admin startproject' using Django 2.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'p)@=f5#gy2+2^14&qy-gg968cu29*b7gbccs*!08jtbc28^f%-' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +#ALLOWED_HOSTS = ['192.168.1.67','.hyperling.com'] +ALLOWED_HOSTS = ['*'] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Buddy.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'Buddy.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/Buddy/Buddy/Buddy/urls.py b/Buddy/Buddy/Buddy/urls.py new file mode 100755 index 0000000..87001ce --- /dev/null +++ b/Buddy/Buddy/Buddy/urls.py @@ -0,0 +1,24 @@ +"""Buddy URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import include, path + +urlpatterns = [ + path('walk/', include('walk.urls')), + path('thanks/', include('thanks.urls')), + path('forecast/', include('forecast.urls')), + path('admin/', admin.site.urls), +] diff --git a/Buddy/Buddy/Buddy/wsgi.py b/Buddy/Buddy/Buddy/wsgi.py new file mode 100755 index 0000000..c1b12ee --- /dev/null +++ b/Buddy/Buddy/Buddy/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for Buddy project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Buddy.settings') + +application = get_wsgi_application() diff --git a/Buddy/Buddy/forecast/__init__.py b/Buddy/Buddy/forecast/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/forecast/admin.py b/Buddy/Buddy/forecast/admin.py new file mode 100755 index 0000000..8c38f3f --- /dev/null +++ b/Buddy/Buddy/forecast/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Buddy/Buddy/forecast/apps.py b/Buddy/Buddy/forecast/apps.py new file mode 100755 index 0000000..9846efd --- /dev/null +++ b/Buddy/Buddy/forecast/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ForecastConfig(AppConfig): + name = 'forecast' diff --git a/Buddy/Buddy/forecast/migrations/__init__.py b/Buddy/Buddy/forecast/migrations/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/forecast/models.py b/Buddy/Buddy/forecast/models.py new file mode 100755 index 0000000..71a8362 --- /dev/null +++ b/Buddy/Buddy/forecast/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Buddy/Buddy/forecast/tests.py b/Buddy/Buddy/forecast/tests.py new file mode 100755 index 0000000..7ce503c --- /dev/null +++ b/Buddy/Buddy/forecast/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Buddy/Buddy/forecast/urls.py b/Buddy/Buddy/forecast/urls.py new file mode 100755 index 0000000..88a9cac --- /dev/null +++ b/Buddy/Buddy/forecast/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] diff --git a/Buddy/Buddy/forecast/views.py b/Buddy/Buddy/forecast/views.py new file mode 100755 index 0000000..5dd5465 --- /dev/null +++ b/Buddy/Buddy/forecast/views.py @@ -0,0 +1,154 @@ +from django.shortcuts import render + +# Create your views here. + +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json, math, time + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Get weather string - ZIP is ignored for now + print("Getting weather...") + weather_string = getWeather(47715) + + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': weather_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + + +## Function to call Weather API ## +def getWeather(zip_code): + ## Get request ## + resp = requests.get("http://api.openweathermap.org/data/2.5/forecast?zip=" + str(zip_code) + ",us&units=imperial&APPID=ecf63d9fa178fca8a4ab21b49e9bb456") + + if resp.status_code != 200: + # This means something went wrong. + raise ApiError('GET OpenWeatherMap {}'.format(resp.status_code)) + + response = resp.json() + + forecasts = response['list'] + + city = response['city'] + location = city['name'] + + output = "" + #for forecast in forecasts: + # range() = start#, stop_before, #steps + for forecast_id in range(0, 16): + forecast = forecasts[forecast_id] + + ## Get data from forecast ## + #location = forecast['name'] + #location = str(zip_code) + + weather = forecast['weather'] + weather = weather[0] + weather_main = weather['main'] + weather_desc = weather['description'] + + main = forecast['main'] + temp = main['temp'] + humidity = main['humidity'] + wind = forecast['wind'] + wind_speed = wind['speed'] + + cal_date = forecast['dt_txt'] + cal_date = int(cal_date[8:-9]) + + curr_date = int(time.strftime("%d")) + + cal_day = "" + if cal_date == curr_date: + cal_day = "Today" + elif cal_date == curr_date + 1 or cal_date == 1: + cal_day = "Tomorrow" +# elif cal_date == curr_date + 2 or cal_date == 1 or cal_date == 2: +# cal_day = "The day after tomorrow" + else: + continue + + time_of_day = forecast['dt_txt'] + time_of_day = int(time_of_day[11:-6]) + + time_ext = "AM" + if time_of_day - 12 >= 0: + time_of_day = time_of_day - 12 + time_ext = "PM" + + time_of_day = str(time_of_day) + time_ext + + if time_of_day == "0PM": + time_of_day = "noon" + + if time_of_day == "0AM": + time_of_day = "midnight" + cal_day = "Tonight" + + # Asked for Imperial units in API request + temp_units = 'F' + wind_units = 'mph' + humidity_units = '%' + + + ## Wind Chill ## + # Wind speed as noted in: https://answers.yahoo.com/question/index?qid=20091020183148AAHm3kB&guccounter=1 + # More official source: https://www.weather.gov/media/epz/wxcalc/windChill.pdf + wind_chill = 35.74 + (0.6215 * temp) - (35.75 * (wind_speed**0.16)) + (0.4275 * temp * wind_speed**0.16) + + + ## Heat Index ## + # Official formula: https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml + heat_index = -42.379 + 2.04901523*temp + 10.14333127*humidity - 0.22475541*temp*humidity - 0.00683783*temp*temp - 0.05481717*humidity*humidity + 0.00122874*temp*temp*humidity + 0.00085282*temp*humidity*humidity - 0.00000199*temp*temp*humidity*humidity + + if humidity < 13 and temp >= 80 and temp <= 112: + heat_index -= ((13-humidity)/4)*math.sqrt((17-abs(temp-95.))/17) + + if humidity > 85 and temp >= 80 and temp <= 87: + heat_index += ((humidity-85)/10) * ((87-temp)/5) + + if heat_index < 80: + heat_index = 0.5 * (temp + 61.0 + ((temp-68.0)*1.2) + (humidity*0.094)) + heat_index = (heat_index + temp) / 2 + + + ## Check if wind chill or heat index is applicable ## + # Rules found here under the map: https://www.mesonet.org/index.php/weather/map/wind_chill_heat_index1/air_temperature + guess = "(" + wind_chill_text = "" + if temp < 50 and wind_speed > 5: + wind_chill = round(wind_chill) + wind_chill_text = guess + "Wind chill of " + str(wind_chill) + temp_units + ") " + + heat_index_text = "" + if temp > 80: + heat_index = round(heat_index) + heat_index_text = guess + "Heat index of " + str(heat_index) + temp_units + ") " + + + ## Round numbers ## + temp = round(temp) + wind_speed = round(wind_speed) + heat_index = round(heat_index) + + + ## Add to the final string ## + output = str(output + cal_day + " at " + str(time_of_day) + " it will be " + str(temp) + temp_units + " and " + weather_main + + " with " + str(wind_speed) + wind_units + " wind and " + str(humidity) + humidity_units + " humidity" + + ". " + wind_chill_text + heat_index_text + "\n") + + return output diff --git a/Buddy/Buddy/manage.py b/Buddy/Buddy/manage.py new file mode 100755 index 0000000..3e4ffa5 --- /dev/null +++ b/Buddy/Buddy/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == '__main__': + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Buddy.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) diff --git a/Buddy/Buddy/thanks/__init__.py b/Buddy/Buddy/thanks/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/thanks/admin.py b/Buddy/Buddy/thanks/admin.py new file mode 100755 index 0000000..8c38f3f --- /dev/null +++ b/Buddy/Buddy/thanks/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Buddy/Buddy/thanks/apps.py b/Buddy/Buddy/thanks/apps.py new file mode 100755 index 0000000..0e1e647 --- /dev/null +++ b/Buddy/Buddy/thanks/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ThanksConfig(AppConfig): + name = 'thanks' diff --git a/Buddy/Buddy/thanks/migrations/__init__.py b/Buddy/Buddy/thanks/migrations/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/thanks/models.py b/Buddy/Buddy/thanks/models.py new file mode 100755 index 0000000..71a8362 --- /dev/null +++ b/Buddy/Buddy/thanks/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Buddy/Buddy/thanks/tests.py b/Buddy/Buddy/thanks/tests.py new file mode 100755 index 0000000..7ce503c --- /dev/null +++ b/Buddy/Buddy/thanks/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Buddy/Buddy/thanks/urls.py b/Buddy/Buddy/thanks/urls.py new file mode 100755 index 0000000..88a9cac --- /dev/null +++ b/Buddy/Buddy/thanks/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] diff --git a/Buddy/Buddy/thanks/views.py b/Buddy/Buddy/thanks/views.py new file mode 100755 index 0000000..66d60f9 --- /dev/null +++ b/Buddy/Buddy/thanks/views.py @@ -0,0 +1,33 @@ +from django.shortcuts import render + +# Create your views here. + +from random import randint +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Create return message + thanks_array=["No problem!", "No problem at all!", "No worries, I'm here to help!", "You're welcome!", "You're very welcome!", + "My pleasure!", ":kappa:", "It is my will to serve you, my lord.", "No probs.", "As you wish, my master.", + ":+1:", ":thumbsup_all:", ":heavy_check_mark:", "Just doing my job."] + thanks_string = thanks_array[randint(0,13)] + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': thanks_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + diff --git a/Buddy/Buddy/walk/__init__.py b/Buddy/Buddy/walk/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/walk/admin.py b/Buddy/Buddy/walk/admin.py new file mode 100755 index 0000000..8c38f3f --- /dev/null +++ b/Buddy/Buddy/walk/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Buddy/Buddy/walk/apps.py b/Buddy/Buddy/walk/apps.py new file mode 100755 index 0000000..422b291 --- /dev/null +++ b/Buddy/Buddy/walk/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class WalkConfig(AppConfig): + name = 'walk' diff --git a/Buddy/Buddy/walk/migrations/__init__.py b/Buddy/Buddy/walk/migrations/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/Buddy/Buddy/walk/models.py b/Buddy/Buddy/walk/models.py new file mode 100755 index 0000000..71a8362 --- /dev/null +++ b/Buddy/Buddy/walk/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Buddy/Buddy/walk/tests.py b/Buddy/Buddy/walk/tests.py new file mode 100755 index 0000000..7ce503c --- /dev/null +++ b/Buddy/Buddy/walk/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Buddy/Buddy/walk/urls.py b/Buddy/Buddy/walk/urls.py new file mode 100755 index 0000000..88a9cac --- /dev/null +++ b/Buddy/Buddy/walk/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] diff --git a/Buddy/Buddy/walk/views.py b/Buddy/Buddy/walk/views.py new file mode 100755 index 0000000..bb2052c --- /dev/null +++ b/Buddy/Buddy/walk/views.py @@ -0,0 +1,169 @@ +from django.shortcuts import render + +# Create your views here. + +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json, math + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Get weather string - ZIP is ignored for now + print("Getting weather...") + weather_string = getWeather(47715) + + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': weather_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + #return HttpResponse(data=weather_string, status=status.HTTP_200_OK) + #return HttpResponse(status=status.HTTP_200_OK) + #return Response(status=status.HTTP_200_OK) + + print("Done returning. ;)") + + +def getWeather(zip_code): + ## Get request ## + resp = requests.get("http://api.openweathermap.org/data/2.5/weather?zip=47715,us&units=imperial&APPID=ecf63d9fa178fca8a4ab21b49e9bb456") + + if resp.status_code != 200: + # This means something went wrong. + raise ApiError('GET OpenWeatherMap {}'.format(resp.status_code)) + + response = resp.json() + + + ## Get data from request ## + location = response['name'] + + weather = response['weather'] + weather = weather[0] + weather_main = weather['main'] + weather_desc = weather['description'] + + main = response['main'] + temp = main['temp'] + humidity = main['humidity'] + wind = response['wind'] + wind_speed = wind['speed'] + + # Asked for Imperial units in API request + temp_units = 'F' + wind_units = 'mph' + humidity_units = '%' + + + ## Wind Chill ## + # Wind speed as noted in: https://answers.yahoo.com/question/index?qid=20091020183148AAHm3kB&guccounter=1 + # More official source: https://www.weather.gov/media/epz/wxcalc/windChill.pdf + wind_chill = 35.74 + (0.6215 * temp) - (35.75 * (wind_speed**0.16)) + (0.4275 * temp * wind_speed**0.16) + + + ## Heat Index ## + # Official formula: https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml + heat_index = -42.379 + 2.04901523*temp + 10.14333127*humidity - 0.22475541*temp*humidity - 0.00683783*temp*temp - 0.05481717*humidity*humidity + 0.00122874*temp*temp*humidity + 0.00085282*temp*humidity*humidity - 0.00000199*temp*temp*humidity*humidity + + if humidity < 13 and temp >= 80 and temp <= 112: + heat_index -= ((13-humidity)/4)*math.sqrt((17-abs(temp-95.))/17) + + if humidity > 85 and temp >= 80 and temp <= 87: + heat_index += ((humidity-85)/10) * ((87-temp)/5) + + if heat_index < 80: + heat_index = 0.5 * (temp + 61.0 + ((temp-68.0)*1.2) + (humidity*0.094)) + heat_index = (heat_index + temp) / 2 + + + ## Check if wind chill or heat index is applicable ## + # Rules found here under the map: https://www.mesonet.org/index.php/weather/map/wind_chill_heat_index1/air_temperature + guess = "My guess is that's a " + wind_chill_text = "" + if temp < 50 and wind_speed > 5: + wind_chill = round(wind_chill) + wind_chill_text = guess + "wind chill of " + str(wind_chill) + temp_units + ". " + else: + wind_chill = temp + + heat_index_text = "" + if temp > 80: + heat_index = round(heat_index) + heat_index_text = guess + "heat index of " + str(heat_index) + temp_units + ". " + else: + heat_index = temp + + + ## Who doesn't want to go? ## + besides_default = ' (Besides' + besides = besides_default + + # Formula for temp/wind speed is to make sure that if it's too windy Chad doesn't go. + # The denominator controls how powerful the wind speed is taken into account and gets bigger as it increases. + chad_hates_wind = (temp/(wind_speed*(wind_speed*0.05))) + if wind_chill <= 32 or heat_index >= 100 or chad_hates_wind < 3: + if besides != besides_default: + besides += ',' + besides += ' Chad' + + if (temp > 95 and humidity > 40): + if besides != besides_default: + besides += ',' + besides += ' Zach' + + if True: + if besides != besides_default: + besides += ',' + besides += ' Dan' + + if besides == besides_default: + besides = '' + else: + besides += ')' + + comma_count = besides.count(',') + if comma_count == 1: + besides = besides.replace(',', ' and') + elif comma_count >= 2: + besides = besides.replace(',', '|', comma_count) + besides = besides.replace('|', ',', comma_count-1) + besides = besides.replace('|', ', and') + + + ## Check if wind chill or heat index is applicable ## + # Rules found here under the map: https://www.mesonet.org/index.php/weather/map/wind_chill_heat_index1/air_temperature + guess = "My guess is that's a " + wind_chill_text = "" + if temp < 50 and wind_speed > 5: + wind_chill = round(wind_chill) + wind_chill_text = guess + "wind chill of " + str(wind_chill) + temp_units + ". " + + heat_index_text = "" + if temp > 80: + heat_index = round(heat_index) + heat_index_text = guess + "heat index of " + str(heat_index) + temp_units + ". " + + + ## Round numbers ## + temp = round(temp) + wind_speed = round(wind_speed) + + + ## Build the final string ## + output = str(location + " is " + str(temp) + temp_units + " and " + weather_main + + " with a wind speed of " + str(wind_speed) + wind_units + " and humidity of " + str(humidity) + humidity_units + + ". " + wind_chill_text + heat_index_text + + "Who wants to walk?" + besides) + + return output diff --git a/Buddy/Buddy/walk/views.py.openweathermap b/Buddy/Buddy/walk/views.py.openweathermap new file mode 100755 index 0000000..16ea335 --- /dev/null +++ b/Buddy/Buddy/walk/views.py.openweathermap @@ -0,0 +1,66 @@ +from django.shortcuts import render + +# Create your views here. + +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Get weather string - ZIP is ignored for now + print("Getting weather...") + weather_string = getWeather(47715) + + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': weather_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + #return HttpResponse(data=weather_string, status=status.HTTP_200_OK) + #return HttpResponse(status=status.HTTP_200_OK) + #return Response(status=status.HTTP_200_OK) + + print("Done returning. ;)") + + +def getWeather(zip_code): + resp = requests.get("http://api.openweathermap.org/data/2.5/weather?zip=47715,us&units=imperial&APPID=ecf63d9fa178fca8a4ab21b49e9bb456") + + if resp.status_code != 200: + # This means something went wrong. + raise ApiError('GET OpenWeatherMap {}'.format(resp.status_code)) + + response = resp.json() + + location = response['name'] + + weather = response['weather'] + weather = weather[0] + weather_main = weather['main'] + weather_desc = weather['description'] + + main = response['main'] + temp = main['temp'] + humidity = main['humidity'] + wind = response['wind'] + wind_speed = wind['speed'] + + temp_units = 'F' + wind_units = 'mph' + humidity_units = '%' + + output = location + " is " + str(temp) + temp_units + " and " + weather_main + " with a wind speed of " + str(wind_speed) + wind_units + " and humidity of " + str(humidity) + humidity_units + ". Who wants to walk?" + + return output diff --git a/Buddy/Buddy/walk/views.py.openweathermap.besides b/Buddy/Buddy/walk/views.py.openweathermap.besides new file mode 100755 index 0000000..343ac45 --- /dev/null +++ b/Buddy/Buddy/walk/views.py.openweathermap.besides @@ -0,0 +1,91 @@ +from django.shortcuts import render + +# Create your views here. + +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Get weather string - ZIP is ignored for now + print("Getting weather...") + weather_string = getWeather(47715) + + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': weather_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + #return HttpResponse(data=weather_string, status=status.HTTP_200_OK) + #return HttpResponse(status=status.HTTP_200_OK) + #return Response(status=status.HTTP_200_OK) + + print("Done returning. ;)") + + +def getWeather(zip_code): + resp = requests.get("http://api.openweathermap.org/data/2.5/weather?zip=47715,us&units=imperial&APPID=ecf63d9fa178fca8a4ab21b49e9bb456") + + if resp.status_code != 200: + # This means something went wrong. + raise ApiError('GET OpenWeatherMap {}'.format(resp.status_code)) + + response = resp.json() + + location = response['name'] + + weather = response['weather'] + weather = weather[0] + weather_main = weather['main'] + weather_desc = weather['description'] + + main = response['main'] + temp = main['temp'] + humidity = main['humidity'] + wind = response['wind'] + wind_speed = wind['speed'] + + temp_units = 'F' + wind_units = 'mph' + humidity_units = '%' + + + # Who doesn't want to go? + besides_default = ' (Besides' + besides = besides_default + + if (temp < 35 and wind_speed >= 5) or (temp < 55 and wind_speed >= 10) or (temp < 65 and wind_speed >= 15): + if besides != besides_default: + besides += ',' + besides += ' Chad' + + if besides == besides_default: + besides = '' + else: + besides += ')' + + comma_count = besides.count(',') + if comma_count == 1: + besides = besides.replace(',', ' and') + elif comma_count >= 2: + besides = besides.replace(',', '|', comma_count) + besides = besides.replace('|', ',', comma_count-1) + besides = besides.replace('|', ', and') + + # Finish up and return a string + + output = location + " is " + str(temp) + temp_units + " and " + weather_main + " with a wind speed of " + str(wind_speed) + wind_units + " and humidity of " + str(humidity) + humidity_units + ". Who wants to walk?" + besides + + return output diff --git a/Buddy/Buddy/walk/views.py.yahoo b/Buddy/Buddy/walk/views.py.yahoo new file mode 100755 index 0000000..248de94 --- /dev/null +++ b/Buddy/Buddy/walk/views.py.yahoo @@ -0,0 +1,68 @@ +from django.shortcuts import render + +# Create your views here. + +from django.http import HttpResponse +from django.views.decorators.csrf import csrf_exempt +import requests, json + + +@csrf_exempt +def index(request): + # Get Zip code from request + print("Request=") + print(request) + print("Request body=") + print(request.body) + + # Get weather string - ZIP is ignored for now + print("Getting weather...") + weather_string = getWeather(47715) + + print("Creating payload...") + payload = { 'response_type': "in_channel", 'text': weather_string } + print("payload=") + print(payload) + print("dumps(payload)=") + print(json.dumps(payload)) + + print("Returning payload...") + return HttpResponse(json.dumps(payload), content_type='application/json') + #return HttpResponse(data=weather_string, status=status.HTTP_200_OK) + #return HttpResponse(status=status.HTTP_200_OK) + #return Response(status=status.HTTP_200_OK) + + print("Done returning. ;)") + + +def getWeather(zip_code): + return "Sorry, Yahoo APIs are no longer easily available and I don't know of any others yet. Try looking through Cheryl's office for the weather and let us know if it's worth risking a walk." + resp = requests.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22Evansville%2C%20in%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys") + + if resp.status_code != 200: + # This means something went wrong. + raise ApiError('GET YahooWeather {}'.format(resp.status_code)) + + weather = resp.json() + + query = weather['query'] + results = query['results'] + channel = results['channel'] + item = channel['item'] + condition = item['condition'] + + location = item['title'] + temp = condition['temp'] + text = condition['text'].lower() + + units = channel['units'] + temp_units = units['temperature'] + wind_units = units['speed'] + + wind = channel['wind'] + wind_speed = wind['speed'] + wind_chill = wind['chill'] + + output = location + " are " + temp + temp_units + " and " + text + " with a wind speed of " + wind_speed + wind_units + ", resulting in a wind chill temperature of " + wind_chill + temp_units + ". Who wants to walk?" + + return output diff --git a/Buddy/buddy/bin/activate b/Buddy/buddy/bin/activate new file mode 100755 index 0000000..663b2eb --- /dev/null +++ b/Buddy/buddy/bin/activate @@ -0,0 +1,76 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + if [ ! "$1" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/root/Buddy/buddy" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + if [ "x(buddy) " != x ] ; then + PS1="(buddy) ${PS1:-}" + else + if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1" + else + PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" + fi + fi + export PS1 +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r +fi diff --git a/Buddy/buddy/bin/activate.csh b/Buddy/buddy/bin/activate.csh new file mode 100755 index 0000000..e77e81d --- /dev/null +++ b/Buddy/buddy/bin/activate.csh @@ -0,0 +1,37 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/root/Buddy/buddy" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + if ("buddy" != "") then + set env_name = "buddy" + else + if (`basename "VIRTUAL_ENV"` == "__") then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` + else + set env_name = `basename "$VIRTUAL_ENV"` + endif + endif + set prompt = "[$env_name] $prompt" + unset env_name +endif + +alias pydoc python -m pydoc + +rehash diff --git a/Buddy/buddy/bin/activate.fish b/Buddy/buddy/bin/activate.fish new file mode 100755 index 0000000..1c2f3b1 --- /dev/null +++ b/Buddy/buddy/bin/activate.fish @@ -0,0 +1,75 @@ +# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org) +# you cannot run it directly + +function deactivate -d "Exit virtualenv and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + functions -e fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + + set -e VIRTUAL_ENV + if test "$argv[1]" != "nondestructive" + # Self destruct! + functions -e deactivate + end +end + +# unset irrelevant variables +deactivate nondestructive + +set -gx VIRTUAL_ENV "/root/Buddy/buddy" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# unset PYTHONHOME if set +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # save the current fish_prompt function as the function _old_fish_prompt + functions -c fish_prompt _old_fish_prompt + + # with the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command + set -l old_status $status + + # Prompt override? + if test -n "(buddy) " + printf "%s%s" "(buddy) " (set_color normal) + else + # ...Otherwise, prepend env + set -l _checkbase (basename "$VIRTUAL_ENV") + if test $_checkbase = "__" + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) + else + printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) + end + end + + # Restore the return status of the previous command. + echo "exit $old_status" | . + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/Buddy/buddy/bin/chardetect b/Buddy/buddy/bin/chardetect new file mode 100755 index 0000000..9fcc859 --- /dev/null +++ b/Buddy/buddy/bin/chardetect @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from chardet.cli.chardetect import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/bin/django-admin b/Buddy/buddy/bin/django-admin new file mode 100755 index 0000000..953d0d7 --- /dev/null +++ b/Buddy/buddy/bin/django-admin @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from django.core.management import execute_from_command_line + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(execute_from_command_line()) diff --git a/Buddy/buddy/bin/django-admin.py b/Buddy/buddy/bin/django-admin.py new file mode 100755 index 0000000..4a52bdc --- /dev/null +++ b/Buddy/buddy/bin/django-admin.py @@ -0,0 +1,5 @@ +#!/root/Buddy/buddy/bin/python3 +from django.core import management + +if __name__ == "__main__": + management.execute_from_command_line() diff --git a/Buddy/buddy/bin/easy_install b/Buddy/buddy/bin/easy_install new file mode 100755 index 0000000..5fbdfa6 --- /dev/null +++ b/Buddy/buddy/bin/easy_install @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from setuptools.command.easy_install import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/bin/easy_install-3.6 b/Buddy/buddy/bin/easy_install-3.6 new file mode 100755 index 0000000..5fbdfa6 --- /dev/null +++ b/Buddy/buddy/bin/easy_install-3.6 @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from setuptools.command.easy_install import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/bin/pip b/Buddy/buddy/bin/pip new file mode 100755 index 0000000..1035eda --- /dev/null +++ b/Buddy/buddy/bin/pip @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/bin/pip3 b/Buddy/buddy/bin/pip3 new file mode 100755 index 0000000..1035eda --- /dev/null +++ b/Buddy/buddy/bin/pip3 @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/bin/pip3.6 b/Buddy/buddy/bin/pip3.6 new file mode 100755 index 0000000..1035eda --- /dev/null +++ b/Buddy/buddy/bin/pip3.6 @@ -0,0 +1,11 @@ +#!/root/Buddy/buddy/bin/python3 + +# -*- coding: utf-8 -*- +import re +import sys + +from pip import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/Buddy/buddy/pyvenv.cfg b/Buddy/buddy/pyvenv.cfg new file mode 100755 index 0000000..12a52df --- /dev/null +++ b/Buddy/buddy/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /usr/bin +include-system-site-packages = false +version = 3.6.7 diff --git a/Buddy/buddy/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl new file mode 100755 index 0000000..186f75a Binary files /dev/null and b/Buddy/buddy/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl new file mode 100755 index 0000000..14159df Binary files /dev/null and b/Buddy/buddy/share/python-wheels/appdirs-1.4.3-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl new file mode 100755 index 0000000..8914172 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/certifi-2018.1.18-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl new file mode 100755 index 0000000..7e51f48 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/chardet-3.0.4-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl new file mode 100755 index 0000000..7e14f3f Binary files /dev/null and b/Buddy/buddy/share/python-wheels/colorama-0.3.7-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/distlib-0.2.6-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/distlib-0.2.6-py2.py3-none-any.whl new file mode 100755 index 0000000..2dc0f91 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/distlib-0.2.6-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl new file mode 100755 index 0000000..8270abd Binary files /dev/null and b/Buddy/buddy/share/python-wheels/distro-1.0.1-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl new file mode 100755 index 0000000..62e141a Binary files /dev/null and b/Buddy/buddy/share/python-wheels/html5lib-0.999999999-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/idna-2.6-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/idna-2.6-py2.py3-none-any.whl new file mode 100755 index 0000000..77386b3 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/idna-2.6-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl new file mode 100755 index 0000000..e0e2371 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/ipaddress-0.0.0-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl new file mode 100755 index 0000000..add2bc6 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/lockfile-0.12.2-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/packaging-17.1-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/packaging-17.1-py2.py3-none-any.whl new file mode 100755 index 0000000..23ca472 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/packaging-17.1-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl new file mode 100755 index 0000000..60340e5 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl new file mode 100755 index 0000000..b39e270 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/progress-1.2-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/progress-1.2-py2.py3-none-any.whl new file mode 100755 index 0000000..7a056dd Binary files /dev/null and b/Buddy/buddy/share/python-wheels/progress-1.2-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl new file mode 100755 index 0000000..6bb4728 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/pyparsing-2.2.0-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl new file mode 100755 index 0000000..141f077 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl new file mode 100755 index 0000000..3eece01 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/retrying-1.3.3-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl new file mode 100755 index 0000000..d42fe7b Binary files /dev/null and b/Buddy/buddy/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/six-1.11.0-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/six-1.11.0-py2.py3-none-any.whl new file mode 100755 index 0000000..273e49c Binary files /dev/null and b/Buddy/buddy/share/python-wheels/six-1.11.0-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl new file mode 100755 index 0000000..dbda3b7 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl new file mode 100755 index 0000000..6ec1c14 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/webencodings-0.5-py2.py3-none-any.whl differ diff --git a/Buddy/buddy/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl b/Buddy/buddy/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl new file mode 100755 index 0000000..61aeac6 Binary files /dev/null and b/Buddy/buddy/share/python-wheels/wheel-0.30.0-py2.py3-none-any.whl differ diff --git a/bin/init_buddy_walk.sh b/bin/init_buddy_walk.sh new file mode 100755 index 0000000..2cc37a1 --- /dev/null +++ b/bin/init_buddy_walk.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd /root/Buddy/buddy +source bin/activate +cd /root/Buddy/Buddy +python manage.py runserver 0:8000 > /root/log/buddy.log diff --git a/bin/init_python.sh b/bin/init_python.sh new file mode 100755 index 0000000..123200e --- /dev/null +++ b/bin/init_python.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd /root/Buddy/buddy +source bin/activate + +cd ../Buddy