Skip to content

Commit bf8ad1a

Browse files
authored
Merge pull request #201 from JulienPalard/mdk-various
Various things while doodling around
2 parents 9c31edc + 32c9c3a commit bf8ad1a

File tree

10 files changed

+25
-23
lines changed

10 files changed

+25
-23
lines changed

CONTRIBUTING.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ First, if you want to add a cool plugin, consider submit a pull request to the
77

88
Feel free to clone the project on `GitHub <https://github.com/gawel/irc3>`_.
99

10+
To test your change you can run irc3 in debug mode using::
11+
12+
$ irc3 --debug path-to-your-conf.ini
13+
1014
Once you made a change, try to add a test for your feature/fix. At least assume
1115
that you have'nt broke anything by running tox::
1216

@@ -40,9 +44,7 @@ And check the result::
4044

4145
$ firefox .tox/docs/tmp/html/index.html
4246

43-
The project is `buildout <https://github.com/buildout/buildout>`_ ready. You
44-
can generate binaries using it instead of virtualenv::
47+
The project uses ``setuptools``, you can test-install it using `pip`:
4548

46-
$ python bootstrap.py
47-
$ bin/buildout
48-
$ bin/irc3 -h
49+
$ pip install .
50+
$ irc3 -h

docs/conf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
master_doc = 'index'
4141

4242
# General information about the project.
43-
project = u'irc3'
44-
copyright = u'2013, Gael Pasgrimaud'
43+
project = 'irc3'
44+
copyright = '2013, Gael Pasgrimaud'
4545

4646
# The version info for the project you're documenting, acts as replacement for
4747
# |version| and |release|, also used in various other places throughout the
@@ -183,8 +183,8 @@
183183
# Grouping the document tree into LaTeX files. List of tuples
184184
# (source start file, target name, title, author, documentclass [howto/manual]).
185185
latex_documents = [
186-
('index', 'irc3.tex', u'irc3 Documentation',
187-
u'Gael Pasgrimaud', 'manual'),
186+
('index', 'irc3.tex', 'irc3 Documentation',
187+
'Gael Pasgrimaud', 'manual'),
188188
]
189189

190190
# The name of an image file (relative to this directory) to place at the top of
@@ -213,8 +213,8 @@
213213
# One entry per manual page. List of tuples
214214
# (source start file, name, description, authors, manual section).
215215
man_pages = [
216-
('index', 'irc3', u'irc3 Documentation',
217-
[u'Gael Pasgrimaud'], 1)
216+
('index', 'irc3', 'irc3 Documentation',
217+
['Gael Pasgrimaud'], 1)
218218
]
219219

