~ubuntu-branches/ubuntu/trusty/pycalendar/trusty

« back to all changes in this revision

Viewing changes to src/pycalendar/plaintextvalue.py

  • Committer: Package Import Robot
  • Author(s): Rahul Amaram
  • Date: 2012-05-29 12:42:34 UTC
  • Revision ID: package-import@ubuntu.com-20120529124234-mzwu4vw4chh0sc1f
Tags: upstream-2.0~svn188
ImportĀ upstreamĀ versionĀ 2.0~svn188

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##
 
2
#    Copyright (c) 2007 Cyrus Daboo. All rights reserved.
 
3
#    
 
4
#    Licensed under the Apache License, Version 2.0 (the "License");
 
5
#    you may not use this file except in compliance with the License.
 
6
#    You may obtain a copy of the License at
 
7
#    
 
8
#        http://www.apache.org/licenses/LICENSE-2.0
 
9
#    
 
10
#    Unless required by applicable law or agreed to in writing, software
 
11
#    distributed under the License is distributed on an "AS IS" BASIS,
 
12
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
#    See the License for the specific language governing permissions and
 
14
#    limitations under the License.
 
15
##
 
16
 
 
17
# iCalendar UTC Offset value
 
18
 
 
19
from pycalendar.value import PyCalendarValue
 
20
 
 
21
class PyCalendarPlainTextValue( PyCalendarValue ):
 
22
 
 
23
    def __init__(self, value=''):
 
24
        self.mValue = value
 
25
 
 
26
    def duplicate(self):
 
27
        return self.__class__(self.mValue)
 
28
 
 
29
    def parse( self, data ):
 
30
        # No decoding required
 
31
        self.mValue = data
 
32
        
 
33
    # os - StringIO object
 
34
    def generate( self, os ):
 
35
        try:
 
36
            # No encoding required
 
37
            os.write( self.mValue )
 
38
        except:
 
39
            pass
 
40
 
 
41
    def writeXML(self, node, namespace):
 
42
        value = self.getXMLNode(node, namespace)
 
43
        value.text = self.mValue
 
44
 
 
45
    def getValue(self):
 
46
        return self.mValue
 
47
 
 
48
    def setValue( self, value ):
 
49
        self.mValue = value