CLICK - Working with Plugins

Building Command Line Tools with Python, Julia and Nodejs Module 02 - Building Command Line Tools in Python with CLICK
6 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.26
List Price:  €93.23
You save:  €27.97
£55.95
List Price:  £79.94
You save:  £23.98
CA$95.75
List Price:  CA$136.79
You save:  CA$41.04
A$107.23
List Price:  A$153.20
You save:  A$45.96
S$95.15
List Price:  S$135.94
You save:  S$40.78
HK$547.94
List Price:  HK$782.80
You save:  HK$234.86
CHF 63.91
List Price:  CHF 91.30
You save:  CHF 27.39
NOK kr766.40
List Price:  NOK kr1,094.90
You save:  NOK kr328.50
DKK kr486.75
List Price:  DKK kr695.39
You save:  DKK kr208.64
NZ$117.46
List Price:  NZ$167.81
You save:  NZ$50.35
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,670.29
List Price:  ৳10,958.03
You save:  ৳3,287.74
₹5,832.01
List Price:  ₹8,331.80
You save:  ₹2,499.79
RM334.37
List Price:  RM477.70
You save:  RM143.32
₦88,678.72
List Price:  ₦126,689.32
You save:  ₦38,010.60
₨19,457.85
List Price:  ₨27,798.13
You save:  ₨8,340.27
฿2,591.43
List Price:  ฿3,702.20
You save:  ฿1,110.77
₺2,274.88
List Price:  ₺3,249.97
You save:  ₺975.09
B$360.25
List Price:  B$514.66
You save:  B$154.41
R1,330.75
List Price:  R1,901.16
You save:  R570.40
Лв127.68
List Price:  Лв182.41
You save:  Лв54.73
₩96,191.02
List Price:  ₩137,421.64
You save:  ₩41,230.61
₪265.67
List Price:  ₪379.55
You save:  ₪113.87
₱4,044.82
List Price:  ₱5,778.57
You save:  ₱1,733.74
¥10,886.62
List Price:  ¥15,552.99
You save:  ¥4,666.36
MX$1,193.70
List Price:  MX$1,705.36
You save:  MX$511.66
QR254.90
List Price:  QR364.16
You save:  QR109.26
P969.33
List Price:  P1,384.82
You save:  P415.49
KSh9,413.65
List Price:  KSh13,448.65
You save:  KSh4,035
E£3,352.26
List Price:  E£4,789.16
You save:  E£1,436.89
ብር3,973.96
List Price:  ብር5,677.33
You save:  ብር1,703.36
Kz58,616.62
List Price:  Kz83,741.62
You save:  Kz25,125
CLP$66,678.07
List Price:  CLP$95,258.47
You save:  CLP$28,580.40
CN¥507.14
List Price:  CN¥724.52
You save:  CN¥217.38
RD$4,110.44
List Price:  RD$5,872.31
You save:  RD$1,761.87
DA9,401.90
List Price:  DA13,431.87
You save:  DA4,029.96
FJ$160.42
List Price:  FJ$229.18
You save:  FJ$68.76
Q543.26
List Price:  Q776.12
You save:  Q232.86
GY$14,630.45
List Price:  GY$20,901.55
You save:  GY$6,271.09
ISK kr9,795.80
List Price:  ISK kr13,994.60
You save:  ISK kr4,198.80
DH709.23
List Price:  DH1,013.23
You save:  DH303.99
L1,246.59
List Price:  L1,780.93
You save:  L534.33
ден4,020.35
List Price:  ден5,743.61
You save:  ден1,723.25
MOP$563.94
List Price:  MOP$805.67
You save:  MOP$241.72
N$1,340.22
List Price:  N$1,914.68
You save:  N$574.46
C$2,572.43
List Price:  C$3,675.06
You save:  C$1,102.63
रु9,316.74
List Price:  रु13,310.19
You save:  रु3,993.45
S/259.29
List Price:  S/370.43
You save:  S/111.14
K265.67
List Price:  K379.55
You save:  K113.87
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,825.88
List Price:  ZK2,608.51
You save:  ZK782.63
L324.76
List Price:  L463.96
You save:  L139.20
Kč1,644.30
List Price:  Kč2,349.11
You save:  Kč704.80
Ft25,615.12
List Price:  Ft36,594.60
You save:  Ft10,979.47
SEK kr760.35
List Price:  SEK kr1,086.27
You save:  SEK kr325.91
ARS$61,118.20
List Price:  ARS$87,315.45
You save:  ARS$26,197.25
Bs482.97
List Price:  Bs689.99
You save:  Bs207.01
COP$272,384.35
List Price:  COP$389,137.18
You save:  COP$116,752.82
₡35,055.79
List Price:  ₡50,081.85
You save:  ₡15,026.05
L1,725.31
List Price:  L2,464.83
You save:  L739.52
₲519,197.15
List Price:  ₲741,742.01
You save:  ₲222,544.85
$U2,684.12
List Price:  $U3,834.62
You save:  $U1,150.50
zł281.58
List Price:  zł402.27
You save:  zł120.69
Already have an account? Log In

