Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit aa019ae

Browse files
committed
Major rewrite on folder structure
1 parent 52fc568 commit aa019ae

File tree

13 files changed

+36
-16
lines changed

13 files changed

+36
-16
lines changed

__init__.py

Whitespace-only changes.

bhottu.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
import signal
3737
from time import gmtime, strftime
3838

39-
from core_modules import *
40-
from basic_modules import *
41-
from addon_modules import *
39+
from modules.core_modules import *
40+
from modules.basic_modules import *
41+
from modules.addon_modules import *
4242
from config import *
4343
from utils import log_raw, log
4444

config.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Config file for bhottu
2-
# filename: ./config.py
1+
#Config file for bhottu
2+
#filename: ./config.py
33

4-
# Connection options
4+
#Connection options
55
SERVER = 'irc.rizon.net'
66
PORT = 6667
7-
NICK = 'tetbhottu'
8-
REALNAME = 'tetbhottu'
9-
IDENT = 'tetbhottu'
7+
NICK ='bhottu'
8+
REALNAME = 'bhottu'
9+
IDENT = 'bhottu'
1010
CHANNEL = '#/g/sicp_area51'
11-
MODE = 0 # This is a bitmask for user mode
11+
MODE = 0 #This is a bitmask for user mode
1212
VHOST = False
1313
NICK_PASS = ''
14-
# Authed users
14+
#Authed users
1515
GODS = []
1616

17-
# Logging options
17+
#Logging options
1818
RAW_LOGGING = True
1919
LOG_TO_STDOUT = True
2020
LOG_TO_FILE = False

modules/__init__.py

Whitespace-only changes.

modules/addon_modules/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from addon_modules import *

addon_modules.py modules/addon_modules/addon_modules.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ def outputTitle(parsed):
251251
return sendMsg(None, 'Site title: '+ str(dupe_url[0][1]))
252252
else:
253253
try:
254-
response = urllib2.urlopen(url)
254+
headers = { 'User-Agent' : 'JustUs/0.8 (compatible;) urllib2' }
255+
req = urllib2.Request(url, None, headers)
256+
response = urllib2.urlopen(req)
257+
print response #debug print
255258
if response.info().gettype() == "text/html":
256259
html = response.read(5000)
257260
response.close()
@@ -264,10 +267,14 @@ def outputTitle(parsed):
264267
title = title.replace('\r', '').rstrip()
265268
else:
266269
title = response.info().gettype()
267-
except:
270+
#print title
271+
except urllib2.URLError, e:
268272
conn.close()
269-
log('outputTitle(): Failed to fetch ' + url)
270-
return sendMsg(None, 'Failed to fetch url')
273+
if hasattr(e, 'reason'): error = e.reason
274+
elif hasattr(e, 'code'): error = e.code
275+
else: error = 'beyond who the fuck knows'
276+
log('outputTitle(): Failed to fetch url ' + url + ' reason: ' + str(error))
277+
return sendMsg(None, 'Failed to fetch url, reason '+ str(error))
271278

272279
db.execute("INSERT INTO urls (url, title, time) \
273280
VALUES (?, ?, ?)", \

modules/basic_modules/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from basic_modules import *
File renamed without changes.

modules/core_modules/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from core_modules import *
File renamed without changes.

quotelist

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<chown> wow, finally got VS2010 working on wine
2+
<chown> I acknowledge RMS as a filthy fat neckbeard
3+
<chown> I like to suck jam out of the squeezy jam bottle, and pretending I'm sucking feces out of an anus
4+
<chown> It's just that I'm too dumb to do anything other than glorified shell scripting
5+
<chown> Visual Studio is a great IDE.
6+
<chown> I can't really "get" C, pointers or anything lower level than my Windows install's start menu so I'll stick to my inefficient interpreted languages
7+
<chown> I just run Linux because I'm poor, don't misunderstand me - Windows 7 is much superior to this shit.
8+
<chown> It's just that I'm too dumb to do anything other than glorified shell scripting
9+
<chown> RMS is a filthy fatty fat fatfuck filthy neckbeard

utils/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from utils import *

utils.py utils/utils.py

File renamed without changes.

0 commit comments

Comments
 (0)