Example #1
0
def fetchdata(filelist):
    "return list of lists of images per directory specified in assumed-sorted filelist"
    imagelist = [ddict.ddict(x) for x in json.loads(invoke_exiftool(filelist))]
    imagedata = []
    currentslice = []
    last = imagelist[0]
    for image in imagelist:
        thisDir = os.path.dirname(image.SourceFile)
        if not currentslice:
            currentslice.append(image)
        else:
            if lastDir == thisDir:
                currentslice.append(image)
            else:
                imagedata.append(currentslice)
                currentslice = [image]
        lastDir = thisDir
    imagedata.append(currentslice)
    return imagedata
Example #2
0
	def __init__(self):
		self.lenny = None
		self.lennies = None
		self.emotes = None
		self.stickers = None
		self.skype = ddict()
		self.voiceToTextChannelMap = None
		self.textToVoiceChannelMap = None
		self.sqlConnection = None

		print(Lutils.TitleBox("Loading Resources"))

		self.lenny = "( ͡° ͜ʖ ͡°)"
		print("Loaded Lenny.")

		self.lennies = ["""░░░░░░░░░░░░▄▄▄▄░░░░░░░░░░░░░░░░░░░░░░░▄▄▄▄▄
░░░█░░░░▄▀█▀▀▄░░▀▀▀▄░░░░▐█░░░░░░░░░▄▀█▀▀▄░░░▀█▄
░░█░░░░▀░▐▌░░▐▌░░░░░▀░░░▐█░░░░░░░░▀░▐▌░░▐▌░░░░█▀
░▐▌░░░░░░░▀▄▄▀░░░░░░░░░░▐█▄▄░░░░░░░░░▀▄▄▀░░░░░▐▌
░█░░░░░░░░░░░░░░░░░░░░░░░░░▀█░░░░░░░░░░░░░░░░░░█
▐█░░░░░░░░░░░░░░░░░░░░░░░░░░█▌░░░░░░░░░░░░░░░░░█
▐█░░░░░░░░░░░░░░░░░░░░░░░░░░█▌░░░░░░░░░░░░░░░░░█
░█░░░░░░░░░░░░░░░░░░░░█▄░░░▄█░░░░░░░░░░░░░░░░░░█
░▐▌░░░░░░░░░░░░░░░░░░░░▀███▀░░░░░░░░░░░░░░░░░░▐▌
░░█░░░░░░░░░░░░░░░░░▀▄░░░░░░░░░░▄▀░░░░░░░░░░░░█
░░░█░░░░░░░░░░░░░░░░░░▀▄▄▄▄▄▄▄▀▀░░░░░░░░░░░░░█""", "ヽ( ͡° ͜ʖ ͡°)ノ", "( ͡° ͜ʖ ͡°)", "( ͠° ͟ʖ ͡°)", "ᕦ( ͡° ͜ʖ ͡°)ᕤ", "( ͡~ ͜ʖ ͡°)", "( ͡o ͜ʖ ͡o)", "͡° ͜ʖ ͡ -", "( ͡͡ ° ͜ ʖ ͡ °)", "( ͡ ͡° ͡°  ʖ ͡° ͡°)", "(ง ͠° ͟ل͜ ͡°)ง", "( ͡° ͜ʖ ͡ °)", "(ʖ ͜° ͜ʖ)", "[ ͡° ͜ʖ ͡°]", "( ͡o ͜ʖ ͡o)", "{ ͡• ͜ʖ ͡•}", "( ͡° ͜V ͡°)", "( ͡^ ͜ʖ ͡^)", "( ‾ʖ̫‾)", "( ͡°╭͜ʖ╮͡° )", "ᕦ( ͡°╭͜ʖ╮͡° )ᕤ", "(σ ͟ʖσ)", "( ͡°ل͜ ͡°)", "(⚆ ͜ʖ⚆)", "( ͡°⍘ ͡°)", "(´• ͜ʖ •`)", "(Ȍ ͜ʖȌ)", "(❍⍘❍)", "( ͡°‿‿ ͡°)", "(☞ ͡° ͜ʖ ͡°)☞", "(づ ͡° ͜ʖ ͡°)づ", "(☞๏ ͜ʖ๏)☞", "(   ͡ °   ͜ ʖ   ͡ ° )", "(ಠ ͜ʖ ಠ)", "(    ͡   °    ͜   ʖ    ͡   °   )", "(╭☞ ͡° ͜ʖ ͡° )╭☞", "https://i.imgur.com/5qAb7gO.png"]
		print("Loaded " + str(len(self.lennies)) + " Lennies.")

		try:
			self.emotes = [ os.path.splitext(f)[0] for f in listdir("pics/emotes") if isfile(join("pics/emotes",f)) ]
		except Exception as e:
			print("ERROR loading emotes! (" + str(e) + ")")
		else:
			print("Loaded " + str(len(self.emotes)) + " emotes.")

		try:
			self.stickers = [ os.path.splitext(f)[0] for f in listdir("pics/stickers") if isfile(join("pics/stickers",f)) ]
		except Exception as e:
			print("ERROR loading stickers! (" + str(e) + ")")
		else:
			print("Loaded " + str(len(self.stickers)) + " stickers.")

		try:
			self.skype.emotes = [ os.path.splitext(f)[0] for f in listdir("pics/skype/emotes") if isfile(join("pics/skype/emotes",f)) ]
		except Exception as e:
			print("ERROR loading Skype emotes! (" + str(e) + ")")
		else:
			print("Loaded " + str(len(self.skype.emotes)) + " Skype emotes.")

		self.skype.emoteMatch = ("(" + "|".join(self.skype.emotes) + ")") if self.skype.emotes else None

		try:
			self.skype.flags = [ os.path.splitext(f)[0] for f in listdir("pics/skype/flags") if isfile(join("pics/skype/flags",f)) ]
		except Exception as e:
			print("ERROR loading Skype flags! (" + str(e) + ")")
		else:
			print("Loaded " + str(len(self.skype.flags)) + " Skype flags.")

		self.skype.flagMatch = ("(" + "|".join(self.skype.flags) + ")") if self.skype.flags else None

		try:
			self.sqlConnection = sqlite3.connect("db/sqlite/lemmy.db")
		except Exception as e:
			print("ERROR connecting to database! (" + str(e) + ")")
		else:
			print("Database connection established.")
Example #3
0
	def __init__(self):
		self.error = ddict()
		self.error.symbol = ":no_entry_sign:"
		self.error.notMod = "User must be moderator or above to perform this action."
		self.error.notAdmin = "User must be administrator to perform this action."
Example #4
0
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#

from lxml import etree
from lxml import objectify

import ddict

MODE = ddict.ddict((
    ('valid', 1),
    ('validated', 2),
    ('gps', 4),
    ('projected', 8),
    ('interpolated', 16),
))

class KMLPaths(object):
    def __init__(self, slice):
        self.slice = slice

    def coordinateString(self, modemask):
        matches = []
        match = None

        def gpscoord(i):
            if i.GPSMeasureMode == 3:
                return (i.GPSLongitude, i.GPSLatitude, i.GPSAltitude)