ramesh130 / etv-comskip

Automatically exported from code.google.com/p/etv-comskip
GNU General Public License v2.0
1 stars 0 forks source link

MarkCommercial Error with EyeTV 3.1 #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've upgraded to EyeTV version 3.1 and now see the attached dialog when it's 
time to identify 
commercial breaks:

MarkCommercials Error
An unexpected error has occurred during execution of the main script.

NameError: global name 'application' is not defined.

I have found that restarting the computer stops this problem, but it reappears 
after running fine 
for a while (not more than, say, a week or two while recording several TV 
programs daily.)

Using Mac OS X 10.5.6 on 1.83GHz Mac mini (MA608LL/A.)

Console log attached.

Original issue reported on code.google.com by jason.s...@gmail.com on 30 Jan 2009 at 4:16

Attachments:

GoogleCodeExporter commented 9 years ago
Odd.  I haven't upgraded to 3.1 yet, so I haven't seen this.  On the other 
hand, it
might not be related to 3.1 at all.  Did you apply any other system updates?  I
wonder if it might be related to a system upgrade affecting appscript.

Next time this happens, can you fire up a terminal and try this and report the 
results.

MyMac$ python
>>> import appscript
>>> import aem

Original comment by jon.chri...@gmail.com on 31 Jan 2009 at 4:37

GoogleCodeExporter commented 9 years ago
There have been no system updated since before EyeTV was updated, and 
everything was fine then. In fact, it 
happened with the very first recording after upgrading to EyeTV 3.1. The 
sequence of events is as follows:

1. I had something scheduled to record with the older version of EyeTV. It 
began at 8pm.
2. I sat down at my computer at 7:40pm and saw the message about the newer 
version being available. I'd 
been waiting for the update so I instructed the machine to download & install 
it.
3. When EyeTV 3.1 was finished recording (an hour later at 9pm) the dialog box 
in my original message 
appeared. I even tried to run /Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials to get a 
list of recordings 
but that spat out the same error message:

Traceback (most recent call last):
  File "/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/Resources/__boot__.py", 
line 31, in <module>
    _run('MarkCommercials.py')
  File "/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/Resources/__boot__.py", 
line 28, in _run
    execfile(path, globals(), globals())
  File "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources/MarkCommercials.py", 
line 535, in 
<module>
    exitStatus = main()
  File "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources/MarkCommercials.py", 
line 468, in main
    CheckForApplicationCommunications()
  File "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources/MarkCommercials.py", 
line 214, in 
CheckForApplicationCommunications
    msg = 'Error: unable to communicate with %s\n' % application
NameError: global name 'application' is not defined
2009-01-30 23:32:40.116 MarkCommercials[3890:10b] MarkCommercials Error
2009-01-30 23:32:40.118 MarkCommercials[3890:10b] MarkCommercials Error
An unexpected error has occurred during execution of the main script

NameError: global name 'application' is not defined

Here is a list of when system updates were done.

2009-01-02 16:54:43 -0800: Installed "GarageBand Update" (4.1.1)
2009-01-02 16:54:48 -0800: Installed "AirPort Utility" (5.3.2)
2009-01-02 16:55:12 -0800: Installed "iTunes" (8.0.2)
2009-01-02 16:55:35 -0800: Installed "iPhoto Update" (7.1)
2009-01-02 16:59:56 -0800: Installed "Mac OS X Update Combined" (10.5.6)
2009-01-02 17:00:09 -0800: Installed "Remote Desktop Client Update" (3.2.2)
2009-01-02 17:00:31 -0800: Installed "QuickTime" (7.5.5)
2009-01-02 22:01:31 -0800: Installed "iPhoto Update" (7.1.5)
2009-01-02 22:01:33 -0800: Installed "Digital Camera Raw Compatibility Update" 
(2.4)
2009-01-11 09:09:48 -0800: Installed "iMovie Update" (7.1)
2009-01-11 09:10:01 -0800: Installed "GarageBand Update" (4.1.1)
2009-01-11 09:16:43 -0800: Installed "GarageBand Update" (4.1.2)
2009-01-11 09:16:55 -0800: Installed "iMovie Update" (7.1.4)
2009-01-23 23:49:49 -0800: Installed "QuickTime" (7.6)

As you can see, Mac OS X version 10.5.6 was installed on January 2 (January 2 
was a format and fresh install 
of Leopard so this was done via Software Update when the machine rebooted after 
the DVD was no longer 
needed.)

The problem just happened again today. Here's another console log. I also tried 
the commands you 
mentioned

jason$ python
Python 2.5.1 (r251:54863, Nov 11 2008, 17:46:48) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import appscript
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named appscript
>>> import aem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named aem

Original comment by jason.s...@gmail.com on 31 Jan 2009 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
FYI: I forgot to include EyeTV in the list of dates. It was updated to version 
3.1 on January 20.

Also, it looks like I misspoke in my original statement of it running fine 
between restarts for "a week or two" 
should really be "a day or two." Apparently I have no concept of time. :)

Original comment by jason.s...@gmail.com on 31 Jan 2009 at 7:45

GoogleCodeExporter commented 9 years ago
I'm not sure what's causing this, but I've identified two errors in the
MarkCommercials.py script which might contribute to this problem.  They don't
entirely explain why this error didn't seem to occur with version EyeTV
3.0.x...perhaps EyeTV 3.1 is slower to respond to these applescript requests 
than
3.0.x or something.  In any case, could you try the following, and see if the 
problem
still occurs?

cd "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources"

Ehen you're in that directory, you should be able to type:

  python ./MarkCommercials.py 

