Moving code about for packaging

jessie
John Ladan 9 years ago
parent 2d95ac5cde
commit 985355d780
  1. 20
      error_files/error_search
  2. 12
      librarian
  3. 0
      library/__init__.py
  4. 1
      library/book_data.py
  5. 3
      library/database.py
  6. 0
      library/exceptions.py
  7. 0
      library/interface/__init__.py
  8. 7
      library/interface/browser.py
  9. 5
      library/interface/checkout.py
  10. 7
      library/interface/form.py
  11. 0
      library/interface/help_bar.py
  12. 2
      library/permissions.py
  13. 8
      setup.py

@ -0,0 +1,20 @@
Traceback (most recent call last):
File "./librarian.py", line 134, in <module>
curses.wrapper(menutest, m)
File "/usr/lib/python3.2/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "./librarian.py", line 29, in menutest
menu(w, l)
File "./librarian.py", line 66, in menu
f()
File "./librarian.py", line 115, in browseMenu
b.eventLoop()
File "/users/jladan/src/library/browser.py", line 180, in eventLoop
ch = self.handleInput(ch)
File "/users/jladan/src/library/browser.py", line 366, in handleInput
browserWindow.handleInput(self,ch)
File "/users/jladan/src/library/browser.py", line 203, in handleInput
string = self.hb.getSearch()
File "/users/jladan/src/library/help_bar.py", line 61, in getSearch
string = string + char
TypeError: Can't convert 'bytes' object to str implicitly

@ -1,14 +1,14 @@
#!/usr/bin/env python3
import curses
import db_layer as db
import browser
import form
import help_bar as helpBar
import library.database as db
import library.interface.browser as browser
import library.interface.form as form
import library.interface.help_bar as helpBar
import library.interface.checkout as co
import book_data
from library import book_data
import checkout as co
stdscr=0

@ -6,7 +6,6 @@ except ImportError:
from urllib2 import urlopen,URLError
from json import loads,dumps
from socket import timeout
import sys
""" Library Book Type Description:
The book is a dictionary of the form { string : a, ... }

@ -1,7 +1,6 @@
import sys
import sqlite3
import permissions
from library import permissions
_catalogue_db_file = '/users/libcom/catalogue.db'
_book_table = 'books'

@ -1,7 +1,6 @@
import sys
import curses
import db_layer as db
from form import BookForm,CategoryForm
import library.database as db
from library.interface.form import BookForm,CategoryForm
class browserWindow:
# These are actually class variables, not member variables? :<
@ -26,7 +25,6 @@ class browserWindow:
if not(height and width):
height = browserWindow._default_height
width = browserWindow._default_width
sys.stderr.write(str(height)+', '+str(width)+'\n')
self.w = window
self.hb = helpbar
self.w.resize(height,width)
@ -135,7 +133,6 @@ class browserWindow:
def search(self, string):
case_sensitive = not(string.islower())
#sys.stderr.write(str(case_sensitive)+'\n')
i = 0
found = False
for e in self.entries:

@ -1,7 +1,6 @@
import sys
import curses
from form import FormWindow,BookForm
import db_layer as db
from library.interface.form import FormWindow,BookForm
import library.database as db
class BookIDForm(FormWindow):

@ -1,5 +1,4 @@
import curses
import sys
class TextEntry:
@ -44,7 +43,6 @@ class TextEntry:
self.redraw()
def gain_focus(self):
#sys.stderr.write('I have focus!\n')
self.focus = True
self._mv_cursor(+len(self.value))
self.start = max(0,self.cursor-self.width)
@ -150,7 +148,6 @@ class FormWindow:
ch = self.w.getch()
while ch != 27:
#sys.stderr.write(curses.keyname(ch).decode('utf-8'))
self.handle_input(ch)
if ch==10 or ch==curses.KEY_ENTER:
if self.bt==0:
@ -187,12 +184,9 @@ class FormWindow:
def _set_entries(self,book):
e = 0
for l in self.labels:
#sys.stderr.write('updating label: '+l+'\n')
if l.lower() in book:
#sys.stderr.write(' '+l+' found\n')
self.entries[e].value = str(book[l.lower()])
else:
#sys.stderr.write(' '+l+' notfound\n')
self.entries[e].value = ""
e += 1
@ -303,7 +297,6 @@ class BookForm(FormWindow):
if self.hl==0: # lookup by isbn
book = self.lookup_isbn(self.entries[0].value)
if book != {}:
#sys.stderr.write('updating entries\n')
self._set_entries(book)
self.refresh()
self._mv_focus(+7)

@ -1,7 +1,7 @@
import grp
import os
import exceptions
from library import exceptions
class _PermissionLevel:
def __init__(self, group_name, pretty_name):

@ -0,0 +1,8 @@
from distutils.core import setup
setup(name="librarian",
description="Library Management Software for CSC",
author="jladan"
version="1.0",
packages=['library','library.interface']
scripts=["librarian"]
)
Loading…
Cancel
Save