Virtual master or mistress: PyMaster

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
Something I've been developing for a while. I mentioned it before, but there I was asking for punishment ideas.

PyMaster is a virtual master/mistress program. You are introduced to your new master or mistress (your choice), and he or she then dominates your life, controlling when you're allowed to masturbate, look at porn, eat sweets, entertain yourself, use the toilet, and a few other things. If you complete your tasks and follow the rules like a good slave, you will get to do these things more often. If you are a bad slave, you will be punished.

PyMaster can be found here:

http://freedomofrestriction-pymaster.tumblr.com

If you try this, please tell me what you think, and send me any ideas you have for improving it, too (that includes ideas for punishments and tasks that I haven't thought of).

For the record, I myself am a user of PyMaster. :)
 

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
Is this only for linux? I cant open it on windows 7

No, it's platform-independent; if there isn't a build for your particular system, just download the source code and run pymaster.py with the Python 3 interpreter. You can get Python here:

http://www.python.org

I can bundle the Python interpreter with PyMaster for a particular system -- that's what the GNU/Linux download is -- but I can only do this for systems that I have, and I only have GNU/Linux systems.
 
Last edited:

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
Ok, there was a hiatus developing this since I had to focus on other projects, but I've finally released a new version, 0.4. I managed to create a SourceForge page for it this time:

https://sourceforge.net/projects/pymaster/

Also, oddly, the Tumblr account I had was terminated, for some reason. No indication in my mailbox why this is the case, but whatever.

Since it's been a while, I don't quite remember what I've added in version 0.4 and what were there in 0.3. So I'll just mention some of the major changes I finished up most recently.

First, masturbation. I thought of a way to do this such that it's controlled by PyMaster, but generic enough to work for anyone, and 0.4 implements this. It doesn't try to control how you masturbate, but what it does do is, rather than deciding up-front whether or not you're allowed to orgasm, make it possible for you to ask for permission to orgasm while you're masturbating. An additional effect of this is it's possible, though rather unlikely, for you to be given permission to have multiple orgasms in one session.

Second, a part of the "morning routine" is now typing out your "oath of servitude" given to you when you first run PyMaster. I haven't actually tested this, so it very well might have a typo in it or otherwise be broken; if it is, I'll post a 0.4.1 release after I've tested it. (EDIT: I've tested it now, and it indeed works as it should.)

Third, your master/mistress now remembers what items you have and what things you can do for a period of time (or, in some cases, forever).

Some tasks have also been added and I think I've made adjustments to the punishments as well.

A side note: if anyone has any ideas for interesting tasks or punishments, please share them. Just about anything is possible, though tasks have to be completable within one day (before going to bed). But because of my lack of imagination, I think the list is still lacking.
 
Last edited:

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
does it work for MAC laptops??
Note: MAC is different from Mac. ;)

Yes, PyMaster works on Mac OS X. I don't know whether or not Mac OS X comes with Python 3 by default, but if it doesn't, you can download it from Python.org. With Python 3 installed, you can execute pymaster.py as if it were an executable file.

Is there anyway you can start over?
Yes. There are two ways now:

The traditional way is to delete the .pymaster folder from your home directory. What exactly that is depends on the system you're using, but generally it's the same as your username, and on POSIX systems (e.g. GNU/Linux and Mac OS X) "~" is an alias to it. (EDIT: See this Wikipedia article if you don't know what your home directory is.)

The other way introduced by PyMaster 0.5 is to run PyMaster with the --reset command-line option. To do this, open a terminal in the PyMaster directory and type something like this:

Code:
./pymaster.py --reset

If you're on Windows, I think you need to tell it to open the file with Python explicitly, e.g. if you have Python 3.4 installed:

Code:
c:\Python34\python pymaster.py --reset
 
Last edited:

sexxxking

Kinky Newbie
  • Straight
  • Male
  • Submissive
Mar 24, 2015
1
0
1
thank you

I was looking for a program like this. Will there be any future developments for this program?
 

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
I was looking for a program like this. Will there be any future developments for this program?
Why, yes, and in fact, I just made a new release. :) Sorry for the long stretch of time; I haven't had much time lately due to some stuff I have to take care of, so this has kind of taken a backseat to all that. But I still have every intention of maintaining and improving PyMaster.

I got fed up with SourceForge failing to log me in all the time, so I decided to switch over to GitHub:

https://freedomofrestriction.github.io/PyMaster/

The new release, 0.7, can be found here:

https://github.com/FreedomOfRestriction/PyMaster/releases/tag/v0.7
 
Last edited:

PiaBianca

Kinky Newbie
  • Lesbian
  • Female
  • Switch
Jan 18, 2015
22
1
0
I just read into your source code. I like that you're prepared for adding other languages. Do you have any road map for adding some?

I could provide some German translations every now and then. Is there a fallback to en_US if the locale doesn't have the required text?
 

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
I just read into your source code. I like that you're prepared for adding other languages. Do you have any road map for adding some?

I can't do any translations (I only know English), so no. I just set it up to be done because I figured someone else who is able might be interested in doing so. :)