and get a list of recordings from EyeTV. (If you don't, let me know what you 
see)
BTW, you can also do "python ./MarkCommercials.py all" to mark *all* unmarked
commercials....

Now, let's try to fix the two problems I found...

First, type:

/Applications/TextEdit.app/Contents/MacOS/TextEdit MarkCommercials.py

  Search for "#launch application"

change "EyeTV.launch" to "EyeTV.launch()"

Search for:

  msg = 'Error: unable to communicate with %s\n' % application

and replace with:

  msg = 'Error: unable to communicate with %s\n' % options.app

Save MarkCommercials.py, and then see if the problem still occurs.

Now, if you re-run:

  python ./MarkCommercials.py 

Hopefully, if it didn't work before, it will now.

Let me know.

Original comment by jon.chri...@gmail.com on 1 Feb 2009 at 2:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, I know about adding "all" to the command, but I was only wanting to invoke 
the program to see if things 
worked differently from the command line. :)

This was the outcome when I first ran it.

jason$ cd /Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/Resources
jason$ python ./MarkCommercials.py 
Error: importing appscript
No module named aem

I made the changes indicated and the outcome is the same. Should I keep the 
changes or revert to the 
previous version?

BTW: Running /Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials does 
provide a list of 
recordings (for now, at least... only 1 show was recorded today. The weekends 
don't really have much TV for 
me to watch.)

Original comment by jason.s...@gmail.com on 1 Feb 2009 at 6:28

GoogleCodeExporter commented 9 years ago
Sorry, 'bout that, I should have recommended running

cd /Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/Resources

and from that directory:

../MacOS/MarkCommercials

That invokes some form of bundled-up python which knows about
Resources/lib/python2.5/site-packages.zip, which, if your install is like mine 
has
aem and appscript in it.

You can do:

unzip -t lib/python2.5/site-packages.zip | grep aem

to check and make sure it's there.

Original comment by jon.chri...@gmail.com on 1 Feb 2009 at 8:21

GoogleCodeExporter commented 9 years ago
site-packages.zip does contain an aem directory containing:
__init__.pyc
findapp.pyc
send
types

I've made the needed changes. I have many shows to record this week. I'll let 
you know if this continues to 
happen or not.

Original comment by jason.s...@gmail.com on 2 Feb 2009 at 4:00

GoogleCodeExporter commented 9 years ago
Well, it's been a week and it hasn't happened again.

Original comment by jason.s...@gmail.com on 9 Feb 2009 at 12:22

GoogleCodeExporter commented 9 years ago
I guess that I spoke too soon: I came home from work and found that none of the 
four recordings from today 
were marked with commercials. EyeTV was running so I ran /Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials and got:

        MarkCommercials 0.3.0

Error: unable to communicate with EyeTV

I restarted the computer, ran the command again, and got the same output.

Original comment by jason.s...@gmail.com on 18 Feb 2009 at 4:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I got up this morning and found (again) no commercials were marked so I ran 
/Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials and got 
the same unable to 
communicate with EyeTV message. I quit EyeTV, re-opened it, and ran 
/Library/Application\ 
Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials all

This is ran on two shows and then barfed all over the terminal window as below:

        MarkCommercials 0.3.0

 1. Processing "American Idol" on [KCPQ (HD)] channel [13]...
  Channel: 13 , not skipped
  Title: American Idol , not skipped
  Station name: KCPQ (HD) , not skipped
 2. Processing "Knight Rider" on [KING (HD)] channel [5]...
  Channel: 5 , not skipped
  Title: Knight Rider , not skipped
  Station name: KING (HD) , not skipped
Traceback (most recent call last):
  File "/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/Resources/__boot__.py", 
line 31, in <module>
    _run('MarkCommercials.py')
  File "/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/Resources/__boot__.py", 
line 28, in _run
    execfile(path, globals(), globals())
  File "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources/MarkCommercials.py", 
line 535, in 
<module>
    exitStatus = main()
  File "/Library/Application 
Support/ETVComskip/MarkCommercials.app/Contents/Resources/MarkCommercials.py", 
line 494, in main
    markerCount = len(rec.markers.get())
  File "build/bdist.macosx-10.5-i386/egg/appscript/reference.py", line 439, in __call__
appscript.reference.CommandError: CommandError -1708: Application could not 
handle this command.
    Failed command: app(u'/Applications/EyeTV.app').recordings.ID(256712403).markers.get()
2009-02-19 06:11:51.298 MarkCommercials[5690:10b] MarkCommercials Error
2009-02-19 06:11:51.333 MarkCommercials[5690:10b] MarkCommercials Error
An unexpected error has occurred during execution of the main script

CommandError: CommandError -1708: Application could not handle this command.
    Failed command: app(u'/Applications/EyeTV.app').recordings.ID(256712403).markers.get()

Original comment by jason.s...@gmail.com on 19 Feb 2009 at 2:19

GoogleCodeExporter commented 9 years ago
Hi,

Not sure if this issue is still live but these are the steps I followed to fix 
it using 10.5.8 and EyeTV 3.3 (5851) 
where this issue was occurring on a fresh install.  Step 1 might be unnecessary 
as I think step 2 fixes the 
primary cause of this issue.

1.  Make the changes to MarkCommercials.py as suggested in comment 4 above.
2.  Remove all extra copies of EyeTV from your system and reboot (when checking 
Applescript dictionaries 
from Script Editor the multiple copies, which I had archived on an external 
disk, were leading to multiple 
entries for EyeTV - I believe this is what was causing the error).

Original comment by ejd...@gmail.com on 17 Mar 2010 at 11:29

GoogleCodeExporter commented 9 years ago
This should be fixed by ETVComskip 2.0

Original comment by jon.chri...@gmail.com on 26 May 2010 at 5:10