Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.swp
cbclient.py
persistentsettings
build
6 changes: 6 additions & 0 deletions naoko.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import multiprocessing
import naoko.main

if __name__ == '__main__':
multiprocessing.freeze_support()
naoko.main.main()
2 changes: 1 addition & 1 deletion naoko/lib/apiclient.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from urllib import urlencode
from httplib import HTTPConnection, HTTPSConnection

from settings import *
from ..settings import *


# A client for all the various APIs used by Naoko
Expand Down
2 changes: 1 addition & 1 deletion naoko/lib/ircclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import socket
import re

from settings import *
from ..settings import *

#Basic IRC client
#Built upon the instructions provided by http://wiki.shellium.org/w/Writing_an_IRC_bot_in_Python
Expand Down
2 changes: 1 addition & 1 deletion naoko/lib/sioclient.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import threading
from urllib import urlopen, urlencode

from settings import *
from ..settings import *

# Implementation of WebSocket client as per draft-ietf-hybi-thewebsocketprotocol-00
# http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00
Expand Down
6 changes: 4 additions & 2 deletions naoko/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ def run(script):
print "Received exception ", str(e)
finally:
child.terminate()

if __name__ == '__main__':
def main():
try:
while True:
run(Naoko)
except KeyboardInterrupt:
print "\n Shutting Down"

if __name__ == '__main__':
main()
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is only for building Windows binaries, really. If you're on OSX/Linux
# you should probably just run "python naoko.py"

import sys, traceback
try:
from cx_Freeze import setup, Executable
except:
traceback.print_exc()
sys.stderr.write("\nBuilding a windows executable requires cx_Freeze\n")
exit(-1)

build_exe_options = {"includes": ["hashlib", "naoko"], "packages": ["naoko", "naoko.lib"], "include_files": ["naoko.conf", "naoko.sql"]}

setup(
name = "naoko",
version = "1.0",
description = "A Synchtube bot",
options = {"build_exe": build_exe_options},
executables = [Executable("naoko.py", path="naoko")]
)