Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv696

Modified Files:
        recordserver.py 
Log Message:
make it possible to switch uid

Index: recordserver.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/recordserver.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** recordserver.py     23 Jun 2004 21:20:10 -0000      1.47
--- recordserver.py     28 Jun 2004 20:40:16 -0000      1.48
***************
*** 7,10 ****
--- 7,13 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.48  2004/06/28 20:40:16  dischi
+ # make it possible to switch uid
+ #
  # Revision 1.47  2004/06/23 21:20:10  dischi
  # put snapshot in again with a try except
***************
*** 39,72 ****
  # problems, please let me know.
  #
- # Revision 1.40  2004/06/10 02:32:17  rshortt
- # Add RECORD_START/STOP events along with VCR_PRE/POST_REC commands.
- #
- # Revision 1.39  2004/05/30 18:27:53  dischi
- # More event / main loop cleanup. rc.py has a changed interface now
- #
- # Revision 1.38  2004/04/18 14:39:19  mikeruelle
- # fix missing self, priorities still really don't do anything but at
- # least it looks like its doing something.
- #
- # Revision 1.37  2004/04/18 08:23:44  dischi
- # fix unicode problem
- #
- # Revision 1.36  2004/03/13 22:36:44  dischi
- # fix crashes on debug (unicode again)
- #
- # Revision 1.35  2004/03/13 03:28:32  outlyer
- # Someone must have fixed the str2XML part internal to the FxdIMDB code, since
- # I was getting
- # &amp& (double-escaped) so I'm removing this one.
- #
- # Revision 1.34  2004/03/08 19:15:49  dischi
- # use our marmalade
- #
- # Revision 1.33  2004/03/05 20:49:11  rshortt
- # Add support for searching by movies only.  This uses the date field in xmltv
- # which is what tv_imdb uses and is really acurate.  I added a date property
- # to TvProgram for this and updated findMatches in the record_client and
- # recordserver.
- #
  # -----------------------------------------------------------------------
  # Freevo - A Home Theater PC framework
--- 42,45 ----
***************
*** 91,95 ****
  #endif
  
! import sys, string, random, time, os, re
  
  from twisted.web import xmlrpc, server
--- 64,79 ----
  #endif
  
! import sys, string, random, time, os, re, pwd
! import config
! 
! # change uid
! if __name__ == '__main__':
!     try:
!         if config.TV_RECORD_SERVER_UID and os.getuid() == 0:
!             os.setuid(config.TV_RECORD_SERVER_UID)
!             os.environ['USER'] = pwd.getpwuid(os.getuid())[0]
!             os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
!     except Exception, e:
!         print e
  
  from twisted.web import xmlrpc, server
***************
*** 98,102 ****
  from twisted.python import log
  
- import config #config must always be the first freeevo module imported
  from util.marmalade import jellyToXML, unjellyFromXML
  
--- 82,85 ----
***************
*** 181,185 ****
          _debug_("SAVE: ScheduledRecordings has %s items." % \
                  len(scheduledRecordings.programList))
!         f = open(config.TV_RECORD_SCHEDULE, 'w')
          jellyToXML(scheduledRecordings, f)
          f.close()
--- 164,173 ----
          _debug_("SAVE: ScheduledRecordings has %s items." % \
                  len(scheduledRecordings.programList))
!         try:
!             f = open(config.TV_RECORD_SCHEDULE, 'w')
!         except IOError:
!             os.unlink(config.TV_RECORD_SCHEDULE)
!             f = open(config.TV_RECORD_SCHEDULE, 'w')
!             
          jellyToXML(scheduledRecordings, f)
          f.close()
***************
*** 827,831 ****
          _debug_('top of the minute in %s seconds' % next_minute)
          reactor.callLater(next_minute, self.minuteCheck)
! 
      def minuteCheck(self):
          next_minute = (int(time.time()/60) * 60 + 60) - int(time.time())
--- 815,819 ----
          _debug_('top of the minute in %s seconds' % next_minute)
          reactor.callLater(next_minute, self.minuteCheck)
!         
      def minuteCheck(self):
          next_minute = (int(time.time()/60) * 60 + 60) - int(time.time())
***************
*** 948,951 ****
--- 936,940 ----
      import traceback
      import time
+ 
      while 1:
          try:



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to