~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to src/calibre/devices/prs500/prstypes.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
    # Length of the data part of this packet
285
285
    length = field(start=12, fmt=DWORD) 
286
286
    
287
 
    @apply
288
 
    def data():
 
287
    @dynamic_property
 
288
    def data(self):
289
289
        doc = \
290
290
        """ 
291
291
        The data part of this command. Returned/set as/by a TransferBuffer. 
447
447
        self.length  = 16
448
448
        self.command = command
449
449
    
450
 
    @apply
451
 
    def command():
 
450
    @dynamic_property
 
451
    def command(self):
452
452
        doc = \
453
453
        """ 
454
454
        Usually carries extra information needed for the command
568
568
        PathCommand.__init__(self, path, FileOpen.NUMBER, path_len_at_byte=20)
569
569
        self.mode = mode
570
570
    
571
 
    @apply
572
 
    def mode():
 
571
    @dynamic_property
 
572
    def mode(self):
573
573
        doc = \
574
574
                    """ 
575
575
                    The file open mode. Is either L{FileOpen.READ} 
651
651
            raise PacketError("Response packets must have their number set to " \
652
652
            + hex(0x00001000))
653
653
    
654
 
    @apply
655
 
    def data():
 
654
    @dynamic_property
 
655
    def data(self):
656
656
        doc = \
657
657
                  """ 
658
658
                  The last 3 DWORDs (12 bytes) of data in this 
681
681
    PATH_NOT_FOUND = 0xffffffd7 #: Queried path is not found 
682
682
    PERMISSION_DENIED = 0xffffffd6 #: Permission denied
683
683
    
684
 
    @apply
685
 
    def is_file():
 
684
    @dynamic_property
 
685
    def is_file(self):
686
686
        doc = """ True iff queried path is a file """
687
687
        def fget(self):      
688
688
            return self.code == ListResponse.IS_FILE
689
689
        return property(doc=doc, fget=fget)
690
690
    
691
 
    @apply
692
 
    def is_invalid():
 
691
    @dynamic_property
 
692
    def is_invalid(self):
693
693
        doc = """ True iff queried path is invalid """
694
694
        def fget(self):    
695
695
            return self.code == ListResponse.IS_INVALID
696
696
        return property(doc=doc, fget=fget)
697
697
    
698
 
    @apply
699
 
    def path_not_found():
 
698
    @dynamic_property
 
699
    def path_not_found(self):
700
700
        doc = """ True iff queried path is not found """
701
701
        def fget(self):    
702
702
            return self.code == ListResponse.PATH_NOT_FOUND
703
703
        return property(doc=doc, fget=fget)
704
704
    
705
 
    @apply
706
 
    def permission_denied():
 
705
    @dynamic_property
 
706
    def permission_denied(self):
707
707
        doc = """ True iff permission is denied for path operations """
708
708
        def fget(self):    
709
709
            return self.code == ListResponse.PERMISSION_DENIED
710
710
        return property(doc=doc, fget=fget)
711
711
    
712
 
    @apply
713
 
    def is_unmounted():
 
712
    @dynamic_property
 
713
    def is_unmounted(self):
714
714
        doc = """ True iff queried path is unmounted (i.e. removed storage card) """
715
715
        def fget(self):
716
716
            return self.code == ListResponse.IS_UNMOUNTED
717
717
        return property(doc=doc, fget=fget)
718
718
    
719
 
    @apply
720
 
    def is_eol():
 
719
    @dynamic_property
 
720
    def is_eol(self):
721
721
        doc = """ True iff there are no more items in the list """
722
722
        def fget(self):
723
723
            return self.code == ListResponse.IS_EOL
759
759
    # 0 = default permissions, 4 = read only
760
760
    permissions = field(start=36, fmt=DWORD)  
761
761
    
762
 
    @apply
763
 
    def is_dir():
 
762
    @dynamic_property
 
763
    def is_dir(self):
764
764
        doc = """True if path points to a directory, False if it points to a file."""    
765
765
        
766
766
        def fget(self):
776
776
        return property(doc=doc, fget=fget, fset=fset)
777
777
    
778
778
    
779
 
    @apply
780
 
    def is_readonly():
 
779
    @dynamic_property
 
780
    def is_readonly(self):
781
781
        doc = """ Whether this file is readonly."""
782
782
        
783
783
        def fget(self):
801
801
    
802
802
    """ Defines the structure of packets that contain identifiers for queries. """
803
803
    
804
 
    @apply
805
 
    def id():
 
804
    @dynamic_property
 
805
    def id(self):
806
806
        doc = \
807
807
        """ 
808
808
        The identifier. C{unsigned int} stored in 4 bytes 
841
841
    name_length = field(start=20, fmt=DWORD)
842
842
    name        = stringfield(name_length, start=24)
843
843
    
844
 
    @apply
845
 
    def is_dir():
 
844
    @dynamic_property
 
845
    def is_dir(self):
846
846
        doc = \
847
847
        """ 
848
848
        True if list item points to a directory, False if it points to a file.
859
859
        
860
860
        return property(doc=doc, fget=fget, fset=fset)
861
861
 
862