from Itemizer import *

if __name__ == "__main__":
import os
import Itemizer
from Item import *

class Album:

    def __init__(self, directory_path, delimiter, copy, simulate, verbosity,
                 regroup, no_name):
        self.set_options(delimiter, copy, simulate, verbosity, regroup, no_name)

    def set_options(self, delimiter, copy, simulate, verbosity, regroup,
        self.delimiter = delimiter
        self.copy = copy
        self.simulate = simulate
        self.verbosity = verbosity
        self.regroup = regroup
        self.no_name = no_name

    def set_directory_path(self, directory_path):
        if not os.path.isdir(directory_path):
            print "Directory not found:", directory_path
            directory_path = None
            directory_path = os.path.join(directory_path, "")
        self.directory_path = directory_path

    def initialize_item_list(self):
        self.items = None
        if self.directory_path != None:
            for file_name in os.listdir(self.directory_path):
                path = self.directory_path + file_name
                if Itemizer.Itemizer.is_item(path):
                    number = Itemizer.Itemizer.extract_item_number(path)
                    self.add_items(path, number)

    def add_items(self, paths, index=None):
        if type(paths) == str:
            paths = [paths]
        current_index = self.build_index(index)
        for path in paths:
            if not os.path.isfile(path):
                print "File not found:", path
                if self.items == None:
                    self.add_first_item(path, current_index)
                    self.items = self.items.remove_path(path)
                    if self.items == None:
                        self.add_first_item(path, current_index)
                        self.items = self.items.insert(path, current_index)
                if current_index:
                    current_index += 1
                if self.verbosity > 1:
                    print "Added file to list:", path

    def build_index(self, index):
        if type(index) == str:
            index = int(index)
        return index

    def add_first_item(self, path, index):
        if index == None:
            index = 1
        self.items = Item(path, index, self.no_name)

    def remove(self, paths):
        current = self.items
        while current != None:
            path = self.find_path_in_list(current.path, paths)
            if path:
                outgoing = current
                self.items = self.items.remove_path(outgoing.path)
                    self.directory_path, None, self.delimiter, self.copy,
                    self.simulate, self.verbosity)
            current = current.next

    def find_path_in_list(self, key, paths):
        for path in paths:
            if os.path.samefile(key, path):
                return path

    def commit(self):
        if self.directory_path != None and self.items != None:
            if self.regroup:
            current = self.items
            prefix_length = self.determine_prefix_length()
            while current != None:
                    self.directory_path, prefix_length, self.delimiter,
                    self.copy, self.simulate, self.verbosity)
                current = current.next

    def print_items(self):
        current = self.items
        while current != None:
            print current
            current = current.next

    def determine_prefix_length(self):
        largest_index = self.items.get_largest_index()
        return len(str(largest_index))
import os
import re
import shutil