Transcript

All right, so welcome back again. So in this wonderful session, we try to see another option with the click estra. We try to see how to work with click plugins, right. So let's say you have created your own plugins for CLR. And I want to be able to see how to use it to be using plugins to be able to see a simple example of how to use a plugin. So let's see an example.

So we have a simple plugin that you're working on, which is called click command tree. So the first thing that you just need to install click plugin to just go with this pip install. Click plugins, right, so just how to install plugins on your system. So I've already installed it so we just move on straightaway. There is going to be the first option. Now let's see what I mean by with an example of the click command tree.

So the click command to allows you to give a tree structure of all the viewers structure or commands for your CLA. So let's see an example. So if I come back to you simply send me another one and then you just choose to One here to just get an overview of what the tree looks like. Right? So this is how the tree is like. So if I go to a tree for my demo to see that this is given us a format of a tree structure, so we have model one model two window.

So I'm going to have clip tutorials, click extraordinary. So this is like the format of a tree. So how do you make your CLS show that particular format of a tree, a hierarchy of how your commands are supposed to be? That is when we use click command tree, so let's see how to work with it. So I've already installed click plugins, they can just go with this option. To install click command tree, right, so let's try to see.

So I'm just going to be picking one of our commodity I've done already, which is going to be our subgroup. CLA, right? This particular one is showing its subgroups. Then we'll be using that one, just copy it and then we'll duplicate it. Just going to I'm going to name it as click plugins to click plugins, sila, right. And I'm going to store the time I click a strategy that I've been doing, which is going to be.pi.

Very simple. If it's not, let's see how to work with it to the simplest way. Okay with that after installing click plugins, you also need to install our click commentary option, right and I'm using this commentary to help us do that. So let me install it, copy it here, then you paste it inside our CLA. So that is how to install it on our system. So let's start working with it.

So I've come back to my location here, which is having my click plug in. So let's see how to add it to it today. simplex readers, first of which is going to input from CLA from click, and that's what plugins the one we installed. Right then a good import with proteins with Get the basic idea right that is all you need, then you need to install packages to from package resources, which is the cartridges stamp you put an entry points into entry point to this number to either enter it either entry point me is punished I see terrible entry point the entry point to to be the location in which is going to be plugged we used to plug in into a very simple right. So, from particular sources input into other entry points, very simple then the next thing that you be important the different package that you want to use.

So, whatever kind of package you want you to be using that particular package here. So, let's see that package up using perfect so, that is whatever you need to the next option that we're just going to come back to the top of our file, right our parent file which is is please turn up using a critical with plugins right every plugin To import it from here, we are using that particular plug in security to enable us to hook or plug inside our plug in that you have downloaded. It's that easy peasy idea, I'm just going to eat it. There we go. Right at entry point. So this is going to be the entry point for be pushing or be hooking our plugin that you want to have.

So this is going to be a simple example of the plugin we are using. So we are using the click mantri plugin is going to be our click. And that's a common treat. Right. So this click command is what we are installing on our system. Favorite very simple, very interesting.

So let's save it here. And then now let's run it. So this is all that we need. So this commentary is going to be uploading and we are using this particular option. Because anytime you build a CI or you bought a package there is usually an entry point right? So that is where we'll be hooking into everything with plugins to enable us to hook the entire stuff into our mind.

Mean up. So you have to see the functionalities up there. Let's save it and let's run it again. I'll come back here. And then let's run from Python three did not pass in the click plugins CLA that does help. agree that says hope now you'll be able to see the tree option as part of it, hopefully, hopefully doesn't give us any errors.

We see that now we can see the tree option here right so this tree is not the commander that's been added to our satellite because it's not plugged in at hooking to our car. Very interesting. So now I can just come back to displace. Let's go with tree and I'm going to show the tree structure of a very interesting so this is going to be the tree structure of up all the basic commands. So we have a capitalized and capitalized you have upper and reverse we have lower and upper. We have the shoe hope had the tree so that is how to add click plugins in our show.

A 50 need to is to install click plugins and nothing All click plugins just have to input data entry points from particular sources. Then you just hook it up usually cook or download your plug whatever plug in that you have created. Then you hook it up about your main function here in this particular format, and then it's going to give you the option of using that particular plug in here. So in case I put any plug in different plug in here to be shown here. So that is the basic idea about working with click plugins and then showing commentary. Thank you for watching and see you in the next session.

Stable

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.