# Path: chirp/common/timestamp.py
# _TIMESTAMP_FORMAT = "%Y%m%d-%H%M%S"
# _PRETTY_FORMAT = "%c"
# PROCESS_START_TIME = time.time()  # time of importing this file
# _MIN_REASONABLE_TIMESTAMP = parse_human_readable("20081130-000000")
# _MAX_REASONABLE_TIMESTAMP = parse_human_readable("20380119-000000")
# _SECONDS_PER_MINUTE = 60
# _SECONDS_PER_HOUR = 60 * _SECONDS_PER_MINUTE
# _SECONDS_PER_DAY = 24 * _SECONDS_PER_HOUR
# def now():
# def now_ms():
# def process_start_time_ms():
# def process_age_ms():
# def get_human_readable(ts=None):
# def get_human_readable_ms(ms_ts):
# def get_pretty(ts=None):
# def get_pretty_ms(ms_ts):
# def parse_human_readable(human_readable_str):
# def is_valid(ts):
# def get_human_readable_duration(duration_s):
#     def _pluralize(n, unit):
# def get_human_readable_duration_ms(duration_ms):
# 
# Path: chirp/library/constants.py
# USER = "music-library"
# TFLT_WHITELIST = set((
#         u"MPG/3",   # MPEG 1/2 layer III (i.e. MP3)
# ))
# TOWN_FILE_OWNER = u"The Chicago Independent Radio Project"
# UFID_OWNER_IDENTIFIER = u"http://chirpradio.org/_ufid/1"
# MUTAGEN_UFID_KEY = u"UFID:%s" % UFID_OWNER_IDENTIFIER
# TXXX_ALBUM_ID_DESCRIPTION = u"CHIRP Album ID"
# TXXX_ALBUM_ID_KEY = u"TXXX:%s" % TXXX_ALBUM_ID_DESCRIPTION
# TXXX_FRAME_COUNT_DESCRIPTION = u"Frame Count"
# TXXX_FRAME_COUNT_KEY = u"TXXX:%s" % TXXX_FRAME_COUNT_DESCRIPTION
# TXXX_FRAME_SIZE_DESCRIPTION = u"Frame Size"
# TXXX_FRAME_SIZE_KEY = u"TXXX:%s" % TXXX_FRAME_SIZE_DESCRIPTION
# DEFAULT_ID3_TEXT_ENCODING = 3  # 3 == UTF-8
# TIT2_IMPORT_GUEST_FORMAT = " (w/ %(guest)s)"
# ID3_TAG_BLACKLIST = set((
#         # Terms of use frame: we do not want any files in the library that
#         # have special terms.
#         # TODO(trow): Uncomment this.
#         # "USER",
#         ))
# ID3_TAG_WHITELIST = set((
#         "TALB",  # Album/Movie/Show title
#         "TBPM",  # Beats per minute,
#         "TCOM",  # Composer
#         "TCON",  # Content type
#         "TCOP",  # Copyright
#         "TDLY",  # Playlist delay
#         "TDOR",  # Original release time
#         "TDRC",  # Recording time
#         "TDRL",  # Release time
#         "TDTG",  # Tagging time
#         "TENC",  # Encoded by
#         "TEXT",  # Lyricist/text writer
#         "TFLT",  # File type
#         "TIT1",  # Content group description
#         "TIT2",  # Title/songname/content description
#         "TIT3",  # Subtitle/Description refinement
#         "TKEY",  # Initial key
#         "TLAN",  # Language
#         "TLEN",  # Length
#         "TMED",  # Media type
#         "TOAL",  # Original album/movie/show title
#         "TOLY",  # Original lyricist(s)/text writer(s)
#         "TOPE",  # Original artist(s)/performer(s)
#         "TOWN",  # File owner
#         "TPE1",  # Lead performer(s)/Soloist(s)
#         "TPE2",  # Band/orchestra/accompaniment
#         "TPE3",  # Conductor/performer refinement
#         "TPE4",  # Interpreted, remixed, or otherwise modified by
#         "TPOS",  # Part of a set
#         "TPUB",  # Publisher
#         "TRCK",  # Track number/position in set
#         "TRSN",  # Internet radio station name
#         "TRSO",  # Internet radio station owner
#         "TSOA",  # Album sort order
#         "TSOP",  # Performer sort order
#         "TSOT",  # Title sort order
#         "TSRC",  # ISRC (international standard recording code)
#         "TSSE",  # Software/hardware and settings used when encoding
# 
#         "UFID",  # Unique file identifier
# 
#         TXXX_ALBUM_ID_KEY,  # Used to store the album's ID.
#         TXXX_FRAME_COUNT_KEY,  # The number of MP3 frames in this file.
#         TXXX_FRAME_SIZE_KEY,   # The size in bytes of all the MP3 frames.
# ))
# ID3_TAG_STRIPPED_ON_IMPORT = set((
#         "TFLT",  # File type
#         "TLEN",  # Length
#         "TOWN",  # File owner
# ))
# ID3_TAG_REQUIRED = set((
#         "TFLT",  # File type
#         "TIT2",  # Title/songname/content description
#         "TLEN",  # Length
#         "TOWN",  # File owner
#         "TPE1",  # Lead performer(s)/Soloist(s)
#         "TRCK",  # Track number/position in set
#         MUTAGEN_UFID_KEY,  # Unique file identifier for CHIRP
#         TXXX_ALBUM_ID_KEY,  # Used to store the album's ID.
#         TXXX_FRAME_COUNT_KEY,  # The number of MP3 frames in this file.
#         TXXX_FRAME_SIZE_KEY,   # The size in bytes of all the MP3 frames.
# ))
# 
# Path: chirp/library/ufid.py
# def ufid(volume, import_timestamp, fingerprint):
#     """Returns a full UFID string.
# 
#     Args:
#       volume: An integer volume number
#       import_timestamp: A integer timestamp
#       fingerprint: A string containing a fingerprint
# 
#     Returns:
#       A string containing a UFID.
#     """
#     return ufid_prefix(volume, import_timestamp) + fingerprint


