import pywikibot
import re
from pywikibot import pagegenerators
site = pywikibot.Site('en', 'wikipedia')
resultpage = pywikibot.Page(site, u"User:Trialpears/Automatic biography short descriptions")
savecount=0
def extractfirst(text):
    i=0
    result=text
    result=re.sub("\[\[[Cc]ategory:[^\]]*]]","",result)
    result=re.sub("\[\[[Ff]ile:[^\]]*]]","",result)
    result=re.sub("\[\[[Ii]mage:[^\]]*]]","",result)
    result=re.sub("\n"," ",result)
    result=re.sub("==.*","",result)
    result=re.sub("''+","",result)
    result=re.sub("\[\[([^\|\]\[]*\|)?([^\|\]\[]*)]]",r"\2",result)
    while i < 5:
        result=re.sub("{{[^{}]*}}","",result)
        result=re.sub("\([^\(\)]*\)","",result)
        result=re.sub("<ref[^<>]*>[^<>]*<\/ref>","",result)
        result=re.sub("<ref[^<>]*\/>","",result)
        result=re.sub("<!--[^<>]*-->","",result)
        i+=1
    result=re.sub("\n","",result)
    result=re.sub("  *"," ",result)
    result=re.sub("(^.*?[.!?](?=\s[A-Z]|$)).*",r"\1",result)
    result=re.sub("^\s*","",result)
    result=re.sub("\s*(?=,|\.)","",result)
    result=re.sub("\s*$","",result)
    return result
def extractdescription(text):
    result=text
    if re.match('^(("?[A-Z][a-z]*"?|(Jr\.)),? )*?(is|was) (a|an) ',result):
        result=re.sub('^(("?[A-Z][a-z]*"?|(Jr\.)),? )*?(is|was) (a|an) (.*)',r"\6",result)
        result=re.sub(',? who .*',"",result)
        result=re.sub(',? known for .*',"",result)
        result=re.sub(',? currently .*',"",result)
        result=re.sub(',? as well .*',"",result)
        result=re.sub(',? better known .*',"",result)
        result=re.sub("\.$","",result)
        result=re.sub('([a-zA-Z])', lambda x: x.groups()[0].upper(), result, 1)
        if len(result) <= 40:
            if re.match("(Afghan|Albanian|Algerian|Andorran|Angolan|and|Barbuda|Antiguan|Barbudan|Argentine|Armenian|Australian|Austrian|Azerbaijani|Azeri|Bahamas|Bahamian|Bahraini|Bengali|Barbadian|Belarusian|Belgian|Belizean|Beninese|Beninois|Bhutanese|Bolivian|Bosnian|Herzegovinian|Motswana|Botswanan|Brazilian|Bruneian|Bulgarian|Faso|Burkinabé|Burmese|Burundian|Verde|Cabo|Verdean|Cambodian|Cameroonian|Canadian|African|Chadian|Chilean|Chinese|Colombian|Comoran|Comorian|Congolese|Rican|Ivorian|Croatian|Cuban|Cypriot|Republic|Czech|Danish|Djiboutian|Dominican|Republic|Dominican|Timor|Timorese|Ecuadorian|Egyptian|Salvador|Salvadoran|Guinea|Equatorial|Guinean|Equatoguinean|Eritrean|Estonian|Ethiopian|Fijian|Finnish|French|Gabonese|The|Gambian|Georgian|German|Ghanaian|Gibraltar|Greek|Hellenic|Grenadian|Guatemalan|Guinean|Bissau|Guinean|Guyanese|Haitian|Honduran|Hungarian|Magyar|Icelandic|Indian|Indonesian|Iranian|Persian|Iraqi|Irish|Israeli|Italian|Coast|Ivorian|Jamaican|Japanese|Jordanian|Kazakhstani|Kazakh|Kenyan|Kiribati|Korea|North|Korean|Korea|South|Korean|Kuwaiti|Kyrgyzstani|Kyrgyz|Kirgiz|Kirghiz|Lao|Laotian|Latvian|Lettish|Lebanese|Basotho|Liberian|Libyan|Liechtensteiner|Lithuanian|Luxembourg|Luxembourgish|Republic|of|Macedonian|Malagasy|Malawian|Malaysian|Maldivian|Malian|Malinese|Maltese|Islands|Marshallese|Martiniquais|Martinican|Mauritanian|Mauritian|Mexican|Federated|States|of|Micronesian|Moldovan|Monégasque|Monacan|Mongolian|Montenegrin|Moroccan|Mozambican|Namibian|Nauruan|Nepali|Nepalese|Dutch|Netherlandic|Zealand|New|Zealand|NZ|Zelanian|Nicaraguan|Nigerien|Nigerian|Mariana|Islands|Northern|Marianan|Norwegian|Omani|Pakistani|Palauan|Palestinian|Panamanian|New|Guinea|Papua|New|Guinean|Papuan|Paraguayan|Peruvian|Filipino|Philippine|Polish|Portuguese|Rico|Puerto|Rican|Qatari|Romanian|Russian|Rwandan|Kitts|and|Nevis|Kittitian|or|Nevisian|Lucia|Saint|Lucian|Vincent|and|the|Grenadines|Saint|Vincentian|Vincentian|Samoan|Marino|Sammarinese|ão|Tomé|and|Príncipe|São|Toméan|Arabia|Saudi|Saudi|Arabian|Senegalese|Serbian|Seychellois|Leone|Sierra|Leonean|Singapore|Singaporean|Slovak|Slovenian|Slovene|Islands|Solomon|Island|Somali|Africa|South|African|Sudan|South|Sudanese|Spanish|Lanka|Sri|Lankan|Sudanese|Surinamese|Swazi|Swedish|Swiss|Syrian|Tajikistani|Tanzanian|Thai|Leste|Timorese|Togolese|Tokelauan|Tongan|and|Tobago|Trinidadian|or|Tobagonian|Tunisian|Turkish|Turkmen|Tuvaluan|Ugandan|Ukrainian|Arab|Emirates|Emirati|Emirian|Emiri|Kingdom|of|Great|Britain|and|Northern|Ireland|UK|British|States|of|America|United|States|U.S.|American|Uruguayan|Uzbekistani|Uzbek|Vanuatu|Vanuatuan|City|State|Vatican|Venezuelan|Vietnamese|Yemeni|Zambian|Zimbabwean)",result):
                global counter 
                counter += 1
                return result
    return False
