shanenin

Moderator
  • Content Count

    3752
  • Joined

  • Last visited

Everything posted by shanenin

  1. How long has it been since the old TTV boards have been gone. I am guessing about two years, has it been longer?
  2. ya I can back you up on that :-)
  3. thanks. I like the list comprehension. That is sure to come in handy again. I did it this way if 3 in [ i[0] for i in lis ]:
  4. lets say I have a list called lis lis = [(1, 2), (3, 4), (5, 6), (7, 8)] lets say I want to test for a numner in the first position of each tuple. to give you an idea of what I want to do, I will show you code that does not work, but might make my point if 3 in lis[0-3][0]: the code would read if 3 is in the first position of the first four tuples:
  5. I usually only here positives about python. Any thing else in particular that makes it undesireable?
  6. Thanks :-) for some reason I was thinking any variable created in the global namespace was automatically able to be changed from within a function. After reading a little from my book, global variables can only be read from the functions namespace, not changed. They can be changed, but the varibale needs to be decrared global inside the functions namespace. edit added later// their was no good reason to change my global varible anyways. I did the code in a much cleaner way. Python is good for us beginner programmers. I get the impression it is desighned in a way to make people use good habits.
  7. I am getting this error with this finction UnboundLocalError: local variable 'query_info' referenced before assignment this is the function that is failing. This is just part of the code. the varibale query_info is set gloablly in the beginning of the script def cd_info(): if query_status == 200: (read_status, read_info) = CDDB.read(query_info['category'], query_info['disc_id']) song_list = [] for i in range(disc_id[1]): song_list.append(read_info['TTITLE' + `i`]) title = query_info['title'] song_titles = tuple(song_list) retur
  8. pythonrip-0.2 is coming along nice. I am adding some features, one of the best is a simple config file. It will allow you to set stuff like output directory, use mp3 or ogg, and bitrate. If the config file is set you just have to put in your disc and run the command pythonrip. It does not get any simpler. If the user does not set up his config, it will ask you a few simple questions before proceding. I also added user input to help decide on the proper cd to choose. On occasion the CDDB data base will come up with conflicting choices. Below is the output of my NIN fixed cd ##################
  9. I have some output when running CDDB.py . It is ugly and I would like to remove it. I am currently running python 2.3, it is my understaning this output does not apear with python-2.4. I get these two warnings /usr/lib/python2.3/site-packages/DiscID.py:53: FutureWarning: x<<y losing bits or changing sign will return a long in Python 2.4 and up discid = ((checksum % 0xff) << 24 | total_time << 8 | last) and this /usr/lib/python2.3/site-packages/CDDB.py:33: FutureWarning: %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and up query_str = (('%08lx %d
  10. I am running 2.6.7 . I need an older version of alsa for my sound to work. 2.6.8 or 2.6.9 or higher have a newer verions of alsa. Also the verison of alsa in portage in also to new. The funny thing is, for a a few minutes I managed to get alsa to work with a newer kernel, but screwed it up and could not get it to work again. I struggled for about three days , then gave up. I used alsa which was included with my 2.6.7 kernel source and had no problems making it work
  11. shane@mainbox shane $ dd if=/dev/hdc of=c count=512 dd: opening `/dev/hdc': Permission denied Hmm.
  12. If I am reading that correctly, that still is refering to a mounted file system. When reading an audio disc, it is not being mounted. I can even remove all lines from my fstab file about the cdrom and it will still read fine. the forth field in the fstab file are options for a mounted file system. which my cdrom is not being mounted to be used.
  13. are you sure? I think read access is only for mounted stuff. Since my drive is not being mounted, I don't think /etc/fstab would affect it.
  14. I found this solution. create this file to add any special permissions you want /etc/udev/permissions.d/00-myrules.permissions then just add the following lines hdc:root:users:664 hdd:root:users:664 this should cover virtually everyone using udev. In all honesty I think the reason I need to do this is my permissions are not set up properly.
  15. shane@mainbox shane $ cat /etc/group | grep cdrom cdrom:!:19:shane I seem to be in the cdrom group, but it is still not letting me read the disk as user. what does " ! " do. It seems out of place? Also the part of the python module that fails as regular user is the module DiscID.py(CDDB.py uses DiscID).
  16. maybe using sed in a script to start changeing /etc/udev/* of users of my program is not a good idea. I would have warned them before letting the script procede to kill ther linux system :-) A better solution would be to figure out why the CDDB.py module needs read access to the cdrom. I wonder if it could be changed. Many of the other non python ripper programs that use the CDDB don't need to run as root. They must be using a clib of some sort.
  17. thanks I will have to try that(modprobing) isn't messing with my udev config the only way I will be able to permanetly change permissions of device files?
  18. even if I know what the device is, chmoding only works until the user reboots. I need to make this permanent. I need to find a way to automatically config the udev config file. here is what my ubuntu config looks like, this might be easy to change. although I have not tested it yet. Maybe I can just change mode to MODE="0664" I suppose I could reboot and try it # permissions for IDE CD devices BUS="ide", KERNEL="hd[a-z]", SYSFS{removable}="1", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", MODE="0660", GROUP="cdrom" on my gentoo system I have tried messing around with ude
  19. don't almost all new distros use udev, and /dev/hd* to reperesent ide drives? I would be happy if the script worked for 80- 90 % of people. It would be a nice start.
  20. I originally tried chmoding /dev/cdrom, but since that is just a a soft link, it made no difference. I did not realize /dev/cdroms/cdrom is a hard link. So your are sayung more linux computers will have /dev/cdroms/cdrom* then /dev/hd* ? how can you tell a hard link from a soft link, ls -l does not see tho show any difference ? I would really like to figure out a universal way to change /etc/udev/rules.d/* file so the installer I am going to make could give the user the option to make the chnages to permissions of /dev/hd* permanent.
  21. shanenin

    My Work

    beautiful work :-)
  22. I like that, but it turns out I just need to give him a graphic I cut out of some paper. Then they will let the artists at yellowbook.com do there job. In three weeks I will have a proof that I can make changes if needed. I will show you guys what they come up with. Thanks for all of everyones effort I did like your last attemt :-)
  23. I suppose a big advantage to using C is the vast suppy of librarys. I ended up haveing to use a program 'avitype', because of the lack of a python module. But I suppose using a program or a c library isn't a whole lot different. I will have to take a crack at C one of these days. I tried it once as my first language, but lost intest. Now from using python a bit, I think it would be more interesting, and I would understand a bit more.