wikibot/wikibot.py
def checkFamily(self):
        '''
        check if a family file exists and if not create it
        '''
        iniFile=WikiUser.iniFilePath(self.wikiUser.wikiId)
        famfile=iniFile.replace(".ini",".py")
        if not isfile(famfile):
            print("creating family file %s" % famfile)
            template='''# -*- coding: utf-8  -*-
from pywikibot import family

class Family(family.Family):
    name = '%s'
    langs = {
        'en': '%s',
    }
    def scriptpath(self, code):
       return '%s'
       
    def isPublic(self):
        return %s   
        
    def version(self, code):
        return "%s"  # The MediaWiki version used. Very important in most cases. (contrary to documentation)   

    def protocol(self, code):
       return '%s'
'''         
            mw_version=self.wikiUser.version.lower().replace("mediawiki ","")
            ispublic='False' if self.wikiUser.user is not None else 'True'
            code=template % (self.family,self.netloc,self.scriptPath,ispublic,mw_version,self.scheme)
            with open(famfile,"w") as py_file:
                py_file.write(code)
        config2.register_family_file(self.family, famfile)  
        if self.wikiUser.user:
            config2.usernames[self.family]['en'] = self.wikiUser.user
        #config2.authenticate[self.netloc] = (self.user,self.getPassword())
        self.site=pywikibot.Site('en',self.family)  
        if self.wikiUser.user:
            # needs patch as outlined in https://phabricator.wikimedia.org/T248471
            #self.site.login(password=self.wikiUser.getPassword())
            lm = LoginManager(password=self.wikiUser.getPassword(), site=self.site, user=self.wikiUser.user)
            lm.login()

        check if a family file exists and if not create it
        
check if a family file exists and if not create it
check if a family file exists and if not create it
def checkFamily(self):
        iniFile=WikiUser.iniFilePath(self.wikiUser.wikiId)
        famfile=iniFile.replace(".ini",".py")
        if not isfile(famfile):
            print("creating family file %s" % famfile)
            template='''# -*- coding: utf-8  -*-
from pywikibot import family
class Family(family.Family):
    name = '%s'
    langs = {
        'en': '%s',
    }
    def scriptpath(self, code):
       return '%s'
    def isPublic(self):
        return %s   
    def version(self, code):
        return "%s"  # The MediaWiki version used. Very important in most cases. (contrary to documentation)   
    def protocol(self, code):
       return '%s'
'''         
            mw_version=self.wikiUser.version.lower().replace("mediawiki ","")
            ispublic='False' if self.wikiUser.user is not None else 'True'
            code=template % (self.family,self.netloc,self.scriptPath,ispublic,mw_version,self.scheme)
            with open(famfile,"w") as py_file:
                py_file.write(code)
        config2.register_family_file(self.family, famfile)  
        if self.wikiUser.user:
            config2.usernames[self.family]['en'] = self.wikiUser.user
        self.site=pywikibot.Site('en',self.family)  
        if self.wikiUser.user:
            lm = LoginManager(password=self.wikiUser.getPassword(), site=self.site, user=self.wikiUser.user)
            lm.login()
def checkFamily ( self ) : iniFile = WikiUser . iniFilePath ( self . wikiUser . wikiId ) famfile = iniFile . replace ( ".ini" , ".py" ) if not isfile ( famfile ) : print ( "creating family file %s" % famfile ) template = '''# -*- coding: utf-8  -*-
from pywikibot import family

class Family(family.Family):
    name = '%s'
    langs = {
        'en': '%s',
    }
    def scriptpath(self, code):
       return '%s'
       
    def isPublic(self):
        return %s   
        
    def version(self, code):
        return "%s"  # The MediaWiki version used. Very important in most cases. (contrary to documentation)   

    def protocol(self, code):
       return '%s'
''' mw_version = self . wikiUser . version . lower ( ) . replace ( "mediawiki " , "" ) ispublic = 'False' if self . wikiUser . user is not None else 'True' code = template % ( self . family , self . netloc , self . scriptPath , ispublic , mw_version , self . scheme ) with open ( famfile , "w" ) as py_file : py_file . write ( code ) config2 . register_family_file ( self . family , famfile ) if self . wikiUser . user : config2 . usernames [ self . family ] [ 'en' ] = self . wikiUser . user self . site = pywikibot . Site ( 'en' , self . family ) if self . wikiUser . user : lm = LoginManager ( password = self . wikiUser . getPassword ( ) , site = self . site , user = self . wikiUser . user ) lm . login ( )
check if a family file exists and if not create it
check if a family file exists and if not create it
'''
        check if a family file exists and if not create it
        ''' #config2.authenticate[self.netloc] = (self.user,self.getPassword()) # needs patch as outlined in https://phabricator.wikimedia.org/T248471 #self.site.login(password=self.wikiUser.getPassword())
self