Remove swear words from source code

This commit is contained in:
Daniel James 2013-09-23 16:16:51 +01:00
parent 9de8b6634c
commit 577bbf14b6
10 changed files with 22 additions and 26 deletions

View file

@ -234,7 +234,7 @@ class AirtimeApiClient(object):
def get_schedule(self):
# TODO : properly refactor this routine
# For now the return type is a little fucked for compatibility reasons
# For now the return type is a little messed up for compatibility reasons
try: return (True, self.services.export_url())
except: return (False, None)

View file

@ -70,8 +70,8 @@ class Organizer(ReportHandler,Loggable):
mmp.magic_move(event.path, new_path,
after_dir_make=new_dir_watch(dirname(new_path)))
# The reason we need to go around saving the owner in this ass
# backwards way is bewcause we are unable to encode the owner id
# The reason we need to go around saving the owner in this
# backwards way is because we are unable to encode the owner id
# into the file itself so that the StoreWatchListener listener can
# detect it from the file
user().owner.add_file_owner(new_path, owner_id )

View file

@ -58,12 +58,9 @@ class AirtimeInstance(object):
def mm_config(self):
return MMConfig(self.config_paths['media_monitor'])
# NOTE to future code monkeys:
# I'm well aware that I'm using the shitty service locator pattern
# instead of normal constructor injection as I should be. The reason
# for this is that I found these issues a little too close to the
# end of my tenure. It's highly recommended to rewrite this crap
# using proper constructor injection if you ever have the time
# I'm well aware that I'm using the service locator pattern
# instead of normal constructor injection as I should be.
# It's recommended to rewrite this using proper constructor injection
@LazyProperty
def owner(self): return Owner()

View file

@ -5,7 +5,7 @@ import getopt
import pyinotify
import pprint
# a little shit script to test out pyinotify events
# a little script to test out pyinotify events
class AT(pyinotify.ProcessEvent):
def process_default(self, event):

View file

@ -1,10 +1,10 @@
# The tests rely on a lot of absolute paths and other garbage so this file
# The tests rely on a lot of absolute paths so this file
# configures all of that
music_folder = u'/home/rudi/music'
o_path = u'/home/rudi/throwaway/ACDC_-_Back_In_Black-sample-64kbps.ogg'
watch_path = u'/home/rudi/throwaway/fucking_around/watch/',
real_path1 = u'/home/rudi/throwaway/fucking_around/watch/unknown/unknown/ACDC_-_Back_In_Black-sample-64kbps-64kbps.ogg'
watch_path = u'/home/rudi/throwaway/watch/',
real_path1 = u'/home/rudi/throwaway/watch/unknown/unknown/ACDC_-_Back_In_Black-sample-64kbps-64kbps.ogg'
opath = u"/home/rudi/Airtime/python_apps/media-monitor2/tests/"
ppath = u"/home/rudi/Airtime/python_apps/media-monitor2/media/"
@ -12,4 +12,3 @@ api_client_path = '/etc/airtime/api_client.cfg'
# holdover from the time we had a special config for testing
sample_config = api_client_path
real_config = api_client_path

View file

@ -7,22 +7,22 @@ DeleteFile
class TestMMP(unittest.TestCase):
def test_event_registered(self):
ev = EventContractor()
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
e2 = MoveFile( FakePyinotify('bullshit.mp3') ).proxify()
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
e2 = MoveFile( FakePyinotify('bull.mp3') ).proxify()
ev.register(e1)
self.assertTrue( ev.event_registered(e2) )
def test_get_old_event(self):
ev = EventContractor()
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
e2 = MoveFile( FakePyinotify('bullshit.mp3') ).proxify()
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
e2 = MoveFile( FakePyinotify('bull.mp3') ).proxify()
ev.register(e1)
self.assertEqual( ev.get_old_event(e2), e1 )
def test_register(self):
ev = EventContractor()
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
e2 = DeleteFile( FakePyinotify('bullshit.mp3') ).proxify()
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
e2 = DeleteFile( FakePyinotify('bull.mp3') ).proxify()
self.assertTrue( ev.register(e1) )
self.assertFalse( ev.register(e2) )
@ -33,14 +33,14 @@ class TestMMP(unittest.TestCase):
self.assertEqual( delete_ev['mode'], u'delete')
self.assertEqual( len(ev.store.keys()), 0 )
e3 = DeleteFile( FakePyinotify('horseshit.mp3') ).proxify()
e3 = DeleteFile( FakePyinotify('horse.mp3') ).proxify()
self.assertTrue( ev.register(e3) )
self.assertTrue( ev.register(e2) )
def test_register2(self):
ev = EventContractor()
p = 'bullshit.mp3'
p = 'bull.mp3'
events = [
NewFile( FakePyinotify(p) ),
NewFile( FakePyinotify(p) ),

View file

@ -38,7 +38,7 @@ class TestMMP(unittest.TestCase):
m1 = mmp.file_md5(p)
m2 = mmp.file_md5(p,10)
self.assertTrue( m1 != m2 )
self.assertRaises( ValueError, lambda : mmp.file_md5('/bull/shit/path') )
self.assertRaises( ValueError, lambda : mmp.file_md5('/file/path') )
self.assertTrue( m1 == mmp.file_md5(p) )
def test_sub_path(self):