class Item:

    def __init__(self, path, index, no_name):
        self.path = path
        self.index = index
        self.no_name = no_name
        self.next = None

    def __str__(self):
        return str(self.index) + "\t" + self.path

    def __len__(self):
        ii = 0
        current = self
        while current != None:
            ii += 1
            current = current.next
        return ii

    def insert(self, path, index=None):
        head = self
        previous = head.advance_to_index_predecessor(index)
        if index == None:
            index = previous.index + 1
        item = Item(path, index, self.no_name)
        if previous != None:
            item.next = previous.next
            previous.next = item
            item.next = head
            head = item
        return head

    def advance_to_index_predecessor(self, index=None):
        previous = None
        current = self
        while current != None:
            if index != None and current.index >= index:
            previous = current
            current = current.next
        return previous

    def increase_indices(self):
        current = self.next
        previous_index = self.index
        while current != None and current.index == previous_index:
            current.index += 1
            previous_index += 1
            current = current.next

    def remove_path(self, path):
        head = self
        current = head
        previous = None
        while current != None:
            if os.path.samefile(path, current.path):
                if previous != None:
                    previous.next = current.next
                    head = current.next
            previous = current
            current = current.next
        return head

    def bunch(self):
        index = 1
        current = self
        while current != None:
            current.index = index
            index += 1
            current = current.next

    def erase_index(self):
        self.index = None

    def save(self, directory_path, prefix_length, delimiter, copy, simulate,
        name = self.extract_name()
        name = name.lstrip(delimiter)
        prefix = self.build_prefix(prefix_length)
        if self.no_name:
            file_name = prefix + self.extract_extension(name)
            file_name = prefix + delimiter + name
        path = os.path.join(directory_path, file_name)
        self.write_path(path, copy, simulate, verbosity)

    def build_prefix(self, prefix_length):
        prefix = ""
        if self.index != None:
            prefix = str(self.index).zfill(prefix_length)
        return prefix

    def extract_extension(self, name):
        return "." + name.split(".")[-1]

    def write_path(self, path, copy, simulate, verbosity):
        if not os.path.isfile(path) or not os.path.samefile(self.path, path):
            if not simulate:
                if copy:
                    shutil.copy(self.path, path)
                    shutil.move(self.path, path)
            if verbosity > 0:
                print "Wrote:", self.path, "=>", path

    def get_largest_index(self):
        current = self
        while current.next:
            current = current.next
        return current.index

    def extract_name(self):
        file_name = os.path.basename(self.path)
        match = re.match("^[0-9]*(.*)", file_name)
        return match.group(1)
March 3, 2021

Video 📺

Computers are a gun. They can see the target; they can pull the trigger. Computers were made by the military to blow people's brains out if they stepped out of line. Google Coral is the same technology that pollutes the oceans, and so is the computer I'm using, and so are the platforms I'm using to post this.

Game 🎲

Games are a context in which all play is purposeful. Games expose the fundamentally nihilistic nature of the universe and futility of pursuing any path other than the inevitability of death and the torture of an evil that knows and exploits absolute freedom. Games are not educational; they are education.

Propaganda 🆒

Education is propaganda — ego driven by-product conveying nothing that would enable us to expose that vanities made for gain subject us further to an illusion created by those in control: the illusion that quantity can represent substance and that data or observation can replace meaning. And why say it, or how, without contradicting yourself, that everything, once registered, no longer exists, and in fact never did, exists only in relation to other non-existent things, and when you look, it's not there, not only because it's long vanished, but because where would it be?

fig. 2: Gamer goo is a lubricant — not for your skin, but for facilitating your ability to own the competition (image from Gamer goo review)

As a result of video games, the great Trojan horse 🎠 of imperialist consumerist representationalism, people are divided in halves to encourage them to act according to market ordained impulses, to feign assurance, penetrating themselves deeper into a tyranny from which every action signals allegiance, confusing the world with definitions and borders, constantly struggling to balance or brace themselves against forces that threaten the crumbling stability of their ego.


or example, a cup 🥃 is designed and built to hold something, maintain order and prevent chaos. It keeps water from spilling back to where it belongs, back where it wants to go and gravity wants it to go. The cup is a trap, and it is used to assert dominance over nature, to fill with thoughts about existence, time and self, thoughts regarding dissimilarity between equal parts and patterns that manifest in variation. These ruminations disguised as revelations boil away to reveal isolated and self-aggrandizing thoughts about an analogy fabricated to herald the profundity of one's campaign's propaganda. You have no authentic impulse except to feed a delusion of ultimate and final supremacy. That is why you play games. That is your nature. That is why you eventually smash the cup to bits 💥 or otherwise watch it disintegrate forever because it, by being useful, threatens your facade of ownership and control.

fig. 3: worth1000

The cup is you; it reflects you; it is a lens through which you see yourself; it reassures you, confirming your presence; it says something, being something you can observe. When you move, it moves, and it opens after being closed. You can use it as a vessel for penetration fantasies, keeping you warm and fertile, a fine host for the plague of consciousness, you reptile, you sun scorched transgressor that not only bites the hand that feeds, but buries it deep within a sterile chamber where nothing remains for it as a means of escape except the corpses of others that infringed upon your feeding frenzy.