220220
# If true, show URL addresses after external links.
@@ -227,8 +227,8 @@
227227
# (source start file, target name, title, author,
228228
# dir menu entry, description, category)
229229
texinfo_documents = [
230-
('index', 'irc3', u'irc3 Documentation',
231-
u'Gael Pasgrimaud', 'irc3', 'One line description of project.',
230+
('index', 'irc3', 'irc3 Documentation',
231+
'Gael Pasgrimaud', 'irc3', 'One line description of project.',
232232
'Miscellaneous'),
233233
]
234234

irc3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async def process_queue(self):
207207
if self.queue.empty():
208208
break
209209
if lines:
210-
self.send(u'\r\n'.join(lines))
210+
self.send('\r\n'.join(lines))
211211
while not self.queue.empty():
212212
await asyncio.sleep(flood_rate, loop=self.loop)
213213
future, data = await self.queue.get()

irc3/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def include(self, *modules, **kwargs):
199199
scanner = self.venusian.Scanner(context=self)
200200
for module in modules:
201201
if module in reg.includes:
202-
self.log.warn('%s included twice', module)
202+
self.log.warning('%s included twice', module)
203203
else:
204204
reg.includes.add(module)
205205
try:

irc3/dec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def plugin(wrapped):
1515
class event:
1616
r"""register a method or function an irc event callback::
1717
18-
>>> @event('^:\S+ 353 [^&#]+(?P<channel>\S+) :(?P<nicknames>.*)')
18+
>>> @event(r'^:\S+ 353 [^&#]+(?P<channel>\S+) :(?P<nicknames>.*)')
1919
... def on_names(bot, channel=None, nicknames=None):
2020
... '''this will catch nickname when you enter a channel'''
2121
... print(channel, nicknames.split(':'))

irc3/plugins/asynchronious.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Whois(AsyncEvents):
7777
# (?i) is for IGNORECASE. This will match either NicK or nick
7878
{'match': r"(?i)^:\S+ 301 \S+ {nick} :(?P<away>.*)"},
7979
{'match': r"(?i)^:\S+ 311 \S+ {nick} (?P<username>\S+) "
80-
r"(?P<host>\S+) . :(?P<realname>.*)(?i)"},
80+
r"(?P<host>\S+) . :(?P<realname>.*)"},
8181
{'match': r"(?i)^:\S+ 312 \S+ {nick} (?P<server>\S+) "
8282
r":(?P<server_desc>.*)"},
8383
{'match': r"(?i)^:\S+ 317 \S+ {nick} (?P<idle>[0-9]+).*"},

irc3/plugins/human.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def initialize(self, amount): # pragma: no cover
6767
quotes = [v['joke'] for v in quotes['value']]
6868
except Exception:
6969
self.bot.log.error('Failed to get quotes from api.icndb.com')
70-
quotes = [u'Hi!', u'lol']
70+
quotes = ['Hi!', 'lol']
7171
self.bot.log.info('Initialise %s with %s quotes',
7272
self.db, len(quotes))
7373
with codecs.open(self.db, 'w', 'utf8') as fd:
74-
fd.write(u'\n'.join(quotes))
74+
fd.write('\n'.join(quotes))
7575

7676
@irc3.event(irc3.rfc.MY_PRIVMSG)
7777
def on_message(self, mask=None, event=None, target=None, data=None, **kw):

irc3/plugins/shell_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ async def shell_command(self, command, mask, target, args, **kwargs):
116116
lines = await proc.stdout.read()
117117
if not isinstance(lines, str):
118118
lines = lines.decode('utf8')
119-
return lines.split(u'\n')
119+
return lines.split('\n')

tests/test_casefold.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_ascii(self):
1414
self.assertEquals(bot.casefold('#tESt[]chAn'), '#test[]chan')
1515
self.assertEquals(bot.casefold('#TEsT\\CHaN'), '#test\\chan')
1616

17-
self.assertEquals(bot.casefold(u'#TEsT\\CHaN'), u'#test\\chan')
17+
self.assertEquals(bot.casefold('#TEsT\\CHaN'), '#test\\chan')
1818

1919
def test_rfc1459(self):
2020
bot = self.callFTU(server_config={'CASEMAPPING': 'rfc1459'})
@@ -24,4 +24,4 @@ def test_rfc1459(self):
2424
self.assertEquals(bot.casefold('#tESt[]chAn'), '#test{}chan')
2525
self.assertEquals(bot.casefold('#TEsT\\CHaN'), '#test|chan')
2626

27-
self.assertEquals(bot.casefold(u'#TEsT\\CHaN'), u'#test|chan')
27+
self.assertEquals(bot.casefold('#TEsT\\CHaN'), '#test|chan')

tests/test_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_logger(self):
3030
filenames = os.listdir(self.logdir)
3131
self.assertEqual(len(filenames), 0, filenames)
3232

33-
bot.dispatch(u':server 332 foo #foo :topîc')
33+
bot.dispatch(':server 332 foo #foo :topîc')
3434
filenames = glob.glob(os.path.join(self.logdir, '*.log'))
3535
self.assertEqual(len(filenames), 1, filenames)
3636

0 commit comments

Comments
 (0)