import unittest
from chirp.common import timestamp
from chirp.library import constants
from chirp.library import ufid
#!/usr/bin/env python




class UFIDTest(unittest.TestCase):

    def test_basic(self):
        test_vol = 11

# Path: chirp/common/timestamp.py
# _TIMESTAMP_FORMAT = "%Y%m%d-%H%M%S"
# _PRETTY_FORMAT = "%c"
# PROCESS_START_TIME = time.time()  # time of importing this file
# _MIN_REASONABLE_TIMESTAMP = parse_human_readable("20081130-000000")
# _MAX_REASONABLE_TIMESTAMP = parse_human_readable("20380119-000000")
# _SECONDS_PER_MINUTE = 60
# _SECONDS_PER_HOUR = 60 * _SECONDS_PER_MINUTE
# _SECONDS_PER_DAY = 24 * _SECONDS_PER_HOUR
# def now():
# def now_ms():
# def process_start_time_ms():
# def process_age_ms():
# def get_human_readable(ts=None):
# def get_human_readable_ms(ms_ts):
# def get_pretty(ts=None):
# def get_pretty_ms(ms_ts):
# def parse_human_readable(human_readable_str):
# def is_valid(ts):
# def get_human_readable_duration(duration_s):
#     def _pluralize(n, unit):
# def get_human_readable_duration_ms(duration_ms):
# 
# Path: chirp/library/constants.py
# USER = "music-library"
# TFLT_WHITELIST = set((
#         u"MPG/3",   # MPEG 1/2 layer III (i.e. MP3)
# ))
# TOWN_FILE_OWNER = u"The Chicago Independent Radio Project"
# UFID_OWNER_IDENTIFIER = u"http://chirpradio.org/_ufid/1"
# MUTAGEN_UFID_KEY = u"UFID:%s" % UFID_OWNER_IDENTIFIER
# TXXX_ALBUM_ID_DESCRIPTION = u"CHIRP Album ID"
# TXXX_ALBUM_ID_KEY = u"TXXX:%s" % TXXX_ALBUM_ID_DESCRIPTION
# TXXX_FRAME_COUNT_DESCRIPTION = u"Frame Count"
# TXXX_FRAME_COUNT_KEY = u"TXXX:%s" % TXXX_FRAME_COUNT_DESCRIPTION
# TXXX_FRAME_SIZE_DESCRIPTION = u"Frame Size"
# TXXX_FRAME_SIZE_KEY = u"TXXX:%s" % TXXX_FRAME_SIZE_DESCRIPTION
# DEFAULT_ID3_TEXT_ENCODING = 3  # 3 == UTF-8
# TIT2_IMPORT_GUEST_FORMAT = " (w/ %(guest)s)"
# ID3_TAG_BLACKLIST = set((
#         # Terms of use frame: we do not want any files in the library that
#         # have special terms.
#         # TODO(trow): Uncomment this.
#         # "USER",
#         ))
# ID3_TAG_WHITELIST = set((
#         "TALB",  # Album/Movie/Show title
#         "TBPM",  # Beats per minute,
#         "TCOM",  # Composer
#         "TCON",  # Content type
#         "TCOP",  # Copyright
#         "TDLY",  # Playlist delay
#         "TDOR",  # Original release time
#         "TDRC",  # Recording time
#         "TDRL",  # Release time
#         "TDTG",  # Tagging time
#         "TENC",  # Encoded by
#         "TEXT",  # Lyricist/text writer
#         "TFLT",  # File type
#         "TIT1",  # Content group description
#         "TIT2",  # Title/songname/content description
#         "TIT3",  # Subtitle/Description refinement
#         "TKEY",  # Initial key
#         "TLAN",  # Language
#         "TLEN",  # Length
#         "TMED",  # Media type
#         "TOAL",  # Original album/movie/show title
#         "TOLY",  # Original lyricist(s)/text writer(s)
#         "TOPE",  # Original artist(s)/performer(s)
#         "TOWN",  # File owner
#         "TPE1",  # Lead performer(s)/Soloist(s)
#         "TPE2",  # Band/orchestra/accompaniment
#         "TPE3",  # Conductor/performer refinement
#         "TPE4",  # Interpreted, remixed, or otherwise modified by
#         "TPOS",  # Part of a set
#         "TPUB",  # Publisher
#         "TRCK",  # Track number/position in set
#         "TRSN",  # Internet radio station name
#         "TRSO",  # Internet radio station owner
#         "TSOA",  # Album sort order
#         "TSOP",  # Performer sort order
#         "TSOT",  # Title sort order
#         "TSRC",  # ISRC (international standard recording code)
#         "TSSE",  # Software/hardware and settings used when encoding
# 
#         "UFID",  # Unique file identifier
# 
#         TXXX_ALBUM_ID_KEY,  # Used to store the album's ID.
#         TXXX_FRAME_COUNT_KEY,  # The number of MP3 frames in this file.
#         TXXX_FRAME_SIZE_KEY,   # The size in bytes of all the MP3 frames.
# ))
# ID3_TAG_STRIPPED_ON_IMPORT = set((
#         "TFLT",  # File type
#         "TLEN",  # Length
#         "TOWN",  # File owner
# ))
# ID3_TAG_REQUIRED = set((
#         "TFLT",  # File type
#         "TIT2",  # Title/songname/content description
#         "TLEN",  # Length
#         "TOWN",  # File owner
#         "TPE1",  # Lead performer(s)/Soloist(s)
#         "TRCK",  # Track number/position in set
#         MUTAGEN_UFID_KEY,  # Unique file identifier for CHIRP
#         TXXX_ALBUM_ID_KEY,  # Used to store the album's ID.
#         TXXX_FRAME_COUNT_KEY,  # The number of MP3 frames in this file.
#         TXXX_FRAME_SIZE_KEY,   # The size in bytes of all the MP3 frames.
# ))
# 
# Path: chirp/library/ufid.py
# def ufid(volume, import_timestamp, fingerprint):
#     """Returns a full UFID string.
# 
#     Args:
#       volume: An integer volume number
#       import_timestamp: A integer timestamp
#       fingerprint: A string containing a fingerprint
# 
#     Returns:
#       A string containing a UFID.
#     """
#     return ufid_prefix(volume, import_timestamp) + fingerprint


# Path: chirp/library/ufid_test.py
import unittest
from chirp.common import timestamp
from chirp.library import constants
from chirp.library import ufid

#!/usr/bin/env python




class UFIDTest(unittest.TestCase):

    def test_basic(self):
        test_vol = 11

        test_ts_human = "20090102-030405"