counter = 1
for page in pywikibot.pagegenerators.SearchPageGenerator('incategory:"Living people" -incategory:"Articles with short description"'):
    if extractdescription(extractfirst(page.text)) is not False:
        description="{{short description|"+extractdescription(extractfirst(page.text))+"|bot=PearBOT 5}}\n"
        page.text=description+page.text
        print(page.text)
        if savecount<1:
            page.save("Adding automaticaly generated short description. Bot in trial see [[Wikipedia:Bots/Requests for approval/PearBOT 5|BRFA]]")
            savecount = savecount + 1
{{short description|American session drummer|bot=PearBOT 5}}
{{Infobox musical artist <!-- See Wikipedia:WikiProject_Musicians -->
|name            = Abe Laboriel Jr.
|image           = Show Paul McCartney São Paulo-26 de março de 2019 10.jpg
|image_size      = 220px 
|caption         = Playing as sideman with Paul McCartney, 2019
|background      = solo_singer
|birth_name      = Abraham Laboriel Jr.
|birth_place     = [[Los Angeles]], [[California]], United States
|birth_date      = {{Birth-date and age|March 23, 1971}}
|origin          = [[Lexington, Massachusetts|Lexington]], [[Massachusetts]]<br />[[United States]]
|instrument      = [[Drum kit|Drums]], [[singing|vocals]]<!--- If you think an instrument should be listed, a discussion to reach consensus is needed first per: https://en.wikipedia.org/wiki/Template:Infobox_musical_artist#instrument--->
|genre           = [[Rock music|Rock]], [[pop music|pop]]
|occupation      = Musician
|years_active    = 1980s–present
|label           = 
|website         = 
}}

'''Abraham "Abe" Laboriel Jr.''' (born March 23, 1971) is an American [[session musician|session]] [[drummer]]. He is the son of [[Mexican people|Mexican]] [[bass guitar]]ist [[Abraham Laboriel]], nephew of Mexican rocker [[Johnny Laboriel]], and brother of record producer, songwriter, and film composer Mateo Laboriel.  He has been the drummer for [[Paul McCartney]] as well as for the French singer [[Mylène Farmer]], among others.<ref name=":0" />

