Remove swear words from source code
This commit is contained in:
parent
9de8b6634c
commit
577bbf14b6
10 changed files with 22 additions and 26 deletions
|
@ -1276,7 +1276,7 @@ class Application_Model_Preference
|
||||||
return $ds['ColReorder'][$x];
|
return $ds['ColReorder'][$x];
|
||||||
} else {
|
} else {
|
||||||
/*For now we just have this hack for debugging. We should not
|
/*For now we just have this hack for debugging. We should not
|
||||||
rely on this crappy behaviour in case of failure*/
|
rely on this behaviour in case of failure*/
|
||||||
Logging::warn("Index $x does not exist preferences");
|
Logging::warn("Index $x does not exist preferences");
|
||||||
Logging::warn("Defaulting to identity and printing preferences");
|
Logging::warn("Defaulting to identity and printing preferences");
|
||||||
Logging::warn($ds);
|
Logging::warn($ds);
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ class Application_Service_HistoryService
|
||||||
TEMPLATE_TIME => "strval",
|
TEMPLATE_TIME => "strval",
|
||||||
TEMPLATE_DATETIME => "strval",
|
TEMPLATE_DATETIME => "strval",
|
||||||
TEMPLATE_STRING => "strval",
|
TEMPLATE_STRING => "strval",
|
||||||
TEMPLATE_BOOLEAN => "intval", //boolval only exists in php 5.5+ wtf?
|
TEMPLATE_BOOLEAN => "intval", //boolval only exists in php 5.5+
|
||||||
TEMPLATE_INT => "intval",
|
TEMPLATE_INT => "intval",
|
||||||
TEMPLATE_FLOAT => "floatval",
|
TEMPLATE_FLOAT => "floatval",
|
||||||
);
|
);
|
||||||
|
|
|
@ -188,7 +188,7 @@ build/
|
||||||
book.schema.sql // contains CREATE TABLE book and CREATE TABLE review
|
book.schema.sql // contains CREATE TABLE book and CREATE TABLE review
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
And, as you probably expect it, a package overridden at the table level also acocunts for an independent SQL file:
|
And, as you probably expect it, a package overridden at the table level also accounts for an independent SQL file:
|
||||||
|
|
||||||
{{{
|
{{{
|
||||||
build/
|
build/
|
||||||
|
|
|
@ -234,7 +234,7 @@ class AirtimeApiClient(object):
|
||||||
|
|
||||||
def get_schedule(self):
|
def get_schedule(self):
|
||||||
# TODO : properly refactor this routine
|
# 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())
|
try: return (True, self.services.export_url())
|
||||||
except: return (False, None)
|
except: return (False, None)
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ class Organizer(ReportHandler,Loggable):
|
||||||
mmp.magic_move(event.path, new_path,
|
mmp.magic_move(event.path, new_path,
|
||||||
after_dir_make=new_dir_watch(dirname(new_path)))
|
after_dir_make=new_dir_watch(dirname(new_path)))
|
||||||
|
|
||||||
# The reason we need to go around saving the owner in this ass
|
# The reason we need to go around saving the owner in this
|
||||||
# backwards way is bewcause we are unable to encode the owner id
|
# backwards way is because we are unable to encode the owner id
|
||||||
# into the file itself so that the StoreWatchListener listener can
|
# into the file itself so that the StoreWatchListener listener can
|
||||||
# detect it from the file
|
# detect it from the file
|
||||||
user().owner.add_file_owner(new_path, owner_id )
|
user().owner.add_file_owner(new_path, owner_id )
|
||||||
|
|
|
@ -58,12 +58,9 @@ class AirtimeInstance(object):
|
||||||
def mm_config(self):
|
def mm_config(self):
|
||||||
return MMConfig(self.config_paths['media_monitor'])
|
return MMConfig(self.config_paths['media_monitor'])
|
||||||
|
|
||||||
# NOTE to future code monkeys:
|
# I'm well aware that I'm using the service locator pattern
|
||||||
# I'm well aware that I'm using the shitty service locator pattern
|
# instead of normal constructor injection as I should be.
|
||||||
# instead of normal constructor injection as I should be. The reason
|
# It's recommended to rewrite this using proper constructor injection
|
||||||
# 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
|
|
||||||
|
|
||||||
@LazyProperty
|
@LazyProperty
|
||||||
def owner(self): return Owner()
|
def owner(self): return Owner()
|
||||||
|
|
|
@ -5,7 +5,7 @@ import getopt
|
||||||
import pyinotify
|
import pyinotify
|
||||||
import pprint
|
import pprint
|
||||||
|
|
||||||
# a little shit script to test out pyinotify events
|
# a little script to test out pyinotify events
|
||||||
|
|
||||||
class AT(pyinotify.ProcessEvent):
|
class AT(pyinotify.ProcessEvent):
|
||||||
def process_default(self, event):
|
def process_default(self, event):
|
||||||
|
|
|
@ -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
|
# configures all of that
|
||||||
|
|
||||||
music_folder = u'/home/rudi/music'
|
music_folder = u'/home/rudi/music'
|
||||||
o_path = u'/home/rudi/throwaway/ACDC_-_Back_In_Black-sample-64kbps.ogg'
|
o_path = u'/home/rudi/throwaway/ACDC_-_Back_In_Black-sample-64kbps.ogg'
|
||||||
watch_path = u'/home/rudi/throwaway/fucking_around/watch/',
|
watch_path = u'/home/rudi/throwaway/watch/',
|
||||||
real_path1 = u'/home/rudi/throwaway/fucking_around/watch/unknown/unknown/ACDC_-_Back_In_Black-sample-64kbps-64kbps.ogg'
|
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/"
|
opath = u"/home/rudi/Airtime/python_apps/media-monitor2/tests/"
|
||||||
ppath = u"/home/rudi/Airtime/python_apps/media-monitor2/media/"
|
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
|
# holdover from the time we had a special config for testing
|
||||||
sample_config = api_client_path
|
sample_config = api_client_path
|
||||||
real_config = api_client_path
|
real_config = api_client_path
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,22 @@ DeleteFile
|
||||||
class TestMMP(unittest.TestCase):
|
class TestMMP(unittest.TestCase):
|
||||||
def test_event_registered(self):
|
def test_event_registered(self):
|
||||||
ev = EventContractor()
|
ev = EventContractor()
|
||||||
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
e2 = MoveFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e2 = MoveFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
ev.register(e1)
|
ev.register(e1)
|
||||||
self.assertTrue( ev.event_registered(e2) )
|
self.assertTrue( ev.event_registered(e2) )
|
||||||
|
|
||||||
def test_get_old_event(self):
|
def test_get_old_event(self):
|
||||||
ev = EventContractor()
|
ev = EventContractor()
|
||||||
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
e2 = MoveFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e2 = MoveFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
ev.register(e1)
|
ev.register(e1)
|
||||||
self.assertEqual( ev.get_old_event(e2), e1 )
|
self.assertEqual( ev.get_old_event(e2), e1 )
|
||||||
|
|
||||||
def test_register(self):
|
def test_register(self):
|
||||||
ev = EventContractor()
|
ev = EventContractor()
|
||||||
e1 = NewFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e1 = NewFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
e2 = DeleteFile( FakePyinotify('bullshit.mp3') ).proxify()
|
e2 = DeleteFile( FakePyinotify('bull.mp3') ).proxify()
|
||||||
self.assertTrue( ev.register(e1) )
|
self.assertTrue( ev.register(e1) )
|
||||||
|
|
||||||
self.assertFalse( ev.register(e2) )
|
self.assertFalse( ev.register(e2) )
|
||||||
|
@ -33,14 +33,14 @@ class TestMMP(unittest.TestCase):
|
||||||
self.assertEqual( delete_ev['mode'], u'delete')
|
self.assertEqual( delete_ev['mode'], u'delete')
|
||||||
self.assertEqual( len(ev.store.keys()), 0 )
|
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(e3) )
|
||||||
self.assertTrue( ev.register(e2) )
|
self.assertTrue( ev.register(e2) )
|
||||||
|
|
||||||
|
|
||||||
def test_register2(self):
|
def test_register2(self):
|
||||||
ev = EventContractor()
|
ev = EventContractor()
|
||||||
p = 'bullshit.mp3'
|
p = 'bull.mp3'
|
||||||
events = [
|
events = [
|
||||||
NewFile( FakePyinotify(p) ),
|
NewFile( FakePyinotify(p) ),
|
||||||
NewFile( FakePyinotify(p) ),
|
NewFile( FakePyinotify(p) ),
|
||||||
|
|
|
@ -38,7 +38,7 @@ class TestMMP(unittest.TestCase):
|
||||||
m1 = mmp.file_md5(p)
|
m1 = mmp.file_md5(p)
|
||||||
m2 = mmp.file_md5(p,10)
|
m2 = mmp.file_md5(p,10)
|
||||||
self.assertTrue( m1 != m2 )
|
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) )
|
self.assertTrue( m1 == mmp.file_md5(p) )
|
||||||
|
|
||||||
def test_sub_path(self):
|
def test_sub_path(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue