Drakx
September 3rd, 2005, 11:24 AM
Hi guys
i have been stopped dead in my tracks the following code looks fine to me but still i get the errors
Traceback (most recent call last):
File "quickrip.py", line 61, in ?
main(sys.argv[1:])
File "quickrip.py", line 56, in main
cli.main()
File "cli/cli.py", line 430, in main
cli.switch('front')
File "cli/cli.py", line 44, in switch
self.front()
File "cli/cli.py", line 68, in front
self.scanDVD()
File "/home/drakx/quickrip-0.9-alpha/quickrip-0.9-alpha/base.py", line 197, in scanDVD
self.raw_dvd = mmpython.parse(self.config['dvd_device'])
NameError: global name 'mmpython' is not defined
here is the code snippets
line 61:
# The famous __name__ + __main__ trick...
if __name__ == '__main__':
main(sys.argv[1:])
line 56:
# Fallback to CLI mode...
sys.path.append("cli")
import cli
cli.main()
sys.exit(2)
File "cli/cli.py", line 430
def main():
#print "QuickRip v0.6, (C) Tom Chance, 2003"
print "%s v%s, %s\n" % (__app__, __version__, __copyright__)
cli = CLI()
cli.switch('front')
File "cli/cli.py", line 44:
def switch(self, mode, title=1):
"""send user into various modes (entry, toplevel, title)"""
os.system("clear")
print output.bold("%s v%s, %s\n" % (__app__, __version__, __copyright__))
if mode == 'front':
self.level = 'front'
self.front()
elif mode == 'toplevel':
self.level = 'toplevel'
self.toplevel()
elif mode == 'title':
self.level = 'title'
self.showTitle(title)
elif mode == 'configure':
self.level = 'configure'
self.configure()
elif mode == 'rip':
self.level = 'ripping'
self.ripScreen()
File "cli/cli.py", line 68:
def front(self):
"""show the front screen"""
print output.bold("\nHit enter to scan DVD")
try:
null = raw_input()
del null
except KeyboardInterrupt:
print output.bold("\n\nExiting...")
sys.exit(2)
self.scanDVD()
self.switch("toplevel"
base.py", line 197:
# The following functions are threaded, but are processed in the order
# in which they appear here. - biggs
def scanDVD(self):
"""Scan the DVD and build up a data structure for the titles"""
self.notify_startScanning()
self.titles = []
self.numtitles = 0
# Reset values to default (in case user scans two different discs in same session)
self.raw_dvd = mmpython.parse(self.config['dvd_device'])
# If there aren't any titles...
if self.raw_dvd.tracks == []:
self.notify_noTitles()
The above code is the whole section instead of just the line in hope some one more skilled than i can spot the problem right out :S from what i can see every thing is fine, now im not a big python expert but for pice of mind python is backwards compatable ?
Sorry for beeing a pest but i think ive found some thing i can learn from and bring back life
i have been stopped dead in my tracks the following code looks fine to me but still i get the errors
Traceback (most recent call last):
File "quickrip.py", line 61, in ?
main(sys.argv[1:])
File "quickrip.py", line 56, in main
cli.main()
File "cli/cli.py", line 430, in main
cli.switch('front')
File "cli/cli.py", line 44, in switch
self.front()
File "cli/cli.py", line 68, in front
self.scanDVD()
File "/home/drakx/quickrip-0.9-alpha/quickrip-0.9-alpha/base.py", line 197, in scanDVD
self.raw_dvd = mmpython.parse(self.config['dvd_device'])
NameError: global name 'mmpython' is not defined
here is the code snippets
line 61:
# The famous __name__ + __main__ trick...
if __name__ == '__main__':
main(sys.argv[1:])
line 56:
# Fallback to CLI mode...
sys.path.append("cli")
import cli
cli.main()
sys.exit(2)
File "cli/cli.py", line 430
def main():
#print "QuickRip v0.6, (C) Tom Chance, 2003"
print "%s v%s, %s\n" % (__app__, __version__, __copyright__)
cli = CLI()
cli.switch('front')
File "cli/cli.py", line 44:
def switch(self, mode, title=1):
"""send user into various modes (entry, toplevel, title)"""
os.system("clear")
print output.bold("%s v%s, %s\n" % (__app__, __version__, __copyright__))
if mode == 'front':
self.level = 'front'
self.front()
elif mode == 'toplevel':
self.level = 'toplevel'
self.toplevel()
elif mode == 'title':
self.level = 'title'
self.showTitle(title)
elif mode == 'configure':
self.level = 'configure'
self.configure()
elif mode == 'rip':
self.level = 'ripping'
self.ripScreen()
File "cli/cli.py", line 68:
def front(self):
"""show the front screen"""
print output.bold("\nHit enter to scan DVD")
try:
null = raw_input()
del null
except KeyboardInterrupt:
print output.bold("\n\nExiting...")
sys.exit(2)
self.scanDVD()
self.switch("toplevel"
base.py", line 197:
# The following functions are threaded, but are processed in the order
# in which they appear here. - biggs
def scanDVD(self):
"""Scan the DVD and build up a data structure for the titles"""
self.notify_startScanning()
self.titles = []
self.numtitles = 0
# Reset values to default (in case user scans two different discs in same session)
self.raw_dvd = mmpython.parse(self.config['dvd_device'])
# If there aren't any titles...
if self.raw_dvd.tracks == []:
self.notify_noTitles()
The above code is the whole section instead of just the line in hope some one more skilled than i can spot the problem right out :S from what i can see every thing is fine, now im not a big python expert but for pice of mind python is backwards compatable ?
Sorry for beeing a pest but i think ive found some thing i can learn from and bring back life