== Early life ==
The son of jazz bass player Abraham Laboriel, Abe grew up playing drums starting at age four.<ref name=":0">{{cite web|title = Abe Laboriel, Jr.: Riding A Wave Of Success|url = http://www.moderndrummer.com/site/2002/12/abe-laboriel-jr-2/|work = [[Modern Drummer]]|accessdate = |date = December 1, 2002}}</ref> His mother is a classically trained singer.<ref name=":1">{{Cite web|url = http://www.mikedolbear.com/story.asp?StoryID=1370|title = Interview With Abe Laboriel Jnr 2007|date = |accessdate = March 22, 2015|website = mikedolbear.com|publisher = |last = Dolbear|first = Mike}}</ref>

Laboriel was mentored by well-known percussionists and drummers, including [[Jeff Porcaro]], [[Chester Thompson]], along with Bill Maxwell and [[Alex Acuña]], who had formed the band [[Koinonia (band)|Koinonia]] with his father in the 1980s.

He attended the [[Dick Grove|Dick Grove School of Music]], studying with Peter Donald, during his junior year in [[high school]]. He also attended the [[Alexander Hamilton High School (Los Angeles)|Hamilton High School]] Academy of Music in Los Angeles in his senior year. Here he first experienced the use of programming and became a member of a marching band. He formed a jazz trio with [[Vernell Brown]] and [[Mike Elizondo]].<ref name=":1" /> In 1989, he was honored by the [[National Foundation for Advancement in the Arts]] and ''[[Down Beat]]'' magazine. He then enrolled at the [[Berklee College of Music]], where he graduated in 1993.<ref name=":0" />

== Career ==
Laboriel's first break as a drummer was a tour with guitarist [[Steve Vai]]. He then toured with [[Seal (musician)|Seal]], where he was seen by [[record producer]]s around [[Los Angeles, California]] which led to session work.<ref name=":0" /> Laboriel next toured with [[k.d. lang]] where [[Sting (musician)|Sting]] saw him and invited Laboriel to join Sting's touring band. The k.d. lang connection also led Laboriel to working with Paul McCartney, including McCartney's appearance during the halftime of [[Super Bowl XXXIX]]. He also toured and recorded in studio with former [[Menudo (band)|Menudo]] member [[Robi Draco Rosa]] on his album ''Vagabundo''.

Laboriel has also recorded and performed with [[Jonatha Brooke]], [[Crystal Lewis]], [[Shakira]], [[B.B. King]], [[Steven Curtis Chapman]], [[Eric Clapton]], [[Johnny Hallyday]], [[Jenifer Bartoli|Jenifer]], [[Steve Winwood]], [[Les Paul]], [[Ashlee Simpson]], [[LeAnn Rimes]], [[Mylène Farmer]], [[Letters to Cleo]], [[Vanessa Carlton]], [[Kelly Clarkson]], [[Lady Gaga]], [[Tyler Bryant]], [[Steve Lukather]], Michael Landau and others.<ref name=":0" /> Lewis and Laboriel were also both a part of the Nickelodeon television series, ''[[Roundhouse (TV series)|Roundhouse]]'' in the 1990s.

Laboriel was part of a [[power trio]] by the name of The Raging Honkies. He is part of the collective that is [[Chocolate Genius, Inc.]]

In 2006 during the show "Avant que l'ombre... à Bercy" ("Before the shadow... at Bercy"), Laboriel sang a duet "Les Mots" ("The words")  with [[Mylène Farmer]].<ref name=":1" /> He also played with Sting at the [[Montreux Jazz Festival]] that year. Laboriel toured with Eric Clapton and Steve Winwood on their 14-date American Tour in 2009 following their Japanese tour the year before.<ref>{{Cite web|url = http://www.mixonline.com/news/tours/eric-clapton-and-steve-winwood-tour-profile/368162|title = Eric Clapton and Steve Winwood Tour Profile|date = August 1, 2009|accessdate = |website = mixonline.com|publisher = |last = Farinella|first = David J.}}</ref> He made his live debut with Paul McCartney at [[The Concert for New York City]] in 2001, and has played on every McCartney tour since then.<ref>{{Cite web|url = http://www.boston.com/ae/music/2013/07/04/keeping-the-beat-for-sir-paul/uh8a0jUJpgzEK1UTfJI4FK/story.html|title = Keeping The Beat for Sir Paul|date = July 4, 2013|accessdate = |website = Boston Globe|publisher = |last = Sullivan|first = James}}</ref>

==Equipment==
{{BLP unsourced section|date=October 2018}}
Abe Laboriel Jr endorses [[Drum Workshop]] drums, [[Paiste cymbals]], Remo drumheads and [[Vic Firth]] drumsticks.

DW Collector's series drums:
*26x14" or 28x20" kick drum
*14x10" or 15x12" rack tom
*16x14" or 18x16" floor tom
*18x16" or 20x16" floor tom
*14x7" or 14x8" snare drum

Paiste cymbals:
*15" 2002 Sound Edge Hi Hats
*20" 2002 Crash
*22" 2002 Crash
*24" 2002 Ride
*24" Giant Beat Crash
*24" 2002 Crash

Abe has his own signature [[Vic Firth]] drumstick which is similar to a regular 2B wood tip drumstick but in 17" length.

== Style ==
About his playing he noted: "As much as I would love to say I have an original sound, I think the truth is I have an original filter. I’d listen so much and so hard to so many different people that what’s original about me is not necessarily what I play but how I play it, how I interpret it hasn’t already been done. It’s more about the energy and the intensity, it’s not about the specific fills, it's more about the intention."<ref name=":1" />

== Discography ==
{{main|Abe Laboriel Jr. discography}}

== References ==

{{Reflist}}

== External links ==
* {{twitter|ogabejr}}
* [http://abe-laborieljr-csed.squarespace.com/ Abe Laboriel Jr.] at [[Squarespace]]
* {{Allmusic|class=artist|id=mn0000585847}}
* {{Discogs artist|307118-Abraham-Laboriel-Jr}}

{{Authority control}}

{{DEFAULTSORT:Laboriel Jr., Abe}}
[[Category:1971 births]]
[[Category:Living people]]
[[Category:Musicians from Los Angeles]]
[[Category:American rock drummers]]
[[Category:American session musicians]]
[[Category:Berklee College of Music alumni]]
[[Category:Hispanic and Latino American musicians]]
[[Category:American musicians of Mexican descent]]
[[Category:20th-century American drummers]]
[[Category:American male drummers]]
[[Category:21st-century American drummers]]
[[Category:20th-century male musicians]]
[[Category:21st-century male musicians]]
---------------------------------------------------------------------------
NoUsername                                Traceback (most recent call last)
/srv/paws/pwb/pywikibot/page.py in handle(func, self, *args, **kwargs)
    106         try:
--> 107             func(self, *args, **kwargs)
    108         # TODO: other "expected" error types to catch?

/srv/paws/pwb/pywikibot/page.py in _save(self, summary, watch, minor, botflag, cc, quiet, **kwargs)
   1292         done = self.site.editpage(self, summary=summary, minor=minor,
-> 1293                                   watch=watch, bot=botflag, **kwargs)
   1294         if not done:

/srv/paws/pwb/pywikibot/site.py in callee(self, *args, **kwargs)
   1314             if grp == 'user':
-> 1315                 self.login(False)
   1316             elif grp == 'sysop':

/srv/paws/pwb/pywikibot/site.py in login(self, sysop, autocreate)
   2095                                              wrong=self.userinfo['name'],
-> 2096                                              right=self._username[sysop]))
   2097             else:

NoUsername: Logged in on wikipedia:en via OAuth as Trialpears, but expect as PearBOT

During handling of the above exception, another exception occurred:

OtherPageSaveError                        Traceback (most recent call last)
<ipython-input-2-9ab4e80fe563> in <module>
     53         print(page.text)
     54         if savecount<1:
---> 55             page.save("Adding automaticaly generated short description. Bot in trial see [[Wikipedia:Bots/Requests for approval/PearBOT 5|BRFA]]")
     56             savecount = savecount + 1

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1736                              cls, depth)
   1737                     del __kw[old_arg]
-> 1738             return obj(*__args, **__kw)
   1739 
   1740         if not __debug__:

/srv/paws/pwb/pywikibot/tools/__init__.py in wrapper(*__args, **__kw)
   1736                              cls, depth)
   1737                     del __kw[old_arg]
-> 1738             return obj(*__args, **__kw)
   1739 
   1740         if not __debug__:

/srv/paws/pwb/pywikibot/page.py in save(self, summary, watch, minor, botflag, force, asynchronous, callback, apply_cosmetic_changes, quiet, **kwargs)
   1280         self._save(summary=summary, watch=watch, minor=minor, botflag=botflag,
   1281                    asynchronous=asynchronous, callback=callback,
-> 1282                    cc=apply_cosmetic_changes, quiet=quiet, **kwargs)
   1283 
   1284     @allow_asynchronous

/srv/paws/pwb/pywikibot/page.py in wrapper(self, *args, **kwargs)
    126             pywikibot.async_request(handle, func, self, *args, **kwargs)
    127         else:
--> 128             handle(func, self, *args, **kwargs)
    129 
    130     manage_wrapping(wrapper, func)

/srv/paws/pwb/pywikibot/page.py in handle(func, self, *args, **kwargs)
    118                 if isinstance(err, pywikibot.PageSaveRelatedError):
    119                     raise err
--> 120                 raise pywikibot.OtherPageSaveError(self, err)
    121         if callback:
    122             callback(self, err)

OtherPageSaveError: Edit to page [[Abe Laboriel Jr.]] failed:
Logged in on wikipedia:en via OAuth as Trialpears, but expect as PearBOT