Set date attributes to none if nothing given, rather than don't set the attributes
This commit is contained in:
14
red_fam.py
14
red_fam.py
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
class RED_FAM:
|
class RED_FAM:
|
||||||
|
|
||||||
@@ -14,17 +15,17 @@ class RED_FAM:
|
|||||||
|
|
||||||
self.__articlesList = articlesList
|
self.__articlesList = articlesList
|
||||||
|
|
||||||
# Make sure we have 8 entrys for pages, if not fill with empty list items
|
|
||||||
while len( self.__articlesList ) < 8:
|
|
||||||
self.__articlesList.append( "" )
|
|
||||||
|
|
||||||
self.__hash = self.__get_fam_hash( )
|
self.__hash = self.__get_fam_hash( )
|
||||||
|
|
||||||
if( beginning ):
|
if( beginning ):
|
||||||
self.__beginning = beginning
|
self.__beginning = beginning
|
||||||
|
else:
|
||||||
|
self.__beginning = None
|
||||||
|
|
||||||
if( ending ):
|
if( ending ):
|
||||||
self.__ending = ending
|
self.__ending = ending
|
||||||
|
else:
|
||||||
|
self.__ending = None
|
||||||
|
|
||||||
self.__status = status # __TODO__ STATUS CODE
|
self.__status = status # __TODO__ STATUS CODE
|
||||||
|
|
||||||
@@ -65,12 +66,13 @@ class RED_FAM:
|
|||||||
|
|
||||||
def __repr__( self ):
|
def __repr__( self ):
|
||||||
|
|
||||||
if( hasattr( self, "__beginning" ) ):
|
if( self.__beginning ):
|
||||||
|
print( self.__beginning )
|
||||||
beginning = ", beginning=" + repr( self.__beginning )
|
beginning = ", beginning=" + repr( self.__beginning )
|
||||||
else:
|
else:
|
||||||
beginning = ""
|
beginning = ""
|
||||||
|
|
||||||
if( hasattr( self, "__ending" ) ):
|
if( self.__ending ):
|
||||||
ending = ", ending=" + repr( self.__ending )
|
ending = ", ending=" + repr( self.__ending )
|
||||||
else:
|
else:
|
||||||
ending = ""
|
ending = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user