Comments (2)
Hello,
It functions in exactly the same way as the list.remove()
method does in Python, which is to say that it removes anything with the exact value it is given. It can even handle removing multiple values.
>>> import nginx
>>> s = nginx.Server()
>>> s.add(
... nginx.Key('first_test', 'one'),
... nginx.Key('second_test', 'two'),
... )
[<nginx.Key object at 0x7f259b0f0190>, <nginx.Key object at 0x7f259b0f0c50>]
>>> s.keys
[<nginx.Key object at 0x7f259b0f0190>, <nginx.Key object at 0x7f259b0f0c50>]
>>> key_to_remove = s.filter('Key', 'first_test')[0]
>>> key_to_remove
<nginx.Key object at 0x7f259b0f0190>
>>> s.remove(key_to_remove)
[<nginx.Key object at 0x7f259b0f0c50>]
>>> s.keys
[<nginx.Key object at 0x7f259b0f0c50>]
>>>
from python-nginx.
think you very much !!!
from python-nginx.
Related Issues (20)
- BUG: wrong result about { HOT 1
- "internal" directive disappears after configuration edit HOT 1
- IndexError: list index out of range HOT 5
- Crashes if it finds map
- 解析不了 session_sticky; 这样命令 HOT 2
- Bug in upstream when have quote
- Fails to import in python3 HOT 2
- load nginx.conf failed HOT 5
- Incorrect parsing if ';' in value HOT 3
- Probably incorrect regular expression in directive parsing
- Documentation: Request example of editing a configuration HOT 6
- In this case, it's stuck HOT 3
- argument of type 'int' is not iterable HOT 2
- list index out of range when location contains curly braces HOT 1
- Failing parsing without new line at the end of file HOT 2
- Failing parsing with quotes HOT 1
- possibility to parse included configs
- Nginx.py is not working with python3 module (ModuleNotFoundError: No module named 'nginx') HOT 2
- Regexp issue with lot of spaces in the end of config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-nginx.