Basically, if you have a translation, or part of a translation, or want to do one, I encourage you to fork the repo, add your translation to whatever the appropriate sub-folder under data would be, and submit a pull request. :) Or, if you don't know how to use Git, you can just send the translation to me; either way works.

I could provide some German translations every now and then. Is there a fallback to en_US if the locale doesn't have the required text?

The way PyMaster is designed to handle different languages is to have different data directories for each language. So, under the data folder, there might be one called "de", and you would start PyMaster with the -d option pointing to that directory to use it in German.

To make it fall back to English, all you would really need to do is base the German data directory on the English one and translate as you go. You could technically also do it as an extension, but I think it would be more elegant to do the former, since that way you'd be directly seeing the English text you're translating (and the extension mechanism wasn't designed for translations, anyway).
 
Last edited:

PiaBianca

Kinky Newbie
  • Lesbian
  • Female
  • Switch
Jan 18, 2015
22
1
0
Basically, if you have a translation, or part of a translation, or want to do one, I encourage you to fork the repo, add your translation to whatever the appropriate sub-folder under data would be, and submit a pull request. :) Or, if you don't know how to use Git, you can just send the translation to me; either way works.

Fortunately I do know how to use git. I'll see if I can add a translated German language file. I'll use a PM as fall back solution.

The way PyMaster is designed to handle different languages is to have different data directories for each language. So, under the data folder, there might be one called "de", and you would start PyMaster with the -d option pointing to that directory to use it in German.

Would it be difficult to add a dialog to first startup which asks for the language to be used? I guess you already have a file to persist certain settings.

To make it fall back to English, all you would really need to do is base the German data directory on the English one and translate as you go. You could technically also do it as an extension, but I think it would be more elegant to do the former, since that way you'd be directly seeing the English text you're translating (and the extension mechanism wasn't designed for translations, anyway).

If I base the German directory on the English one, that would only solve the current situation. If you'd later on add a new string, the correspondent value wouldn't be found in the language definition file. I don't know what would happen but I guess a runtime error would be thrown.

You could instead add a simple if-clause to your string retrieve function which uses the English string if no language dependent string is found. In PHP this would look similar to this:
PHP:
$string = language[$key];
if ( !empty($string) ) return $string;
return english[$key];

This would also work if later additions are not considered in language definition files. It would show the English string, but at least nothing would crash.
 

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
Would it be difficult to add a dialog to first startup which asks for the language to be used? I guess you already have a file to persist certain settings.

No, it wouldn't be difficult. I'll add that. Actually, another thing I could do in the long run is split off some of the stuff in the data directory into extensions, but recommend using them.

If you'd later on add a new string, the correspondent value wouldn't be found in the language definition file. I don't know what would happen but I guess a runtime error would be thrown.

What would happen is it would print the identifier string of the text. This is the relevant function:

Code:
def load_text(section, ID):
    """
    Return a choice of text with the requested ID in the requested
    section.  If it does not exist, return ID instead.
    """
    dirnames = EXTDIRS[::-1] + [DATADIR]
    for dirname in dirnames:
        fname = os.path.join(dirname, "text_{}.json".format(section))
        if os.path.isfile(fname):
            with open(fname, 'r') as f:
                texts = json.load(f)

            if ID in texts and texts[ID]:
                return lib.parse.python_tag(random.choice(texts[ID]))
    else:
        return ID

So the only problem currently is what's printed might be confusing, though someone who doesn't know English would find English text confusing anyway. :)

Still, allowing the user to designate a backup data directory so that it can fall back to another language like English would probably be a good idea. I mentioned extnesions, but on second thought, that wouldn't entirely work because certain things would be duplicated (most notably tasks and punishments; you'd get both the English and German version, rather than the German version replacing the English version).

You could instead add a simple if-clause to your string retrieve function which uses the English string if no language dependent string is found. In PHP this would look similar to this:

Sure, I suppose I could add something like that. I could implement that by making it a list of data directories and falling back to later ones if the first one fails.
 

PiaBianca

Kinky Newbie
  • Lesbian
  • Female
  • Switch
Jan 18, 2015
22
1
0
So the only problem currently is what's printed might be confusing, though someone who doesn't know English would find English text confusing anyway. :)

The advantage of English as fall back is: you create the English version so it will always be complete.
 

FreedomOfR

Kinky Newbie
  • Straight
  • Male
  • Private
May 13, 2014
28
0
0
Man, I terribly underestimated the difficulty of that! I thought I'd just be changing a constant to a variable in the pymasterlib module, but it turns out I had to do a lot more than that to deal with an artifact in how I was handling stuff related to restricted activities and misdeeds.

I'll be pushing this to GitHub after I check a couple things. :)

EDIT: pushed. So, with the way it is now, any text not defined in the text_*.json files will by default be searched for in the English directory (technically, all English directories, though there is currently only one). It's possible to change this; the -d option now allows you to specify a list of directories, and directories after the first one serve as such a backup option.

Additionally, you're now asked on first startup what data directory you want to use, if there are more than one. (It just says "Language selection" and lists the directories, which should all be named things like en_US or de_DE, to keep it simple and understandable for non-English speakers.)
 
Last edited:

Featured Threads

New Personals